patch-setup_py 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. --- Python-3.1.1.orig/setup.py 2009-08-12 20:39:44.000000000 +0200
  2. +++ Python-3.1.1/setup.py 2009-09-28 19:12:33.550271196 +0200
  3. @@ -255,36 +255,6 @@ class PyBuildExt(build_ext):
  4. # cached. Clear that cache before trying to import.
  5. sys.path_importer_cache.clear()
  6. - try:
  7. - imp.load_dynamic(ext.name, ext_filename)
  8. - except ImportError as why:
  9. - self.failed.append(ext.name)
  10. - self.announce('*** WARNING: renaming "%s" since importing it'
  11. - ' failed: %s' % (ext.name, why), level=3)
  12. - assert not self.inplace
  13. - basename, tail = os.path.splitext(ext_filename)
  14. - newname = basename + "_failed" + tail
  15. - if os.path.exists(newname):
  16. - os.remove(newname)
  17. - os.rename(ext_filename, newname)
  18. -
  19. - # XXX -- This relies on a Vile HACK in
  20. - # distutils.command.build_ext.build_extension(). The
  21. - # _built_objects attribute is stored there strictly for
  22. - # use here.
  23. - # If there is a failure, _built_objects may not be there,
  24. - # so catch the AttributeError and move on.
  25. - try:
  26. - for filename in self._built_objects:
  27. - os.remove(filename)
  28. - except AttributeError:
  29. - self.announce('unable to remove files (ignored)')
  30. - except:
  31. - exc_type, why, tb = sys.exc_info()
  32. - self.announce('*** WARNING: importing extension "%s" '
  33. - 'failed with %s: %s' % (ext.name, exc_type, why),
  34. - level=3)
  35. - self.failed.append(ext.name)
  36. def get_platform(self):
  37. # Get value of sys.platform
  38. @@ -295,8 +265,8 @@ class PyBuildExt(build_ext):
  39. def detect_modules(self):
  40. # Ensure that /usr/local is always used
  41. - add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
  42. - add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
  43. + #add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
  44. + #add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
  45. # Add paths specified in the environment variables LDFLAGS and
  46. # CPPFLAGS for header and library files.
  47. @@ -332,20 +302,22 @@ class PyBuildExt(build_ext):
  48. for directory in reversed(options.dirs):
  49. add_dir_to_list(dir_list, directory)
  50. - if os.path.normpath(sys.prefix) != '/usr':
  51. - add_dir_to_list(self.compiler.library_dirs,
  52. - sysconfig.get_config_var("LIBDIR"))
  53. - add_dir_to_list(self.compiler.include_dirs,
  54. - sysconfig.get_config_var("INCLUDEDIR"))
  55. + #if os.path.normpath(sys.prefix) != '/usr':
  56. + # add_dir_to_list(self.compiler.library_dirs,
  57. + # sysconfig.get_config_var("LIBDIR"))
  58. + # add_dir_to_list(self.compiler.include_dirs,
  59. + # sysconfig.get_config_var("INCLUDEDIR"))
  60. # lib_dirs and inc_dirs are used to search for files;
  61. # if a file is found in one of those directories, it can
  62. # be assumed that no additional -I,-L directives are needed.
  63. - lib_dirs = self.compiler.library_dirs + [
  64. - '/lib64', '/usr/lib64',
  65. - '/lib', '/usr/lib',
  66. - ]
  67. - inc_dirs = self.compiler.include_dirs + ['/usr/include']
  68. + #lib_dirs = self.compiler.library_dirs + [
  69. + # '/lib64', '/usr/lib64',
  70. + # '/lib', '/usr/lib',
  71. + # ]
  72. + #inc_dirs = self.compiler.include_dirs + ['/usr/include']
  73. + inc_dirs = self.compiler.include_dirs
  74. + lib_dirs = self.compiler.library_dirs
  75. exts = []
  76. missing = []