PageRenderTime 36ms CodeModel.GetById 29ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 1ms

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