1
0
This repository has been archived on 2024-11-10. You can view files and clone it, but cannot push or open issues or pull requests.
Lakka-rk322x/packages/lang/Python3/patches/Python3-0202-xcompile.patch
Ian Leonard 373bbc0d12 Python3: update to 3.8.5
Signed-off-by: Ian Leonard <antonlacon@gmail.com>
2020-08-10 19:23:57 +00:00

49 lines
2.2 KiB
Diff

diff -aur a/setup.py b/setup.py
--- a/setup.py 2020-08-08 14:18:41.978514642 -0400
+++ b/setup.py 2020-08-08 14:26:09.612536681 -0400
@@ -656,31 +656,23 @@
add_dir_to_list(dir_list, directory)
def configure_compiler(self):
- # Ensure that /usr/local is always used, but the local build
- # directories (i.e. '.' and 'Include') must be first. See issue
- # 10520.
- if not CROSS_COMPILING:
- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
+ try:
+ modules_include_dirs = os.environ["PYTHON_MODULES_INCLUDE"].split()
+ except KeyError:
+ modules_include_dirs = ['/usr/include']
+ try:
+ modules_lib_dirs = os.environ["PYTHON_MODULES_LIB"].split()
+ except KeyError:
+ modules_lib_dirs = ['/usr/lib']
self.add_multiarch_paths()
- # only change this for cross builds for 3.3, issues on Mageia
- if CROSS_COMPILING:
- self.add_cross_compiling_paths()
+ for dir in modules_include_dirs:
+ add_dir_to_list(self.compiler.include_dirs, dir)
+ for dir in modules_lib_dirs:
+ add_dir_to_list(self.compiler.library_dirs, dir)
+
self.add_ldflags_cppflags()
def init_inc_lib_dirs(self):
- if (not CROSS_COMPILING and
- os.path.normpath(sys.base_prefix) != '/usr' and
- not sysconfig.get_config_var('PYTHONFRAMEWORK')):
- # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework
- # (PYTHONFRAMEWORK is set) to avoid # linking problems when
- # building a framework with different architectures than
- # the one that is currently installed (issue #7473)
- add_dir_to_list(self.compiler.library_dirs,
- sysconfig.get_config_var("LIBDIR"))
- add_dir_to_list(self.compiler.include_dirs,
- sysconfig.get_config_var("INCLUDEDIR"))
-
system_lib_dirs = ['/lib64', '/usr/lib64', '/lib', '/usr/lib']
system_include_dirs = ['/usr/include']
# lib_dirs and inc_dirs are used to search for files;