patch-setup_py 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. diff -Nur Python-2.7.orig/setup.py Python-2.7/setup.py
  2. --- Python-2.7.1.orig/setup.py 2010-10-31 17:40:21.000000000 +0100
  3. +++ Python-2.7.1/setup.py 2010-12-27 21:06:29.000000000 +0100
  4. @@ -21,7 +21,7 @@ from distutils.spawn import find_executa
  5. COMPILED_WITH_PYDEBUG = hasattr(sys, 'gettotalrefcount')
  6. # This global variable is used to hold the list of modules to be disabled.
  7. -disabled_module_list = []
  8. +disabled_module_list = ['nis', 'bz2']
  9. def add_dir_to_list(dirlist, dir):
  10. """Add the directory 'dir' to the list 'dirlist' (at the front) if
  11. @@ -307,48 +307,14 @@ class PyBuildExt(build_ext):
  12. ext_filename = os.path.join(
  13. self.build_lib,
  14. self.get_ext_filename(self.get_ext_fullname(ext.name)))
  15. - try:
  16. - imp.load_dynamic(ext.name, ext_filename)
  17. - except ImportError, why:
  18. - self.failed.append(ext.name)
  19. - self.announce('*** WARNING: renaming "%s" since importing it'
  20. - ' failed: %s' % (ext.name, why), level=3)
  21. - assert not self.inplace
  22. - basename, tail = os.path.splitext(ext_filename)
  23. - newname = basename + "_failed" + tail
  24. - if os.path.exists(newname):
  25. - os.remove(newname)
  26. - os.rename(ext_filename, newname)
  27. -
  28. - # XXX -- This relies on a Vile HACK in
  29. - # distutils.command.build_ext.build_extension(). The
  30. - # _built_objects attribute is stored there strictly for
  31. - # use here.
  32. - # If there is a failure, _built_objects may not be there,
  33. - # so catch the AttributeError and move on.
  34. - try:
  35. - for filename in self._built_objects:
  36. - os.remove(filename)
  37. - except AttributeError:
  38. - self.announce('unable to remove files (ignored)')
  39. - except:
  40. - exc_type, why, tb = sys.exc_info()
  41. - self.announce('*** WARNING: importing extension "%s" '
  42. - 'failed with %s: %s' % (ext.name, exc_type, why),
  43. - level=3)
  44. - self.failed.append(ext.name)
  45. def get_platform(self):
  46. - # Get value of sys.platform
  47. - for platform in ['cygwin', 'beos', 'darwin', 'atheos', 'osf1']:
  48. - if sys.platform.startswith(platform):
  49. - return platform
  50. - return sys.platform
  51. + return 'linux'
  52. def detect_modules(self):
  53. # Ensure that /usr/local is always used
  54. - add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
  55. - add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
  56. + #add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
  57. + #add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
  58. # Add paths specified in the environment variables LDFLAGS and
  59. # CPPFLAGS for header and library files.
  60. @@ -403,11 +369,8 @@ class PyBuildExt(build_ext):
  61. # lib_dirs and inc_dirs are used to search for files;
  62. # if a file is found in one of those directories, it can
  63. # be assumed that no additional -I,-L directives are needed.
  64. - lib_dirs = self.compiler.library_dirs + [
  65. - '/lib64', '/usr/lib64',
  66. - '/lib', '/usr/lib',
  67. - ]
  68. - inc_dirs = self.compiler.include_dirs + ['/usr/include']
  69. + lib_dirs = self.compiler.library_dirs
  70. + inc_dirs = self.compiler.include_dirs
  71. exts = []
  72. missing = []