mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-24 11:16:51 +00:00
Python3: ensure libs are found correctly (from Python2)
Without this patch, Python3:host will not find the zlib module, causing setuptools to fail due to missing zlib compression support.
This commit is contained in:
parent
bf94c8fb81
commit
2c4031e2b2
@ -83,6 +83,8 @@ PKG_CONFIGURE_OPTS_TARGET="ac_cv_prog_HAS_HG=/bin/false
|
||||
"
|
||||
|
||||
pre_configure_host() {
|
||||
export PYTHON_MODULES_INCLUDE="$HOST_INCDIR"
|
||||
export PYTHON_MODULES_LIB="$HOST_LIBDIR"
|
||||
export DISABLED_EXTENSIONS="readline _curses _curses_panel $PKG_PY_DISABLED_MODULES"
|
||||
}
|
||||
|
||||
@ -104,6 +106,8 @@ post_makeinstall_host() {
|
||||
}
|
||||
|
||||
pre_configure_target() {
|
||||
export PYTHON_MODULES_INCLUDE="$TARGET_INCDIR"
|
||||
export PYTHON_MODULES_LIB="$TARGET_LIBDIR"
|
||||
export DISABLED_EXTENSIONS="$PKG_PY_DISABLED_MODULES"
|
||||
}
|
||||
|
||||
|
64
packages/lang/Python3/patches/Python3-0202-xcompile.patch
Normal file
64
packages/lang/Python3/patches/Python3-0202-xcompile.patch
Normal file
@ -0,0 +1,64 @@
|
||||
From 3a68797fe5615ed12797597b28dd2cbf4dbcf2af Mon Sep 17 00:00:00 2001
|
||||
From: MilhouseVH <milhouseVH.github@nmacleod.com>
|
||||
Date: Thu, 17 Oct 2019 12:53:04 +0100
|
||||
Subject: [PATCH] 002-xcompile.patch
|
||||
|
||||
---
|
||||
setup.py | 33 ++++++++++++---------------------
|
||||
1 file changed, 12 insertions(+), 21 deletions(-)
|
||||
|
||||
diff --git a/setup.py b/setup.py
|
||||
index 8a1279d..8e2b536 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -593,16 +593,19 @@ class PyBuildExt(build_ext):
|
||||
os.unlink(tmpfile)
|
||||
|
||||
def detect_modules(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_gcc_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)
|
||||
|
||||
# Add paths specified in the environment variables LDFLAGS and
|
||||
# CPPFLAGS for header and library files.
|
||||
@@ -638,18 +641,6 @@ class PyBuildExt(build_ext):
|
||||
for directory in reversed(options.dirs):
|
||||
add_dir_to_list(dir_list, directory)
|
||||
|
||||
- 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;
|
||||
--
|
||||
2.7.4
|
||||
|
Loading…
x
Reference in New Issue
Block a user