diff options
author | Waldemar Brodkorb <wbx@openadk.org> | 2009-09-28 19:46:42 +0200 |
---|---|---|
committer | Waldemar Brodkorb <wbx@openadk.org> | 2009-09-28 19:46:42 +0200 |
commit | f53612bc7414c0d9e4700f957d6a1a1742574c67 (patch) | |
tree | c4a5b3ffafbb2d7f7983f5f47cf62385f753ebc8 /package/python/patches/patch-setup_py | |
parent | b90cc7f1ad47a02d811f45b1b6fa0c5fc5bf0edf (diff) |
fix cross-compile at least from x86 to x86_64
Diffstat (limited to 'package/python/patches/patch-setup_py')
-rw-r--r-- | package/python/patches/patch-setup_py | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/package/python/patches/patch-setup_py b/package/python/patches/patch-setup_py new file mode 100644 index 000000000..c9f3dfe08 --- /dev/null +++ b/package/python/patches/patch-setup_py @@ -0,0 +1,83 @@ +--- Python-3.1.1.orig/setup.py 2009-08-12 20:39:44.000000000 +0200 ++++ Python-3.1.1/setup.py 2009-09-28 19:12:33.550271196 +0200 +@@ -255,36 +255,6 @@ class PyBuildExt(build_ext): + # cached. Clear that cache before trying to import. + sys.path_importer_cache.clear() + +- try: +- imp.load_dynamic(ext.name, ext_filename) +- except ImportError as why: +- self.failed.append(ext.name) +- self.announce('*** WARNING: renaming "%s" since importing it' +- ' failed: %s' % (ext.name, why), level=3) +- assert not self.inplace +- basename, tail = os.path.splitext(ext_filename) +- newname = basename + "_failed" + tail +- if os.path.exists(newname): +- os.remove(newname) +- os.rename(ext_filename, newname) +- +- # XXX -- This relies on a Vile HACK in +- # distutils.command.build_ext.build_extension(). The +- # _built_objects attribute is stored there strictly for +- # use here. +- # If there is a failure, _built_objects may not be there, +- # so catch the AttributeError and move on. +- try: +- for filename in self._built_objects: +- os.remove(filename) +- except AttributeError: +- self.announce('unable to remove files (ignored)') +- except: +- exc_type, why, tb = sys.exc_info() +- self.announce('*** WARNING: importing extension "%s" ' +- 'failed with %s: %s' % (ext.name, exc_type, why), +- level=3) +- self.failed.append(ext.name) + + def get_platform(self): + # Get value of sys.platform +@@ -295,8 +265,8 @@ class PyBuildExt(build_ext): + + def detect_modules(self): + # 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, '/usr/local/lib') ++ #add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') + + # Add paths specified in the environment variables LDFLAGS and + # CPPFLAGS for header and library files. +@@ -332,20 +302,22 @@ class PyBuildExt(build_ext): + for directory in reversed(options.dirs): + add_dir_to_list(dir_list, directory) + +- if os.path.normpath(sys.prefix) != '/usr': +- 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")) ++ #if os.path.normpath(sys.prefix) != '/usr': ++ # 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")) + + # 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 + [ ++ # '/lib64', '/usr/lib64', ++ # '/lib', '/usr/lib', ++ # ] ++ #inc_dirs = self.compiler.include_dirs + ['/usr/include'] ++ inc_dirs = self.compiler.include_dirs ++ lib_dirs = self.compiler.library_dirs + exts = [] + missing = [] + |