patch-setup_py 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. diff -Nur Python-3.2.2.orig/setup.py Python-3.2.2/setup.py
  2. --- Python-3.2.2.orig/setup.py 2011-09-03 18:16:50.000000000 +0200
  3. +++ Python-3.2.2/setup.py 2011-09-05 12:17:57.000000000 +0200
  4. @@ -332,36 +332,6 @@
  5. # cached. Clear that cache before trying to import.
  6. sys.path_importer_cache.clear()
  7. - try:
  8. - imp.load_dynamic(ext.name, ext_filename)
  9. - except ImportError as why:
  10. - self.failed.append(ext.name)
  11. - self.announce('*** WARNING: renaming "%s" since importing it'
  12. - ' failed: %s' % (ext.name, why), level=3)
  13. - assert not self.inplace
  14. - basename, tail = os.path.splitext(ext_filename)
  15. - newname = basename + "_failed" + tail
  16. - if os.path.exists(newname):
  17. - os.remove(newname)
  18. - os.rename(ext_filename, newname)
  19. -
  20. - # XXX -- This relies on a Vile HACK in
  21. - # distutils.command.build_ext.build_extension(). The
  22. - # _built_objects attribute is stored there strictly for
  23. - # use here.
  24. - # If there is a failure, _built_objects may not be there,
  25. - # so catch the AttributeError and move on.
  26. - try:
  27. - for filename in self._built_objects:
  28. - os.remove(filename)
  29. - except AttributeError:
  30. - self.announce('unable to remove files (ignored)')
  31. - except:
  32. - exc_type, why, tb = sys.exc_info()
  33. - self.announce('*** WARNING: importing extension "%s" '
  34. - 'failed with %s: %s' % (ext.name, exc_type, why),
  35. - level=3)
  36. - self.failed.append(ext.name)
  37. def get_platform(self):
  38. # Get value of sys.platform
  39. @@ -396,8 +366,8 @@
  40. # Ensure that /usr/local is always used, but the local build
  41. # directories (i.e. '.' and 'Include') must be first. See issue
  42. # 10520.
  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_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
  46. + #add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
  47. self.add_multiarch_paths()
  48. # Add paths specified in the environment variables LDFLAGS and
  49. @@ -434,25 +404,16 @@
  50. for directory in reversed(options.dirs):
  51. add_dir_to_list(dir_list, directory)
  52. - if os.path.normpath(sys.prefix) != '/usr' \
  53. - and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
  54. - # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework
  55. - # (PYTHONFRAMEWORK is set) to avoid # linking problems when
  56. - # building a framework with different architectures than
  57. - # the one that is currently installed (issue #7473)
  58. - add_dir_to_list(self.compiler.library_dirs,
  59. - sysconfig.get_config_var("LIBDIR"))
  60. - add_dir_to_list(self.compiler.include_dirs,
  61. - sysconfig.get_config_var("INCLUDEDIR"))
  62. -
  63. # lib_dirs and inc_dirs are used to search for files;
  64. # if a file is found in one of those directories, it can
  65. # be assumed that no additional -I,-L directives are needed.
  66. - lib_dirs = self.compiler.library_dirs + [
  67. - '/lib64', '/usr/lib64',
  68. - '/lib', '/usr/lib',
  69. - ]
  70. - inc_dirs = self.compiler.include_dirs + ['/usr/include']
  71. + lib_dirs = self.compiler.library_dirs
  72. + #+ [
  73. + # '/lib64', '/usr/lib64',
  74. + # '/lib', '/usr/lib',
  75. + # ]
  76. + inc_dirs = self.compiler.include_dirs
  77. + #+ ['/usr/include']
  78. exts = []
  79. missing = []