diff options
author | Timo Teräs <timo.teras@iki.fi> | 2016-11-03 16:10:00 +0200 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2016-11-03 16:10:00 +0200 |
commit | 377830503560754191095d9594541a8625af8448 (patch) | |
tree | 73f25e87b0b80b9b11ead78b6b96487f60ae49ca /main/python3/musl-find_library.patch | |
parent | bfdd02d7614b73bcc04f7298ffde0d09d0ad9fbc (diff) | |
download | aports-377830503560754191095d9594541a8625af8448.tar.bz2 aports-377830503560754191095d9594541a8625af8448.tar.xz |
main/python3: improve find_library
ref #5219
Diffstat (limited to 'main/python3/musl-find_library.patch')
-rw-r--r-- | main/python3/musl-find_library.patch | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/main/python3/musl-find_library.patch b/main/python3/musl-find_library.patch index dbaf0286e5..7899abb736 100644 --- a/main/python3/musl-find_library.patch +++ b/main/python3/musl-find_library.patch @@ -1,6 +1,6 @@ -diff -ru Python-3.5.2.orig/Lib/ctypes/util.py Python-3.5.2/Lib/ctypes/util.py ---- Python-3.5.2.orig/Lib/ctypes/util.py 2016-06-26 00:38:35.000000000 +0300 -+++ Python-3.5.2/Lib/ctypes/util.py 2016-11-03 08:21:50.046469019 +0200 +diff -ru Python-2.7.12.orig/Lib/ctypes/util.py Python-2.7.12/Lib/ctypes/util.py +--- Python-2.7.12.orig/Lib/ctypes/util.py 2016-06-26 00:49:30.000000000 +0300 ++++ Python-2.7.12/Lib/ctypes/util.py 2016-11-03 16:05:46.954665040 +0200 @@ -204,6 +204,41 @@ def find_library(name, is64 = False): return _get_soname(_findLib_crle(name, is64) or _findLib_gcc(name)) @@ -15,15 +15,18 @@ diff -ru Python-3.5.2.orig/Lib/ctypes/util.py Python-3.5.2/Lib/ctypes/util.py + except: + return False + -+ def _find_libfile(name): ++ def find_library(name): + from glob import glob ++ # absolute name? ++ if os.path.isabs(name): ++ return name + # special case for libm, libcrypt and libpthread and musl + if name in ['m', 'crypt', 'pthread']: + name = 'c' + elif name in ['libm.so', 'libcrypt.so', 'libpthread.so']: + name = 'libc.so' -+ # search in standard locations -+ paths = ['/lib', '/usr/lib', '/usr/local/lib'] ++ # search in standard locations (musl order) ++ paths = ['/lib', '/usr/local/lib', '/usr/lib'] + if 'LD_LIBRARY_PATH' in os.environ: + paths = os.environ['LD_LIBRARY_PATH'].split(':') + paths + for d in paths: @@ -37,9 +40,6 @@ diff -ru Python-3.5.2.orig/Lib/ctypes/util.py Python-3.5.2/Lib/ctypes/util.py + if _is_elf(f): + return os.path.basename(f) + -+ def find_library(name): -+ return _find_libfile(name) -+ else: def _findSoname_ldconfig(name): |