diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2018-06-18 20:56:28 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2018-06-18 20:56:28 -0500 |
commit | d26fe1f99c7145a54d991bcb5056c198bc38c60b (patch) | |
tree | 7a0255ba81b7435289abda5e512315436dfa22ea /system/python3/musl-find_library.patch | |
parent | c8d304bdbb1677538487b1fae9d365c515afe58d (diff) | |
download | packages-d26fe1f99c7145a54d991bcb5056c198bc38c60b.tar.gz packages-d26fe1f99c7145a54d991bcb5056c198bc38c60b.tar.bz2 packages-d26fe1f99c7145a54d991bcb5056c198bc38c60b.tar.xz packages-d26fe1f99c7145a54d991bcb5056c198bc38c60b.zip |
system/python3: [PD] fix maintainer, bump, finally fix pip
Diffstat (limited to 'system/python3/musl-find_library.patch')
-rw-r--r-- | system/python3/musl-find_library.patch | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/system/python3/musl-find_library.patch b/system/python3/musl-find_library.patch new file mode 100644 index 000000000..7899abb73 --- /dev/null +++ b/system/python3/musl-find_library.patch @@ -0,0 +1,45 @@ +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: ++ return fh.read(4) == b'\x7fELF' ++ except: ++ return False ++ ++ 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 (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: ++ f = os.path.join(d, name) ++ if _is_elf(f): ++ return os.path.basename(f) ++ ++ prefix = os.path.join(d, 'lib'+name) ++ for suffix in ['.so', '.so.*']: ++ for f in glob('{0}{1}'.format(prefix, suffix)): ++ if _is_elf(f): ++ return os.path.basename(f) ++ + else: + + def _findSoname_ldconfig(name): |