diff options
author | Timo Teräs <timo.teras@iki.fi> | 2016-11-03 16:06:18 +0200 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2016-11-03 16:08:03 +0200 |
commit | bfdd02d7614b73bcc04f7298ffde0d09d0ad9fbc (patch) | |
tree | d6ab7012fee1ee1c784e4a0839832e3b27eac822 /main/python2 | |
parent | 5d1f3cfaebff360d742758716c52c42416785e46 (diff) | |
download | aports-bfdd02d7614b73bcc04f7298ffde0d09d0ad9fbc.tar.bz2 aports-bfdd02d7614b73bcc04f7298ffde0d09d0ad9fbc.tar.xz |
main/python2: improve find_library
ref #5219
Diffstat (limited to 'main/python2')
-rw-r--r-- | main/python2/APKBUILD | 8 | ||||
-rw-r--r-- | main/python2/musl-find_library.patch | 34 |
2 files changed, 22 insertions, 20 deletions
diff --git a/main/python2/APKBUILD b/main/python2/APKBUILD index cfa17b1d89..f8d76e13b8 100644 --- a/main/python2/APKBUILD +++ b/main/python2/APKBUILD @@ -4,7 +4,7 @@ pkgname=python2 # the python2-tkinter's pkgver needs to be synchronized with this. pkgver=2.7.12 _verbase=${pkgver%.*} -pkgrel=6 +pkgrel=7 pkgdesc="A high-level scripting language" url="http://www.python.org" arch="all" @@ -101,11 +101,11 @@ gdbm() { } md5sums="57dffcee9cee8bb2ab5f82af1d8e9a69 Python-2.7.12.tar.xz -e2ea88671f8f838142323aedc417be48 musl-find_library.patch +2840477c6552a0ca2f4ede885ad872f1 musl-find_library.patch dada786a50fa332686a9b9260d84c110 unchecked-ioctl.patch" sha256sums="d7837121dd5652a05fef807c361909d255d173280c4e1a4ded94d73d80a1f978 Python-2.7.12.tar.xz -5a2ec65881816a80de25530a274aa3998684e02d82cff6565c08405df11983c0 musl-find_library.patch +83fd071bc556d4e88373a35fde74cb9c464ee4b8e95e5583b55f2e36d4f33cf2 musl-find_library.patch f9d37609bab83d9ffff96ec9a33e16568cfb14980d389f7fe34a1c837397e359 unchecked-ioctl.patch" sha512sums="6ddbbce47cc49597433d98ca05c2f62f07ed1070807b645602a8e9e9b996adc6fa66fa20a33cd7d23d4e7e925e25071d7301d288149fbe4e8c5f06d5438dda1f Python-2.7.12.tar.xz -dbc1538d519997175ca24c8fcb94aa20924a9be3065a44fd7693ea7eb3642f681ea0b337b72074e17baf19966b7ee6dbac1081d40e2fdc11e30b6b8a6eeb577e musl-find_library.patch +ab8eaa2858d5109049b1f9f553198d40e0ef8d78211ad6455f7b491af525bffb16738fed60fc84e960c4889568d25753b9e4a1494834fea48291b33f07000ec2 musl-find_library.patch 5a8e013a4132d71c4360771f130d27b37275ae59330cf9a75378dc8a11236017f540eb224f2a148984e82ca3fb6b29129375b1080ba05b81044faa717520ab82 unchecked-ioctl.patch" diff --git a/main/python2/musl-find_library.patch b/main/python2/musl-find_library.patch index 2d8d19719c..7899abb736 100644 --- a/main/python2/musl-find_library.patch +++ b/main/python2/musl-find_library.patch @@ -1,11 +1,13 @@ -diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py -index 1e882e3..b265cc0 100644 ---- a/Lib/ctypes/util.py -+++ b/Lib/ctypes/util.py -@@ -238,8 +238,37 @@ elif os.name == "posix": - return None - return res.group(1) +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)) ++ elif True: ++ ++ # Patched for Alpine Linux / musl - search manually system paths + def _is_elf(filepath): + try: + with open(filepath, 'rb') as fh: @@ -13,15 +15,18 @@ index 1e882e3..b265cc0 100644 + 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: @@ -30,14 +35,11 @@ index 1e882e3..b265cc0 100644 + return os.path.basename(f) + + prefix = os.path.join(d, 'lib'+name) -+ for suffix in ['.so', '.so.*', '.*.so.*']: ++ for suffix in ['.so', '.so.*']: + for f in glob('{0}{1}'.format(prefix, suffix)): + if _is_elf(f): + return os.path.basename(f) + - def find_library(name): -- return _findSoname_ldconfig(name) or _get_soname(_findLib_gcc(name)) -+ return _find_libfile(name) or _findSoname_ldconfig(name) or _get_soname(_findLib_gcc(name)) + else: - ################################################################ - # test code + def _findSoname_ldconfig(name): |