From 5a396e5af526263e7b401f2f000a1847370664de Mon Sep 17 00:00:00 2001 From: Sven 'sleipnir' Rebhan Date: Fri, 26 Mar 2010 09:08:40 +0100 Subject: Fix python-2.6.4* install problems by skipping test_unicode during cross-compilation. Additionally, provide a cleaned up and much less intrusive setup.py patch. Happy testing! --- dev-lang/python/Manifest | 4 +- .../python-2.6.4-cross-setup-sysroot-test.patch | 191 +++++++++++++++++++++ .../python-2.6.4-cross-skip-test_unicode.patch | 16 ++ dev-lang/python/python-2.6.4-r1.ebuild | 4 +- 4 files changed, 213 insertions(+), 2 deletions(-) create mode 100644 dev-lang/python/files/python-2.6.4-cross-setup-sysroot-test.patch create mode 100644 dev-lang/python/files/python-2.6.4-cross-skip-test_unicode.patch diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest index ada4b4d..adb0c8c 100644 --- a/dev-lang/python/Manifest +++ b/dev-lang/python/Manifest @@ -16,7 +16,9 @@ AUX python-2.6-cross-setup-sysroot.patch 10406 RMD160 30d715895f1d48d2acb039549c AUX python-2.6-enable-ctypes-cross-build.patch 1439 RMD160 ce61a6b7bd16fb812ea6cc8821d73b53b597e0be SHA1 410b1b3e4b108dbf814bacbc8b7eacba8f52a61b SHA256 bb57add95e66690d1b0ddc717d5f0e9bd9e6bdc2ceba7a293ad183be6f87cd7c AUX python-2.6-test-cross.patch 914 RMD160 1f421b5565d39a24b887e85cbecaf3857741f756 SHA1 9c05fbe28aac6373f24317db5c277bc4549dde0c SHA256 8264f6ffe5aedcce67bea00b0346e5416a5486da2229bf82fe748d87ec65c4de AUX python-2.6.4-cross-libffi-pkg-config.patch 534 RMD160 923b49a6d89954de4da90de27faa7d076875d898 SHA1 63224b0d35516d90346ace527815532762e43414 SHA256 e7f9309c2dd651a74df32412172ec29ca5797e05ebf8883c2cf52f14b15880d0 +AUX python-2.6.4-cross-setup-sysroot-test.patch 8530 RMD160 9c255d74263f29ae6983611a6b9219d2334a00eb SHA1 949b0a830bb0ae4344b54405075d428f42927777 SHA256 0125498faa08dff630aa838793cca39ab7fe75ff5a130e8661ef1e7278a989eb AUX python-2.6.4-cross-setup-sysroot.patch 11648 RMD160 90d58d00d2c6e27104a83281e9db4ddf56dacae4 SHA1 fb599e6d69c95710f59d6799c01a50eee1d74349 SHA256 17bcc15eac99fb055761ac359612ad6b32e796d36e5474a044d2bba8a4294f1f +AUX python-2.6.4-cross-skip-test_unicode.patch 844 RMD160 4cd4b5514689efcecebfd0583556e80c741934d0 SHA1 eb13f108d01f17250cd3d69f8c42fbc030bb75fc SHA256 ce68aaca7e3897152637a5f05b69b2d62a3e18288020cdfdfc7c67f9a73d5e22 AUX python-2.6_turkish.patch 4606 RMD160 e8a12a537fd81e8a4de0f29ce57ebf48cf786e69 SHA1 9ae0d969f34513da90b87bed966d48ea91b46bf2 SHA256 1f90030a415a5395b14677dce1bd07fbaa56d235aecd4fdfae086d09f756c138 DIST Python-2.5.4.tar.bz2 9821313 RMD160 3a76c83464c3b1c38a60351ab054e33ac7195663 SHA1 0f2e819d6381f72f26c734e00a6780b3933ea404 SHA256 bc8d896a2bfe5523ba93b8d89b71017b74e8e6cb21dc676a0ccff668c8780110 DIST Python-2.6.2.tar.bz2 11156901 RMD160 85fa3540cbacf4d0547d2381eb3aa76bef35c2e1 SHA1 125d4ed90f82de1d44f288150bbbda23a6cd27a4 SHA256 a1cdc4a8f6c1f947ea3b87d097af2db4371019bac941d92c3844124c5694328b @@ -29,5 +31,5 @@ DIST python-gentoo-patches-2.6.4.tar.bz2 11032 RMD160 83903892ef18880f876e7a140c EBUILD python-2.5.4-r3.ebuild 9962 RMD160 b9c89cb2974b233ee43ac12971deaa2e3c2549c3 SHA1 b477647a53d9b958146868dabb4e451161e3d91b SHA256 8ad3de1c73110d0fa1233539d58d75e74dd411e8c955bbbd0b5d967f2e49a5a6 EBUILD python-2.6.2-r1.ebuild 9374 RMD160 e2b6b466ff8cfa363d5af68aadd9189daa9bdbfd SHA1 3d207025be7d8ad30f548a351a695dbec641b227 SHA256 cce9f301cae10a0c8e6ce29a9161f3c72b0cf91d372dfbb18006d28ccbde9b8f EBUILD python-2.6.2-r2.ebuild 11162 RMD160 9f3215c3353f41a7427334b22d1dd00c54e852eb SHA1 7c8b87d5abcb511bb0e6c85871e0c4098d0be41c SHA256 2e431e703e3b255f619e45295c529a7abb13898014330d6d2aeea474da36a424 -EBUILD python-2.6.4-r1.ebuild 10108 RMD160 3a3695ec07eb7486ab8225068126ed8f5b3c7fde SHA1 9dcb4f47f31bf297051f621e8cd604a4aa4edddb SHA256 d810ad160594b4003ce57d4e025fe91f2209778f6524c7dccbcd5238d2d79173 +EBUILD python-2.6.4-r1.ebuild 10242 RMD160 73666189dff0c830e9d74f63f1d08f2eb6fd0d41 SHA1 77ae4f48f5306e4eb14e8162cddd3e77e785fbc7 SHA256 0bf9037d2a1689cca4b96fc6b04902f4260b0bc644a8eae9e7e0ac5a28f3c80f EBUILD python-2.6.4.ebuild 10901 RMD160 b93e3e3c93b83778014b007476f12c2a8014e354 SHA1 4c95cc7084aeab1a576e64f8b682335c7ed0911a SHA256 fc21b47629be944003757b39ad4c846b567708f96a718dc8228d08624a7925ef diff --git a/dev-lang/python/files/python-2.6.4-cross-setup-sysroot-test.patch b/dev-lang/python/files/python-2.6.4-cross-setup-sysroot-test.patch new file mode 100644 index 0000000..caba5b7 --- /dev/null +++ b/dev-lang/python/files/python-2.6.4-cross-setup-sysroot-test.patch @@ -0,0 +1,191 @@ +--- setup.py 2010-03-25 20:41:53.000000000 +0100 ++++ setup.py.new 2010-03-25 20:43:03.000000000 +0100 +@@ -29,9 +29,20 @@ + else: + disable_ssl = 0 + ++# This global variable contains the user specified sysroot. ++sysroot = os.getenv('SYSROOT') + + exit_status = 0 + ++def add_sysroot(dirlist): ++ if sysroot is None: ++ return dirlist ++ ++ if type(dirlist) == str: ++ return os.path.join(sysroot, dirlist) ++ ++ return map(lambda x: sysroot+x if os.path.isabs(x) and not x.startswith(os.getcwd()) else x, dirlist) ++ + def add_dir_to_list(dirlist, dir): + """Add the directory 'dir' to the list 'dirlist' (at the front) if + 1) 'dir' is not already in 'dirlist' +@@ -375,14 +387,20 @@ + except NameError: + have_unicode = 0 + ++ # Make sure we respect the sysroot path if there is any ++ self.compiler.include_dirs = add_sysroot(self.compiler.include_dirs) ++ self.compiler.library_dirs = add_sysroot(self.compiler.library_dirs) ++ + # lib_dirs and inc_dirs are used to search for files; + # if a file is found in one of those directories, it can + # be assumed that no additional -I,-L directives are needed. +- lib_dirs = self.compiler.library_dirs + [ ++ lib_dirs = self.compiler.library_dirs + add_sysroot([ + '/lib64', '/usr/lib64', + '/lib', '/usr/lib', +- ] +- inc_dirs = self.compiler.include_dirs + ['/usr/include'] ++ ]) ++ inc_dirs = self.compiler.include_dirs + add_sysroot([ ++ '/usr/include' ++ ]) + exts = [] + missing = [] + +@@ -602,11 +620,11 @@ + elif self.compiler.find_library_file(lib_dirs, 'curses'): + readline_libs.append('curses') + elif self.compiler.find_library_file(lib_dirs + +- ['/usr/@@GENTOO_LIBDIR@@/termcap'], ++ add_sysroot(['/usr/@@GENTOO_LIBDIR@@/termcap']), + 'termcap'): + readline_libs.append('termcap') + exts.append( Extension('readline', ['readline.c'], +- library_dirs=['/usr/@@GENTOO_LIBDIR@@/termcap'], ++ library_dirs=add_sysroot(['/usr/@@GENTOO_LIBDIR@@/termcap']), + extra_link_args=readline_extra_link_args, + libraries=readline_libs) ) + else: +@@ -630,22 +648,23 @@ + exts.append( Extension('_socket', ['socketmodule.c'], + depends = ['socketmodule.h']) ) + # Detect SSL support for the socket module (via _ssl) +- search_for_ssl_incs_in = [ ++ search_for_ssl_incs_in = add_sysroot([ + '/usr/local/ssl/include', + '/usr/contrib/ssl/include/' +- ] ++ ]) + ssl_incs = find_file('openssl/ssl.h', inc_dirs, + search_for_ssl_incs_in + ) + if ssl_incs is not None and not disable_ssl: + krb5_h = find_file('krb5.h', inc_dirs, +- ['/usr/kerberos/include']) ++ add_sysroot(['/usr/kerberos/include'])) + if krb5_h: + ssl_incs += krb5_h + ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs, ++ add_sysroot( + ['/usr/local/ssl/lib', + '/usr/contrib/ssl/lib/' +- ] ) ++ ]) ) + + if (ssl_incs is not None and + ssl_libs is not None and +@@ -747,6 +766,7 @@ + return False + return True + ++ + def gen_db_minor_ver_nums(major): + if major == 4: + for x in range(max_db_ver[1]+1): +@@ -789,6 +809,7 @@ + db_inc_paths.append('/usr/local/include/db3%d' % x) + db_inc_paths.append('/pkg/db-3.%d/include' % x) + db_inc_paths.append('/opt/db-3.%d/include' % x) ++ db_inc_paths = add_sysroot(db_inc_paths) + + # Add some common subdirectories for Sleepycat DB to the list, + # based on the standard include directories. This way DB3/4 gets +@@ -910,13 +931,14 @@ + # We hunt for #define SQLITE_VERSION "n.n.n" + # We need to find >= sqlite version 3.0.8 + sqlite_incdir = sqlite_libdir = None +- sqlite_inc_paths = [ '/usr/include', ++ sqlite_inc_paths = add_sysroot( ++ [ '/usr/include', + '/usr/include/sqlite', + '/usr/include/sqlite3', + '/usr/local/include', + '/usr/local/include/sqlite', + '/usr/local/include/sqlite3', +- ] ++ ]) + MIN_SQLITE_VERSION_NUMBER = (3, 0, 8) + MIN_SQLITE_VERSION = ".".join([str(x) + for x in MIN_SQLITE_VERSION_NUMBER]) +@@ -1010,7 +1032,7 @@ + # we do not build this one. Otherwise this build will pick up + # the more recent berkeleydb's db.h file first in the include path + # when attempting to compile and it will fail. +- f = "/usr/include/db.h" ++ f = add_sysroot("/usr/include/db.h") + if os.path.exists(f) and not db_incs: + data = open(f).read() + m = re.search(r"#s*define\s+HASHVERSION\s+2\s*", data) +@@ -1225,12 +1247,12 @@ + # More information on Expat can be found at www.libexpat.org. + # + # Use system expat +- expatinc = '/usr/include' ++ expatinc = add_sysroot(['/usr/include']) + define_macros = [] + + exts.append(Extension('pyexpat', + define_macros = define_macros, +- include_dirs = [expatinc], ++ include_dirs = expatinc, + libraries = ['expat'], + sources = ['pyexpat.c', + ], +@@ -1535,7 +1557,7 @@ + # For 8.4a2, the X11 headers are not included. Rather than include a + # complicated search, this is a hard-coded path. It could bail out + # if X11 libs are not found... +- include_dirs.append('/usr/X11R6/include') ++ include_dirs.append(add_sysroot('/usr/X11R6/include')) + frameworks = ['-framework', 'Tcl', '-framework', 'Tk'] + + # All existing framework builds of Tcl/Tk don't support 64-bit +@@ -1619,20 +1641,24 @@ + include_dirs.append(dir) + + # Check for various platform-specific directories ++ x_include_dirs = [] ++ x_added_lib_dirs = [] + if platform == 'sunos5': +- include_dirs.append('/usr/openwin/include') +- added_lib_dirs.append('/usr/openwin/lib') +- elif os.path.exists('/usr/X11R6/include'): +- include_dirs.append('/usr/X11R6/include') +- added_lib_dirs.append('/usr/X11R6/lib64') +- added_lib_dirs.append('/usr/X11R6/lib') +- elif os.path.exists('/usr/X11R5/include'): +- include_dirs.append('/usr/X11R5/include') +- added_lib_dirs.append('/usr/X11R5/lib') ++ x_include_dirs.append('/usr/openwin/include') ++ x_added_lib_dirs.append('/usr/openwin/lib') ++ elif os.path.exists(add_sysroot('/usr/X11R6/include')): ++ x_include_dirs.append('/usr/X11R6/include') ++ x_added_lib_dirs.append('/usr/X11R6/lib64') ++ x_added_lib_dirs.append('/usr/X11R6/lib') ++ elif os.path.exists(add_sysroot('/usr/X11R5/include')): ++ x_include_dirs.append('/usr/X11R5/include') ++ x_added_lib_dirs.append('/usr/X11R5/lib') + else: + # Assume default location for X11 +- include_dirs.append('/usr/X11/include') +- added_lib_dirs.append('/usr/X11/lib') ++ x_include_dirs.append('/usr/X11/include') ++ x_added_lib_dirs.append('/usr/X11/lib') ++ include_dirs += add_sysroot(x_include_dirs) ++ added_lib_dirs += add_sysroot(x_added_lib_dirs) + + # If Cygwin, then verify that X is installed before proceeding + if platform == 'cygwin': diff --git a/dev-lang/python/files/python-2.6.4-cross-skip-test_unicode.patch b/dev-lang/python/files/python-2.6.4-cross-skip-test_unicode.patch new file mode 100644 index 0000000..e3214be --- /dev/null +++ b/dev-lang/python/files/python-2.6.4-cross-skip-test_unicode.patch @@ -0,0 +1,16 @@ +--- Makefile.pre.in 2010-03-26 07:55:34.000000000 +0100 ++++ Makefile.pre.in.new 2010-03-26 08:01:12.000000000 +0100 +@@ -906,11 +906,11 @@ + PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ + ./$(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \ + -d $(LIBDEST) -f \ +- -x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST) ++ -x 'bad_coding|badsyntax|site-packages|test_unicode' $(DESTDIR)$(LIBDEST) + PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ + ./$(HOSTPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \ + -d $(LIBDEST) -f \ +- -x 'bad_coding|badsyntax|site-packages' $(DESTDIR)$(LIBDEST) ++ -x 'bad_coding|badsyntax|site-packages|test_unicode' $(DESTDIR)$(LIBDEST) + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ + ./$(HOSTPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \ + -d $(LIBDEST)/site-packages -f \ diff --git a/dev-lang/python/python-2.6.4-r1.ebuild b/dev-lang/python/python-2.6.4-r1.ebuild index 88c5616..96f81f8 100644 --- a/dev-lang/python/python-2.6.4-r1.ebuild +++ b/dev-lang/python/python-2.6.4-r1.ebuild @@ -82,7 +82,9 @@ src_prepare() { if tc-is-cross-compiler ; then # Change setup.py to respect the SYSROOT environment variable - epatch "${FILESDIR}"/python-2.6.4-cross-setup-sysroot.patch + epatch "${FILESDIR}"/python-2.6.4-cross-setup-sysroot-test.patch + # Skip the unicode test as it fails during cross-compilation + epatch "${FILESDIR}"/python-2.6.4-cross-skip-test_unicode.patch fi # Add a libdirname to enable python cross-compiling and add a user specifyable libdir -- cgit v1.2.3-65-gdbad