/packages/lang/Python/patches/Python-2.7.2-002_xcompile_path-0.1.patch

http://github.com/OpenELEC/OpenELEC.tv · Patch · 59 lines · 55 code · 4 blank · 0 comment · 0 complexity · 5c495a7fa97292b44eb0bf7da0721ba8 MD5 · raw file

  1. diff -Naur Python-2.7.2/setup.py Python-2.7.2.patch/setup.py
  2. --- Python-2.7.2/setup.py 2011-10-25 14:07:59.520264628 +0200
  3. +++ Python-2.7.2.patch/setup.py 2011-10-25 14:16:32.218793079 +0200
  4. @@ -380,10 +380,19 @@
  5. os.unlink(tmpfile)
  6. def detect_modules(self):
  7. - # Ensure that /usr/local is always used
  8. - add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
  9. - add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
  10. - self.add_multiarch_paths()
  11. + try:
  12. + modules_include_dirs = os.environ["PYTHON_MODULES_INCLUDE"].split()
  13. + except KeyError:
  14. + modules_include_dirs = ['/usr/include']
  15. + try:
  16. + modules_lib_dirs = os.environ["PYTHON_MODULES_LIB"].split()
  17. + except KeyError:
  18. + modules_lib_dirs = ['/usr/lib']
  19. + self.add_multiarch_paths()
  20. + for dir in modules_include_dirs:
  21. + add_dir_to_list(self.compiler.include_dirs, dir)
  22. + for dir in modules_lib_dirs:
  23. + add_dir_to_list(self.compiler.library_dirs, dir)
  24. # Add paths specified in the environment variables LDFLAGS and
  25. # CPPFLAGS for header and library files.
  26. @@ -419,17 +428,6 @@
  27. for directory in reversed(options.dirs):
  28. add_dir_to_list(dir_list, directory)
  29. - if os.path.normpath(sys.prefix) != '/usr' \
  30. - and not sysconfig.get_config_var('PYTHONFRAMEWORK'):
  31. - # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework
  32. - # (PYTHONFRAMEWORK is set) to avoid # linking problems when
  33. - # building a framework with different architectures than
  34. - # the one that is currently installed (issue #7473)
  35. - add_dir_to_list(self.compiler.library_dirs,
  36. - sysconfig.get_config_var("LIBDIR"))
  37. - add_dir_to_list(self.compiler.include_dirs,
  38. - sysconfig.get_config_var("INCLUDEDIR"))
  39. -
  40. try:
  41. have_unicode = unicode
  42. except NameError:
  43. @@ -438,11 +436,8 @@
  44. # lib_dirs and inc_dirs are used to search for files;
  45. # if a file is found in one of those directories, it can
  46. # be assumed that no additional -I,-L directives are needed.
  47. - lib_dirs = self.compiler.library_dirs + [
  48. - '/lib64', '/usr/lib64',
  49. - '/lib', '/usr/lib',
  50. - ]
  51. - inc_dirs = self.compiler.include_dirs + ['/usr/include']
  52. + lib_dirs = self.compiler.library_dirs
  53. + inc_dirs = self.compiler.include_dirs
  54. exts = []
  55. missing = []