From 377830503560754191095d9594541a8625af8448 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Ter=C3=A4s?= Date: Thu, 3 Nov 2016 16:10:00 +0200 Subject: main/python3: improve find_library ref #5219 --- main/python3/APKBUILD | 8 ++++---- main/python3/musl-find_library.patch | 18 +++++++++--------- 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'main/python3') diff --git a/main/python3/APKBUILD b/main/python3/APKBUILD index cf98fabd93..5735e21978 100644 --- a/main/python3/APKBUILD +++ b/main/python3/APKBUILD @@ -4,7 +4,7 @@ pkgname=python3 pkgver=3.5.2 _basever="${pkgver%.*}" -pkgrel=5 +pkgrel=6 pkgdesc="A high-level scripting language" url="http://www.python.org" arch="all" @@ -92,8 +92,8 @@ tkinter() { } md5sums="8906efbacfcdc7c3c9198aeefafd159e Python-3.5.2.tar.xz -3810fc5ba451204525698ef80cce675e musl-find_library.patch" +2840477c6552a0ca2f4ede885ad872f1 musl-find_library.patch" sha256sums="0010f56100b9b74259ebcd5d4b295a32324b58b517403a10d1a2aa7cb22bca40 Python-3.5.2.tar.xz -611b8915611e6e04d17eb322d3feef6f14e7d97e2072bca0dfdc3bcb29ad7b38 musl-find_library.patch" +83fd071bc556d4e88373a35fde74cb9c464ee4b8e95e5583b55f2e36d4f33cf2 musl-find_library.patch" sha512sums="c07c3366f1c81e214241444bb9da6db9d11da32ad66bfa29cdad5a3b2e34e4d870bda6d4ce3c3910b582942e91f1d8c8a1c1a7b9464cc147b83c9e0007012742 Python-3.5.2.tar.xz -ff55054b563e154a84d408a5875dac8381decd2bdfb4bb3147bf313e1e9e36162cce0ce74d6e607348a8fe9e01f0b3fe4c8c60c2de81a2055f0f6518408de59b musl-find_library.patch" +ab8eaa2858d5109049b1f9f553198d40e0ef8d78211ad6455f7b491af525bffb16738fed60fc84e960c4889568d25753b9e4a1494834fea48291b33f07000ec2 musl-find_library.patch" 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: @@ -36,9 +39,6 @@ diff -ru Python-3.5.2.orig/Lib/ctypes/util.py Python-3.5.2/Lib/ctypes/util.py + for f in glob('{0}{1}'.format(prefix, suffix)): + if _is_elf(f): + return os.path.basename(f) -+ -+ def find_library(name): -+ return _find_libfile(name) + else: -- cgit v1.2.3