diff options
author | Maksim 'max_posedon' Melnikau <maxposedon@gmail.com> | 2009-05-03 12:36:27 +0000 |
---|---|---|
committer | Maksim 'max_posedon' Melnikau <maxposedon@gmail.com> | 2009-05-03 12:36:27 +0000 |
commit | df8b0ad379ee763009c943e16c4db448b6c96a47 (patch) | |
tree | 61c2b9d18ed431d07d3e9ef5344e1de2b282ba5c /dev-lang | |
parent | glew add ~arm keyword, and fix cross compilation. (diff) | |
download | embedded-cross-df8b0ad379ee763009c943e16c4db448b6c96a47.tar.gz embedded-cross-df8b0ad379ee763009c943e16c4db448b6c96a47.tar.bz2 embedded-cross-df8b0ad379ee763009c943e16c4db448b6c96a47.zip |
python-2.6.2 cross compiled, but not fully tested
Diffstat (limited to 'dev-lang')
-rw-r--r-- | dev-lang/python/Manifest | 10 | ||||
-rw-r--r-- | dev-lang/python/files/python-2.6-chflags-cross.patch | 59 | ||||
-rw-r--r-- | dev-lang/python/files/python-2.6-cross-distutils-sysconfig.patch | 43 | ||||
-rw-r--r-- | dev-lang/python/files/python-2.6-cross-patch-tweak.patch | 15 | ||||
-rw-r--r-- | dev-lang/python/files/python-2.6-cross-setup-sysroot.patch | 219 | ||||
-rw-r--r-- | dev-lang/python/files/python-2.6-enable-ctypes-cross-build.patch | 28 | ||||
-rw-r--r-- | dev-lang/python/files/python-2.6-test-cross.patch | 19 | ||||
-rw-r--r-- | dev-lang/python/files/python-2.6_turkish.patch | 130 | ||||
-rw-r--r-- | dev-lang/python/python-2.6.2.ebuild | 280 |
9 files changed, 803 insertions, 0 deletions
diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest index f80361c..c34519a 100644 --- a/dev-lang/python/Manifest +++ b/dev-lang/python/Manifest @@ -13,9 +13,19 @@ AUX python-2.5.2-cross-setup-sysroot.patch 11356 RMD160 4d19bfc67e298a6b9b24adfc AUX python-2.5.2_turkish.patch 4882 RMD160 69486e369849e0706f4261410f231649397cf793 SHA1 1dc369bdfb10bc9ddb63a5672fa561acf8dee32c SHA256 bf4019ae2acd4b6868db0b625910f668f857711ae00b29f638d038611444b169 AUX python-2.5.4-cross-Makefile.pre.in.patch 349 RMD160 c46f87b9b232e1d2f55a60e2558edcb2fa0efd50 SHA1 04e915c1e29c8e15f48a240853af1ee6c9210674 SHA256 a0b6313dcd6aeed2cb1b82353a2e339fe79cd9b861811cb67e90739ec84deec7 AUX python-2.5.4-enable-ctypes-module.patch 3034 RMD160 6374bbd2ad13e180324aa5d97ff42ab52a3d3118 SHA1 77b2d479d0ba37cec4d71c29c8d6ffe651a15765 SHA256 4f3ba96b5a5986adbffc8385299780b2a2b3aa7b6875c2c46d16a50bba258516 +AUX python-2.6-chflags-cross.patch 1716 RMD160 b0ec772a41a24d51f4c7430b19bcc6251cd6be87 SHA1 4745cd53cef503c41c50573ad97f40eb89fd4bcd SHA256 7c36689db47720052069725036983c2fb6959f425e3777aae55976b2788d463f +AUX python-2.6-cross-distutils-sysconfig.patch 1802 RMD160 346449ad5f2f77411dd59e489c22900e40a51bb1 SHA1 59d147726780a131c693e8a6c309f07ac1e52597 SHA256 b0782e2a98103c55a37ca05ad17845762eaaa63ca2bf29d0d342be996a7019d9 +AUX python-2.6-cross-patch-tweak.patch 717 RMD160 4791a798b494de925100c33ad42c214038414d7f SHA1 c84d19c2846136eb5cfb2da6a316f7d9688b7c90 SHA256 9a5c4142738daf1fe0f78747ee4b03c4402c2b84f1349150dce99f6631688abd +AUX python-2.6-cross-setup-sysroot.patch 10406 RMD160 30d715895f1d48d2acb039549ca58a03f1b06ee0 SHA1 28b01657df80581d9eb82058e12bc93d67657cf6 SHA256 0867495ee0204167ff2cc5af9998e30281829b4cc1d0d340b61dd7da35950065 +AUX python-2.6-enable-ctypes-cross-build.patch 1410 RMD160 10f2f0be8a389a3ae5ed33a971132fcf8b65ea44 SHA1 473f65d8d677ec7ed2bbbe788fe70d68d515ae5a SHA256 f7c508884760b0aeebc97eb194abe02298e343ce96f44ff67068d6fb7ffa896e +AUX python-2.6-test-cross.patch 914 RMD160 1f421b5565d39a24b887e85cbecaf3857741f756 SHA1 9c05fbe28aac6373f24317db5c277bc4549dde0c SHA256 8264f6ffe5aedcce67bea00b0346e5416a5486da2229bf82fe748d87ec65c4de +AUX python-2.6_turkish.patch 4606 RMD160 e8a12a537fd81e8a4de0f29ce57ebf48cf786e69 SHA1 9ae0d969f34513da90b87bed966d48ea91b46bf2 SHA256 1f90030a415a5395b14677dce1bd07fbaa56d235aecd4fdfae086d09f756c138 DIST Python-2.5.2.tar.bz2 9807597 RMD160 b23b02739833e6730799c5866e2b77aae884b63f SHA1 4755d212f50af704c20224a6966e23acc5aea60f SHA256 f2f80e2a62a039e9a1ffa0fdf58707b2d12b3ff33c56472b46bb6d53f45e083e 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 DIST python-gentoo-patches-2.5.2-r8.tar.bz2 28376 RMD160 c4e02a5ed947b253781ec11fd9f5f26498e41c81 SHA1 92e359402e7b6751b28671e19ad7ea0736b62614 SHA256 c008abb01c40057facf3d7fa8ad3a31e792f1b7d41bba96e0084e7476e05a0e3 DIST python-gentoo-patches-2.5.4.tar.bz2 19474 RMD160 00bb0918414db251b11b7f19a9f8a112c9e49fbd SHA1 fd4955f7da3049abecc4df0e203e783a90390cf8 SHA256 6e050dd8e8a90655bf935af99ad1ae6456bc072f075ddb9bcd532201bbb37274 +DIST python-gentoo-patches-2.6.2.tar.bz2 8848 RMD160 e3cf700fd8966a6bd6e3e4b64534b72e56863819 SHA1 e073af86f27db77d2eb396ff78814f2b8920811b SHA256 9178be1a77893dc2c74e40073095bbc560d02e5456f1e6be6da20930470950f7 EBUILD python-2.5.2-r8.ebuild 11808 RMD160 23d50c9937fea1a4ad4856f7ce73c2a43c4be438 SHA1 050e8e2d9273423b3a3bcd8622edc65f0dbac9d6 SHA256 46e67fe27ebfd8cea8c64c40f71d15138c49bf793a2bcf624896aa04b8ea18e9 EBUILD python-2.5.4-r2.ebuild 11460 RMD160 726938ef8be895f9494b31e419e6a808f917f275 SHA1 2cf8c2fe0d52b60a844e149a63e49fe15574fb24 SHA256 62171b21b92edabeb9c27959310196253c2bcb83df6896a444dbb5a1c70b4db7 +EBUILD python-2.6.2.ebuild 9104 RMD160 91f101c0daa72b45923a377ae4a804198dc29e57 SHA1 e8b704e039507eac2707c59d40cfb439c24eeab1 SHA256 f0aa95fac14f513f4728e8d4b93644bfce2249c2ccf9537036221a6ad36f2ac8 diff --git a/dev-lang/python/files/python-2.6-chflags-cross.patch b/dev-lang/python/files/python-2.6-chflags-cross.patch new file mode 100644 index 0000000..9c4b6d2 --- /dev/null +++ b/dev-lang/python/files/python-2.6-chflags-cross.patch @@ -0,0 +1,59 @@ +if we're cross-compiling, fall back to a link-only test rather than trying +to run a program for the chflags functions + +--- python-2.6/configure.in ++++ python-2.6/configure.in +@@ -2565,7 +2565,7 @@ + + # On Tru64, chflags seems to be present, but calling it will + # exit Python +-AC_MSG_CHECKING(for chflags) ++AC_CACHE_CHECK([for chflags], [py_cv_has_chflags], [dnl + AC_TRY_RUN([ + #include <sys/stat.h> + #include <unistd.h> +@@ -2575,12 +2575,18 @@ + return 1; + return 0; + } +-],AC_DEFINE(HAVE_CHFLAGS, 1, Define to 1 if you have the `chflags' function.) +- AC_MSG_RESULT(yes), +- AC_MSG_RESULT(no) +-) ++], [py_cv_has_chflags="yes"], ++ [py_cv_has_chflags="no"], ++ [py_cv_has_chflags="cross"]) ++]) ++if test "$py_cv_has_chflags" = "cross" ; then ++ AC_CHECK_FUNC([chflags], [py_cv_has_chflags="yes"], [py_cv_has_chflags="no"]) ++fi ++if test "$py_cv_has_chflags" = "yes" ; then ++ AC_DEFINE(HAVE_CHFLAGS, 1, Define to 1 if you have the `chflags' function.) ++fi + +-AC_MSG_CHECKING(for lchflags) ++AC_CACHE_CHECK([for lchflags], [py_cv_has_lchflags], [dnl + AC_TRY_RUN([ + #include <sys/stat.h> + #include <unistd.h> +@@ -2590,10 +2596,16 @@ + return 1; + return 0; + } +-],AC_DEFINE(HAVE_LCHFLAGS, 1, Define to 1 if you have the `lchflags' function.) +- AC_MSG_RESULT(yes), +- AC_MSG_RESULT(no) +-) ++], [py_cv_has_lchflags="yes"], ++ [py_cv_has_lchflags="no"], ++ [py_cv_has_lchflags="cross"]) ++]) ++if test "$py_cv_has_lchflags" = "cross" ; then ++ AC_CHECK_FUNC([lchflags], [py_cv_has_lchflags="yes"], [py_cv_has_lchflags="no"]) ++fi ++if test "$py_cv_has_lchflags" = "yes" ; then ++ AC_DEFINE(HAVE_LCHFLAGS, 1, Define to 1 if you have the `lchflags' function.) ++fi + + dnl Check if system zlib has *Copy() functions + dnl diff --git a/dev-lang/python/files/python-2.6-cross-distutils-sysconfig.patch b/dev-lang/python/files/python-2.6-cross-distutils-sysconfig.patch new file mode 100644 index 0000000..279c1e4 --- /dev/null +++ b/dev-lang/python/files/python-2.6-cross-distutils-sysconfig.patch @@ -0,0 +1,43 @@ +--- Lib/distutils/sysconfig.py.orig 2009-04-20 08:25:43.000000000 +0300 ++++ Lib/distutils/sysconfig.py 2009-04-20 08:27:50.000000000 +0300 +@@ -19,9 +19,16 @@ + from distutils.errors import DistutilsPlatformError + + # These are needed in a couple of spots, so just compute them once. ++SYSROOT = os.getenv('SYSROOT') + PREFIX = os.path.normpath(sys.prefix) + EXEC_PREFIX = os.path.normpath(sys.exec_prefix) + ++# Make sure we respect the user specified SYSROOT environment variable ++# This is the first step to get distutils to crosscompile stuff ++if SYSROOT is not None: ++ PREFIX = os.path.normpath(SYSROOT+os.path.sep+PREFIX) ++ EXEC_PREFIX = os.path.normpath(SYSROOT+os.path.sep+EXEC_PREFIX) ++ + # Path to the base directory of the project. On Windows the binary may + # live in project/PCBuild9. If we're dealing with an x64 Windows build, + # it'll live in project/PCbuild/amd64. +@@ -110,6 +117,10 @@ + + If 'prefix' is supplied, use it instead of sys.prefix or + sys.exec_prefix -- i.e., ignore 'plat_specific'. ++ ++ For the posix system we can not always assume to have a lib64 directory ++ e.g. for cross-compile between 32 & 64 bit systems. So we test if the ++ 'lib64' directory exists and use the normal 'lib' dir as fallback. + """ + if prefix is None: + prefix = plat_specific and EXEC_PREFIX or PREFIX +@@ -118,6 +129,12 @@ + libpython = os.path.join(prefix, + "@@GENTOO_LIBDIR@@", + "python" + get_python_version()) ++ ++ if not os.path.exists(libpython): ++ libpython = os.path.join(prefix, ++ "lib", ++ "python" + get_python_version()) ++ + if standard_lib: + return libpython + else: diff --git a/dev-lang/python/files/python-2.6-cross-patch-tweak.patch b/dev-lang/python/files/python-2.6-cross-patch-tweak.patch new file mode 100644 index 0000000..4aa5cf4 --- /dev/null +++ b/dev-lang/python/files/python-2.6-cross-patch-tweak.patch @@ -0,0 +1,15 @@ +our patchset is out dated ... this really should get merged ... + +--- ../2.6/08_all_crosscompile.patch ++++ ../2.6/08_all_crosscompile.patch +@@ -60,8 +60,8 @@ + -d $(LIBDEST)/site-packages -f \ + -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \ +-- ./$(BUILDPYTHON) -Wi -t -c "import lib2to3.pygram" +-+ ./$(HOSTPYTHON) -Wi -t -c "import lib2to3.pygram" ++- ./$(BUILDPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()" +++ ./$(HOSTPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()" + + # Create the PLATDIR source directory, if one wasn't distributed.. + $(srcdir)/Lib/$(PLATDIR): diff --git a/dev-lang/python/files/python-2.6-cross-setup-sysroot.patch b/dev-lang/python/files/python-2.6-cross-setup-sysroot.patch new file mode 100644 index 0000000..7a64c04 --- /dev/null +++ b/dev-lang/python/files/python-2.6-cross-setup-sysroot.patch @@ -0,0 +1,219 @@ +--- setup.py.orig 2009-04-20 08:35:05.000000000 +0300 ++++ setup.py 2009-04-20 08:37:19.000000000 +0300 +@@ -333,9 +333,15 @@ + + def detect_modules(self): + global disable_ssl ++ ++ # We must respect the user specified sysroot! ++ sysroot=os.getenv('SYSROOT') ++ if sysroot is None: ++ sysroot='' ++ + # Ensure that /usr/local is always used +- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') +- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') ++ add_dir_to_list(self.compiler.library_dirs, sysroot+'/usr/local/lib') ++ add_dir_to_list(self.compiler.include_dirs, sysroot+'/usr/local/include') + + # Add paths specified in the environment variables LDFLAGS and + # CPPFLAGS for header and library files. +@@ -371,12 +377,20 @@ + for directory in reversed(options.dirs): + add_dir_to_list(dir_list, directory) + +- if os.path.normpath(sys.prefix) != '/usr': ++ if os.path.normpath(sys.prefix) != '/usr/local': + add_dir_to_list(self.compiler.library_dirs, + sysconfig.get_config_var("LIBDIR")) + add_dir_to_list(self.compiler.include_dirs, + sysconfig.get_config_var("INCLUDEDIR")) + ++ # We should always look into sysroot/usr/include and consider ++ # also the lib dirs there for searching for files ++ add_dir_to_list(self.compiler.include_dirs, sysroot+'/usr/include') ++ add_dir_to_list(self.compiler.library_dirs, sysroot+'/lib') ++ add_dir_to_list(self.compiler.library_dirs, sysroot+'/lib64') ++ add_dir_to_list(self.compiler.library_dirs, sysroot+'/usr/lib') ++ add_dir_to_list(self.compiler.library_dirs, sysroot+'/usr/lib64') ++ + try: + have_unicode = unicode + except NameError: +@@ -385,11 +399,8 @@ + # 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 + [ +- '/lib64', '/usr/lib64', +- '/lib', '/usr/lib', +- ] +- inc_dirs = self.compiler.include_dirs + ['/usr/include'] ++ lib_dirs = self.compiler.library_dirs ++ inc_dirs = self.compiler.include_dirs + exts = [] + missing = [] + +@@ -608,11 +619,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'], ++ [sysroot+'/usr/@@GENTOO_LIBDIR@@/termcap'], + 'termcap'): + readline_libs.append('termcap') + exts.append( Extension('readline', ['readline.c'], +- library_dirs=['/usr/@@GENTOO_LIBDIR@@/termcap'], ++ library_dirs=[sysroot+'/usr/@@GENTOO_LIBDIR@@/termcap'], + extra_link_args=readline_extra_link_args, + libraries=readline_libs) ) + else: +@@ -637,20 +648,20 @@ + depends = ['socketmodule.h']) ) + # Detect SSL support for the socket module (via _ssl) + search_for_ssl_incs_in = [ +- '/usr/local/ssl/include', +- '/usr/contrib/ssl/include/' ++ sysroot+'/usr/local/ssl/include', ++ sysroot+'/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']) ++ [sysroot+'/usr/kerberos/include']) + if krb5_h: + ssl_incs += krb5_h + ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs, +- ['/usr/local/ssl/lib', +- '/usr/contrib/ssl/lib/' ++ [sysroot+'/usr/local/ssl/lib', ++ sysroot+'/usr/contrib/ssl/lib/' + ] ) + + if (ssl_incs is not None and +@@ -753,6 +764,7 @@ + return False + return True + ++ + def gen_db_minor_ver_nums(major): + if major == 4: + for x in range(max_db_ver[1]+1): +@@ -768,21 +780,21 @@ + # construct a list of paths to look for the header file in on + # top of the normal inc_dirs. + db_inc_paths = [ +- '/usr/include/db4', ++ sysroot+'/usr/include/db4', + ] + # 4.x minor number specific paths + for x in gen_db_minor_ver_nums(4): +- db_inc_paths.append('/usr/include/db4%d' % x) +- db_inc_paths.append('/usr/include/db4.%d' % x) +- db_inc_paths.append('/usr/local/BerkeleyDB.4.%d/include' % x) +- db_inc_paths.append('/usr/local/include/db4%d' % x) +- db_inc_paths.append('/pkg/db-4.%d/include' % x) +- db_inc_paths.append('/opt/db-4.%d/include' % x) ++ db_inc_paths.append(sysroot+'/usr/include/db4%d' % x) ++ db_inc_paths.append(sysroot+'/usr/include/db4.%d' % x) ++ db_inc_paths.append(sysroot+'/usr/local/BerkeleyDB.4.%d/include' % x) ++ db_inc_paths.append(sysroot+'/usr/local/include/db4%d' % x) ++ db_inc_paths.append(sysroot+'/pkg/db-4.%d/include' % x) ++ db_inc_paths.append(sysroot+'/opt/db-4.%d/include' % x) + # MacPorts default (http://www.macports.org/) + db_inc_paths.append('/opt/local/include/db4%d' % x) + # 3.x minor number specific paths + for x in gen_db_minor_ver_nums(3): +- db_inc_paths.append('/usr/include/db3%d' % x) ++ db_inc_paths.append('sysroot+/usr/include/db3%d' % x) + + # Add some common subdirectories for Sleepycat DB to the list, + # based on the standard include directories. This way DB3/4 gets +@@ -904,12 +916,12 @@ + # 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', +- '/usr/include/sqlite', +- '/usr/include/sqlite3', +- '/usr/local/include', +- '/usr/local/include/sqlite', +- '/usr/local/include/sqlite3', ++ sqlite_inc_paths = [ sysroot+'/usr/include', ++ sysroot+'/usr/include/sqlite', ++ sysroot+'/usr/include/sqlite3', ++ sysroot+'/usr/local/include', ++ sysroot+'/usr/local/include/sqlite', ++ sysroot+'/usr/local/include/sqlite3', + ] + MIN_SQLITE_VERSION_NUMBER = (3, 0, 8) + MIN_SQLITE_VERSION = ".".join([str(x) +@@ -1004,7 +1016,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 = 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) +@@ -1207,7 +1219,7 @@ + # More information on Expat can be found at www.libexpat.org. + # + # Use system expat +- expatinc = '/usr/include' ++ expatinc = sysroot+'/usr/include' + define_macros = [] + + exts.append(Extension('pyexpat', +@@ -1493,7 +1505,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(sysroot+'/usr/X11R6/include') + frameworks = ['-framework', 'Tcl', '-framework', 'Tk'] + + # All existing framework builds of Tcl/Tk don't support 64-bit +@@ -1528,6 +1540,11 @@ + def detect_tkinter(self, inc_dirs, lib_dirs): + # The _tkinter module. + ++ # We must respect the user specified sysroot! ++ sysroot=os.getenv('SYSROOT') ++ if sysroot is None: ++ sysroot='' ++ + # Rather than complicate the code below, detecting and building + # AquaTk is a separate method. Only one Tkinter will be built on + # Darwin - either AquaTk, if it is found, or X11 based Tk. +@@ -1582,17 +1599,17 @@ + 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') ++ elif os.path.exists(sysroot+'/usr/X11R6/include'): ++ include_dirs.append(sysroot+'/usr/X11R6/include') ++ added_lib_dirs.append(sysroot+'/usr/X11R6/lib64') ++ added_lib_dirs.append(sysroot+'/usr/X11R6/lib') ++ elif os.path.exists(sysroot+'/usr/X11R5/include'): ++ include_dirs.append(sysroot+'/usr/X11R5/include') ++ added_lib_dirs.append(sysroot+'/usr/X11R5/lib') + else: + # Assume default location for X11 +- include_dirs.append('/usr/X11/include') +- added_lib_dirs.append('/usr/X11/lib') ++ include_dirs.append(sysroot+'/usr/X11/include') ++ added_lib_dirs.append(sysroot+'/usr/X11/lib') + + # If Cygwin, then verify that X is installed before proceeding + if platform == 'cygwin': diff --git a/dev-lang/python/files/python-2.6-enable-ctypes-cross-build.patch b/dev-lang/python/files/python-2.6-enable-ctypes-cross-build.patch new file mode 100644 index 0000000..bdb4aac --- /dev/null +++ b/dev-lang/python/files/python-2.6-enable-ctypes-cross-build.patch @@ -0,0 +1,28 @@ +# CTypes need to know the actual host we are building on. +# Signed-Off: Michael Dietrich <mdt@emdete.de> + +Index: Python-2.6.1/setup.py +=================================================================== +--- Python-2.6.1.orig/setup.py ++++ Python-2.6.1/setup.py +@@ -1656,16 +1656,16 @@ class PyBuildExt(build_ext): + ffi_configfile): + from distutils.dir_util import mkpath + mkpath(ffi_builddir) +- config_args = [] ++ config_args = ['--host=%s' % os.environ["CHOST"], ] + + # Pass empty CFLAGS because we'll just append the resulting + # CFLAGS to Python's; -g or -O2 is to be avoided. +- cmd = "cd %s && env CFLAGS='' '%s/configure' %s" \ +- % (ffi_builddir, ffi_srcdir, " ".join(config_args)) ++ cmd = "(cd %s && aclocal && autoconf -W cross) && (cd %s && env CFLAGS='' '%s/configure' %s)" \ ++ % (ffi_srcdir, ffi_builddir, ffi_srcdir, " ".join(config_args)) + + res = os.system(cmd) + if res or not os.path.exists(ffi_configfile): +- print "Failed to configure _ctypes module" ++ print "Failed to configure _ctypes module (res=%d) or missing conffile=%s" % ( res, ffi_configfile ) + return False + + fficonfig = {} diff --git a/dev-lang/python/files/python-2.6-test-cross.patch b/dev-lang/python/files/python-2.6-test-cross.patch new file mode 100644 index 0000000..0ff4193 --- /dev/null +++ b/dev-lang/python/files/python-2.6-test-cross.patch @@ -0,0 +1,19 @@ +--- Lib/test/test_multibytecodec.py.orig 2008-04-19 18:48:59.000000000 +0300 ++++ Lib/test/test_multibytecodec.py 2008-04-19 18:49:44.000000000 +0300 +@@ -212,11 +212,11 @@ + uni = u':hu4:unit\xe9 de famille' + self.assertEqual(iso2022jp2.decode('iso2022-jp-2'), uni) + +- def test_iso2022_jp_g0(self): +- self.failIf('\x0e' in u'\N{SOFT HYPHEN}'.encode('iso-2022-jp-2')) +- for encoding in ('iso-2022-jp-2004', 'iso-2022-jp-3'): +- e = u'\u3406'.encode(encoding) +- self.failIf(filter(lambda x: x >= '\x80', e)) ++ #def test_iso2022_jp_g0(self): ++ # self.failIf('\x0e' in u'\N{SOFT HYPHEN}'.encode('iso-2022-jp-2')) ++ # for encoding in ('iso-2022-jp-2004', 'iso-2022-jp-3'): ++ # e = u'\u3406'.encode(encoding) ++ # self.failIf(filter(lambda x: x >= '\x80', e)) + + def test_bug1572832(self): + if sys.maxunicode >= 0x10000: diff --git a/dev-lang/python/files/python-2.6_turkish.patch b/dev-lang/python/files/python-2.6_turkish.patch new file mode 100644 index 0000000..479c3c3 --- /dev/null +++ b/dev-lang/python/files/python-2.6_turkish.patch @@ -0,0 +1,130 @@ +diff -uNr Python-2.6.1.orig/Lib/decimal.py Python-2.6.1/Lib/decimal.py +--- Python-2.6.1.orig/Lib/decimal.py 2008-12-13 14:30:59.000000000 -0430 ++++ Python-2.6.1/Lib/decimal.py 2008-12-13 14:32:59.000000000 -0430 +@@ -152,6 +152,13 @@ + ROUND_HALF_DOWN = 'ROUND_HALF_DOWN' + ROUND_05UP = 'ROUND_05UP' + ++import string ++ ++def ascii_upper(s): ++ trans_table = string.maketrans(string.ascii_lowercase, string.ascii_uppercase) ++ return s.translate(trans_table) ++ ++ + # Errors + + class DecimalException(ArithmeticError): +@@ -3563,7 +3570,7 @@ + if name.startswith('_round_')] + for name in rounding_functions: + # name is like _round_half_even, goes to the global ROUND_HALF_EVEN value. +- globalname = name[1:].upper() ++ globalname = ascii_upper(name[1:]) + val = globals()[globalname] + Decimal._pick_rounding_function[val] = name + +diff -uNr Python-2.6.1.orig/Lib/email/__init__.py Python-2.6.1/Lib/email/__init__.py +--- Python-2.6.1.orig/Lib/email/__init__.py 2008-12-13 14:30:59.000000000 -0430 ++++ Python-2.6.1/Lib/email/__init__.py 2008-12-13 14:34:13.000000000 -0430 +@@ -109,15 +109,19 @@ + 'Text', + ] + ++import string ++lower_map = string.maketrans(string.ascii_uppercase, string.ascii_lowercase) ++ ++ + for _name in _LOWERNAMES: +- importer = LazyImporter(_name.lower()) ++ importer = LazyImporter(_name.translate(lower_map)) + sys.modules['email.' + _name] = importer + setattr(sys.modules['email'], _name, importer) + + + import email.mime + for _name in _MIMENAMES: +- importer = LazyImporter('mime.' + _name.lower()) ++ importer = LazyImporter('mime.' + _name.translate(lower_map)) + sys.modules['email.MIME' + _name] = importer + setattr(sys.modules['email'], 'MIME' + _name, importer) + setattr(sys.modules['email.mime'], _name, importer) +diff -uNr Python-2.6.1.orig/Lib/locale.py Python-2.6.1/Lib/locale.py +--- Python-2.6.1.orig/Lib/locale.py 2008-12-13 14:30:59.000000000 -0430 ++++ Python-2.6.1/Lib/locale.py 2008-12-13 14:57:18.000000000 -0430 +@@ -294,6 +294,14 @@ + # overridden below) + _setlocale = setlocale + ++# Avoid relying on the locale-dependent .lower() method ++# (see bug #1813). ++_ascii_lower_map = ''.join( ++ chr(x + 32 if x >= ord('A') and x <= ord('Z') else x) ++ for x in range(256) ++) ++ ++ + def normalize(localename): + + """ Returns a normalized locale code for the given locale +@@ -311,7 +319,7 @@ + + """ + # Normalize the locale name and extract the encoding +- fullname = localename.lower() ++ fullname = localename.encode('ascii').translate(_ascii_lower_map) + if ':' in fullname: + # ':' is sometimes used as encoding delimiter. + fullname = fullname.replace(':', '.') +diff -uNr Python-2.6.1.orig/Lib/test/test_codecs.py Python-2.6.1/Lib/test/test_codecs.py +--- Python-2.6.1.orig/Lib/test/test_codecs.py 2008-12-13 14:30:59.000000000 -0430 ++++ Python-2.6.1/Lib/test/test_codecs.py 2008-12-13 14:58:33.000000000 -0430 +@@ -1,5 +1,6 @@ + from test import test_support + import unittest ++import locale + import codecs + import sys, StringIO, _testcapi + +@@ -1078,6 +1079,16 @@ + self.assertRaises(LookupError, codecs.lookup, "__spam__") + self.assertRaises(LookupError, codecs.lookup, " ") + ++ def test_lookup_with_locale(self): ++ # Bug #1813: when normalizing codec name, lowercasing must be locale ++ # agnostic, otherwise the looked up codec name might end up wrong. ++ try: ++ locale.setlocale(locale.LC_CTYPE, 'tr') ++ except locale.Error: ++ # SKIPped test ++ return ++ codecs.lookup('ISO8859_1') ++ + def test_getencoder(self): + self.assertRaises(TypeError, codecs.getencoder) + self.assertRaises(LookupError, codecs.getencoder, "__spam__") +diff -uNr Python-2.6.1.orig/Python/codecs.c Python-2.6.1/Python/codecs.c +--- Python-2.6.1.orig/Python/codecs.c 2008-12-13 14:31:00.000000000 -0430 ++++ Python-2.6.1/Python/codecs.c 2008-12-13 14:59:43.000000000 -0430 +@@ -45,6 +45,12 @@ + return -1; + } + ++/* isupper() forced into the ASCII Locale */ ++#define ascii_isupper(x) (((x) >= 0x41) && ((x) <= 0x5A)) ++/* tolower() forced into the ASCII Locale */ ++#define ascii_tolower(x) (ascii_isupper(x) ? ((x) + 0x20) : (x)) ++ ++ + /* Convert a string to a normalized Python string: all characters are + converted to lower case, spaces are replaced with underscores. */ + +@@ -70,7 +76,7 @@ + if (ch == ' ') + ch = '-'; + else +- ch = tolower(Py_CHARMASK(ch)); ++ ch = ascii_tolower(Py_CHARMASK(ch)); + p[i] = ch; + } + return v; diff --git a/dev-lang/python/python-2.6.2.ebuild b/dev-lang/python/python-2.6.2.ebuild new file mode 100644 index 0000000..587948b --- /dev/null +++ b/dev-lang/python/python-2.6.2.ebuild @@ -0,0 +1,280 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.6.2.ebuild,v 1.1 2009/04/18 19:57:15 arfrever Exp $ + +# NOTE about python-portage interactions : +# - Do not add a pkg_setup() check for a certain version of portage +# in dev-lang/python. It _WILL_ stop people installing from +# Gentoo 1.4 images. + +EAPI=2 + +inherit eutils autotools flag-o-matic python versionator toolchain-funcs libtool + +# we need this so that we don't depends on python.eclass +PYVER_MAJOR=$(get_major_version) +PYVER_MINOR=$(get_version_component_range 2) +PYVER="${PYVER_MAJOR}.${PYVER_MINOR}" + +MY_P="Python-${PV}" +S="${WORKDIR}/${MY_P}" + +DESCRIPTION="Python is an interpreted, interactive, object-oriented programming language." +HOMEPAGE="http://www.python.org/" +SRC_URI="http://www.python.org/ftp/python/${PV}/${MY_P}.tar.bz2 + mirror://gentoo/python-gentoo-patches-2.6.2.tar.bz2" + +LICENSE="PSF-2.2" +SLOT="2.6" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd" +IUSE="berkdb build doc elibc_uclibc examples gdbm ipv6 ncurses readline sqlite ssl +threads tk ucs2 wininst +xml" + +# NOTE: dev-python/{elementtree,celementtree,pysqlite,ctypes,cjkcodecs} +# do not conflict with the ones in python proper. - liquidx + +DEPEND=">=app-admin/eselect-python-20080925 + >=sys-libs/zlib-1.1.3 + !build? ( + sqlite? ( >=dev-db/sqlite-3 ) + tk? ( >=dev-lang/tk-8.0 ) + ncurses? ( >=sys-libs/ncurses-5.2 + readline? ( >=sys-libs/readline-4.1 ) ) + berkdb? ( >=sys-libs/db-3.1 ) + gdbm? ( sys-libs/gdbm ) + ssl? ( dev-libs/openssl ) + doc? ( dev-python/python-docs:2.6 ) + xml? ( dev-libs/expat ) + )" +RDEPEND="${DEPEND}" + +# NOTE: changed RDEPEND to PDEPEND to resolve bug 88777. - kloeri +# NOTE: added blocker to enforce correct merge order for bug 88777. - zmedico + +PDEPEND="${DEPEND} app-admin/python-updater" +PROVIDE="virtual/python" + +src_prepare() { + default + + if tc-is-cross-compiler ; then + epatch "${FILESDIR}"/python-2.5-cross-printf.patch + epatch "${FILESDIR}"/python-2.6-chflags-cross.patch + epatch "${FILESDIR}"/python-2.6-test-cross.patch + else + rm "${WORKDIR}/${PV}"/*_all_crosscompile.patch + fi + + EPATCH_SUFFIX="patch" epatch "${WORKDIR}/${PV}" + + if tc-is-cross-compiler ; then + epatch "${FILESDIR}"/python-2.6-enable-ctypes-cross-build.patch + epatch "${FILESDIR}"/python-2.6-cross-setup-sysroot.patch + epatch "${FILESDIR}"/python-2.5.2-cross-distutils-build_ext.patch + epatch "${FILESDIR}"/python-2.6-cross-distutils-sysconfig.patch + epatch "${FILESDIR}"/python-2.5.2-cross-distutils-install.patch + epatch "${FILESDIR}"/python-2.5.2-cross-Makefile.pre.in.patch + fi + + sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \ + Lib/distutils/command/install.py \ + Lib/distutils/sysconfig.py \ + Lib/site.py \ + Makefile.pre.in \ + Modules/Setup.dist \ + Modules/getpath.c \ + setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@" + + # fix os.utime() on hppa. utimes it not supported but unfortunately reported as working - gmsoft (22 May 04) + # PLEASE LEAVE THIS FIX FOR NEXT VERSIONS AS IT'S A CRITICAL FIX !!! + [ "${ARCH}" = "hppa" ] && sed -e 's/utimes //' -i "${S}"/configure + + if ! use wininst; then + # remove microsoft windows executables + rm Lib/distutils/command/wininst-*.exe + fi + + eautoreconf +} + +src_configure() { + # disable extraneous modules with extra dependencies + if use build; then + export PYTHON_DISABLE_MODULES="readline pyexpat dbm gdbm bsddb _curses _curses_panel _tkinter _sqlite3" + export PYTHON_DISABLE_SSL=1 + else + # dbm module can link to berkdb or gdbm + # defaults to gdbm when both are enabled, #204343 + local disable + use berkdb || use gdbm || disable="${disable} dbm" + use berkdb || disable="${disable} bsddb" + use xml || disable="${disable} pyexpat" + use gdbm || disable="${disable} gdbm" + use ncurses || disable="${disable} _curses _curses_panel" + use readline || disable="${disable} readline" + use sqlite || disable="${disable} _sqlite3" + use ssl || export PYTHON_DISABLE_SSL=1 + use tk || disable="${disable} _tkinter" + export PYTHON_DISABLE_MODULES="${disable}" + fi + + if use !xml; then + ewarn "You have configured Python without XML support." + ewarn "This is NOT a recommended configuration as you" + ewarn "may face problems parsing any XML documents." + fi + + einfo "Disabled modules: $PYTHON_DISABLE_MODULES" + + export OPT="${CFLAGS}" + + local myconf + + # super-secret switch. don't use this unless you know what you're + # doing. enabling UCS2 support will break your existing python + # modules + use ucs2 \ + && myconf="${myconf} --enable-unicode=ucs2" \ + || myconf="${myconf} --enable-unicode=ucs4" + + filter-flags -malign-double + + # Seems to no longer be necessary + #[ "${ARCH}" = "amd64" ] && append-flags -fPIC + [ "${ARCH}" = "alpha" ] && append-flags -fPIC + + # http://bugs.gentoo.org/show_bug.cgi?id=50309 + if is-flag -O3; then + is-flag -fstack-protector-all && replace-flags -O3 -O2 + use hardened && replace-flags -O3 -O2 + fi + + if tc-is-cross-compiler ; then + OPT="-O1" CFLAGS="" LDFLAGS="" CC="" \ + ./configure --{build,host}=${CBUILD} || die "cross-configure failed" + emake python Parser/pgen || die "cross-make failed" + mv python hostpython + mv Parser/pgen Parser/hostpgen + make distclean + # Ugly fix, hostpython require few modules to pass test_unicode.py test + cp /usr/lib/python2.6/lib-dynload/unicodedata.so Modules/. + cp /usr/lib/python2.6/lib-dynload/time.so Modules/. + cp /usr/lib/python2.6/lib-dynload/math.so Modules/. + sed -i \ + -e '/^HOSTPYTHON/s:=.*:=./hostpython:' \ + -e '/^HOSTPGEN/s:=.*:=./Parser/hostpgen:' \ + Makefile.pre.in || die "sed failed" + fi + + # export CXX so it ends up in /usr/lib/python2.x/config/Makefile + tc-export CXX + + # set LDFLAGS so we link modules with -lpython2.6 correctly. + # Needed on FreeBSD unless python2.6 is already installed. + # Please query BSD team before removing this! + append-ldflags "-L." + + econf \ + --with-fpectl \ + --enable-shared \ + $(use_enable ipv6) \ + $(use_with threads) \ + --infodir='${prefix}'/share/info \ + --mandir='${prefix}'/share/man \ + --with-libc='' \ + ${myconf} +} + +src_install() { + dodir /usr + emake DESTDIR="${D}" altinstall maninstall || die + + mv "${D}"/usr/bin/python${PYVER}-config "${D}"/usr/bin/python-config-${PYVER} + + # Fix slotted collisions + mv "${D}"/usr/bin/2to3 "${D}"/usr/bin/2to3-${PYVER} + mv "${D}"/usr/bin/pydoc "${D}"/usr/bin/pydoc${PYVER} + mv "${D}"/usr/bin/idle "${D}"/usr/bin/idle${PYVER} + mv "${D}"/usr/share/man/man1/python.1 \ + "${D}"/usr/share/man/man1/python${PYVER}.1 + rm -f "${D}"/usr/bin/smtpd.py + + # Fix the OPT variable so that it doesn't have any flags listed in it. + # Prevents the problem with compiling things with conflicting flags later. + dosed -e 's:^OPT=.*:OPT=-DNDEBUG:' \ + /usr/$(get_libdir)/python${PYVER}/config/Makefile + + if use build ; then + rm -rf "${D}"/usr/$(get_libdir)/python${PYVER}/{test,encodings,email,lib-tk,bsddb/test} + else + use elibc_uclibc && rm -rf "${D}"/usr/$(get_libdir)/python${PYVER}/{test,bsddb/test} + use berkdb || rm -rf "${D}"/usr/$(get_libdir)/python${PYVER}/bsddb + use tk || rm -rf "${D}"/usr/$(get_libdir)/python${PYVER}/lib-tk + fi + + prep_ml_includes usr/include/python${PYVER} + + if use examples ; then + insinto /usr/share/doc/${PF}/examples + doins -r "${S}"/Tools || die "doins failed" + fi + + newinitd "${FILESDIR}/pydoc.init" pydoc-${SLOT} + newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT} + + # Installs empty directory. + rmdir "${D}"/usr/$(get_libdir)/${PN}${PYVER}/lib-old +} + +pkg_postrm() { + eselect python update --ignore 3.0 + python_mod_cleanup /usr/$(get_libdir)/python${PYVER} +} + +pkg_postinst() { + eselect python update --ignore 3.0 + python_version + + python_mod_optimize -x "(site-packages|test)" \ + /usr/$(get_libdir)/python${PYVER} +} + +src_test() { + # Tests won't work when cross compiling + if tc-is-cross-compiler ; then + elog "Disabling tests due to crosscompiling." + return + fi + + # Byte compiling should be enabled here. + # Otherwise test_import fails. + python_enable_pyc + + #skip all tests that fail during emerge but pass without emerge: + #(See bug# 67970) + local skip_tests="distutils global httpservers mimetools minidom mmap posix pyexpat sax strptime subprocess syntax tcl time urllib urllib2 xml_etree" + + # test_pow fails on alpha. + # http://bugs.python.org/issue756093 + [[ ${ARCH} == "alpha" ]] && skip_tests="${skip_tests} pow" + + for test in ${skip_tests} ; do + mv "${S}"/Lib/test/test_${test}.py "${T}" + done + + # Redirect stdin from /dev/tty as a workaround for bug #248081. + # rerun failed tests in verbose mode (regrtest -w) + EXTRATESTOPTS="-w" make test < /dev/tty || die "make test failed" + + for test in ${skip_tests} ; do + mv "${T}"/test_${test}.py "${S}"/Lib/test/test_${test}.py + done + + elog "Portage skipped the following tests which aren't able to run from emerge:" + for test in ${skip_tests} ; do + elog "test_${test}.py" + done + + elog "If you'd like to run them, you may:" + elog "cd /usr/lib/python${PYVER}/test" + elog "and run the tests separately." +} |