pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/lang/python37 python37: fix find_library() on SunOS



details:   https://anonhg.NetBSD.org/pkgsrc/rev/6fb0cc972554
branches:  trunk
changeset: 323037:6fb0cc972554
user:      wiedi <wiedi%pkgsrc.org@localhost>
date:      Thu May 02 12:50:42 2019 +0000

description:
python37: fix find_library() on SunOS

Help find_library find pkgsrc libs also on SunOS.
While here pull in http://bugs.python.org/issue23287 like Oracle Solaris and
OpenIndiana already do.

diffstat:

 lang/python37/Makefile                         |   3 +-
 lang/python37/distinfo                         |   4 +-
 lang/python37/patches/patch-Lib_ctypes_util.py |  55 ++++++++++++++++++++++++-
 3 files changed, 56 insertions(+), 6 deletions(-)

diffs (105 lines):

diff -r d00241a4e7ac -r 6fb0cc972554 lang/python37/Makefile
--- a/lang/python37/Makefile    Thu May 02 11:25:49 2019 +0000
+++ b/lang/python37/Makefile    Thu May 02 12:50:42 2019 +0000
@@ -1,8 +1,9 @@
-# $NetBSD: Makefile,v 1.8 2019/04/30 04:49:38 rillig Exp $
+# $NetBSD: Makefile,v 1.9 2019/05/02 12:50:42 wiedi Exp $
 
 .include "dist.mk"
 
 PKGNAME=       python37-${PY_DISTVERSION}
+PKGREVISION=   1
 CATEGORIES=    lang python
 
 MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
diff -r d00241a4e7ac -r 6fb0cc972554 lang/python37/distinfo
--- a/lang/python37/distinfo    Thu May 02 11:25:49 2019 +0000
+++ b/lang/python37/distinfo    Thu May 02 12:50:42 2019 +0000
@@ -1,10 +1,10 @@
-$NetBSD: distinfo,v 1.9 2019/04/25 17:44:21 leot Exp $
+$NetBSD: distinfo,v 1.10 2019/05/02 12:50:42 wiedi Exp $
 
 SHA1 (Python-3.7.3.tar.xz) = e3584650a06ae2765da0678176deae9d133f1b3d
 RMD160 (Python-3.7.3.tar.xz) = 0095f3072e17edb789656442290f8abd0ec1bc58
 SHA512 (Python-3.7.3.tar.xz) = 6d9b7c0f1764e0f655a39430a3af6f7b5e3c9b7166c042e780677a54b17ad4ca6d0d9cba262c82b1b70bba8f7c28883dad4cc0d7cc194fc7d2c1b5f4f08a763a
 Size (Python-3.7.3.tar.xz) = 17108364 bytes
-SHA1 (patch-Lib_ctypes_util.py) = 6bef0b219f210045b73ebe66b7ca87570981dbed
+SHA1 (patch-Lib_ctypes_util.py) = 032cc99ebad93ddddfd89073c60424a952e3faa3
 SHA1 (patch-Lib_distutils_command_install.py) = 6fc6f5d918b7581fc62cd0fe55857ee932c3a341
 SHA1 (patch-Lib_distutils_sysconfig.py) = 6822eafb4dfded86d7f7353831816aeb8119e6cf
 SHA1 (patch-Lib_distutils_unixccompiler.py) = 2e65a8dd5dd3fe25957206c062106fa7a6fc4e69
diff -r d00241a4e7ac -r 6fb0cc972554 lang/python37/patches/patch-Lib_ctypes_util.py
--- a/lang/python37/patches/patch-Lib_ctypes_util.py    Thu May 02 11:25:49 2019 +0000
+++ b/lang/python37/patches/patch-Lib_ctypes_util.py    Thu May 02 12:50:42 2019 +0000
@@ -1,11 +1,13 @@
-$NetBSD: patch-Lib_ctypes_util.py,v 1.1 2019/03/02 13:23:36 adam Exp $
+$NetBSD: patch-Lib_ctypes_util.py,v 1.2 2019/05/02 12:50:42 wiedi Exp $
 
 Fallback to clang.
 
 Look for shared libraries in PkgSrc prefix.
 Note: /usr/local will get replaced by SUBST.
 
---- Lib/ctypes/util.py.orig    2018-12-23 21:37:36.000000000 +0000
+Pull in patch for http://bugs.python.org/issue23287 for SunOS
+
+--- Lib/ctypes/util.py.orig    2019-03-25 20:21:05.000000000 +0000
 +++ Lib/ctypes/util.py
 @@ -102,6 +102,8 @@ elif os.name == "posix":
  
@@ -16,7 +18,54 @@
              c_compiler = shutil.which('cc')
          if not c_compiler:
              # No C compiler available, give up
-@@ -287,7 +289,7 @@ elif os.name == "posix":
+@@ -213,34 +215,15 @@ elif os.name == "posix":
+ 
+     elif sys.platform == "sunos5":
+ 
+-        def _findLib_crle(name, is64):
+-            if not os.path.exists('/usr/bin/crle'):
+-                return None
++        def _findLib_path(name, is64):
+ 
+             env = dict(os.environ)
+             env['LC_ALL'] = 'C'
+ 
+             if is64:
+-                args = ('/usr/bin/crle', '-64')
++                paths = "/lib/64:/usr/lib/64:/usr/local/lib"
+             else:
+-                args = ('/usr/bin/crle',)
+-
+-            paths = None
+-            try:
+-                proc = subprocess.Popen(args,
+-                                        stdout=subprocess.PIPE,
+-                                        stderr=subprocess.DEVNULL,
+-                                        env=env)
+-            except OSError:  # E.g. bad executable
+-                return None
+-            with proc:
+-                for line in proc.stdout:
+-                    line = line.strip()
+-                    if line.startswith(b'Default Library Path (ELF):'):
+-                        paths = os.fsdecode(line).split()[4]
+-
+-            if not paths:
+-                return None
++                paths = "/lib:/usr/lib:/usr/local/lib"
+ 
+             for dir in paths.split(":"):
+                 libfile = os.path.join(dir, "lib%s.so" % name)
+@@ -250,7 +233,7 @@ elif os.name == "posix":
+             return None
+ 
+         def find_library(name, is64 = False):
+-            return _get_soname(_findLib_crle(name, is64) or _findLib_gcc(name))
++            return _get_soname(_findLib_path(name, is64) or _findLib_gcc(name))
+ 
+     else:
+ 
+@@ -287,7 +270,7 @@ elif os.name == "posix":
          def _findLib_ld(name):
              # See issue #9998 for why this is needed
              expr = r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name)



Home | Main Index | Thread Index | Old Index