pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/lang/python27 Fixing find_library() on POSIX-like (exc...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/0500aef09fe9
branches:  trunk
changeset: 350103:0500aef09fe9
user:      kamil <kamil%pkgsrc.org@localhost>
date:      Sat Jul 23 13:09:15 2016 +0000

description:
Fixing find_library() on POSIX-like (excluding Darwin) systems.

This isn't addressing Python's wrapper for dlopen(3).

This possibily addresses mostly NetBSD as other popular OSes have ldconfig.

Testing commands:

 - before applying the patch

>>> from ctypes.util import find_library
>>> find_library("m")
'libm.so.0'
>>> find_library("crypto")
'libcrypto.so.11'
>>> find_library("GL")
>>> find_library("curl")

 - after applying the patch

>>> from ctypes.util import find_library
>>> find_library("m")
'libm.so.0'
>>> find_library("crypto")
'libcrypto.so.11'
>>> find_library("GL")
'libGL.so.2'
>>> find_library("curl")
'libcurl.so.4'

This patch doesn't solve the case of custom dirs like $PREFIX/qt5/lib.
However it's solving most common cases of using this call.

A possible solution is to parse the output "pkg_info -La"... however it's
very slow. In other words a cache with libraries might be needed to handle
it efficiently.

Bump PKGREVISION.

diffstat:

 lang/python27/Makefile |  22 ++++++++++++++++++++--
 1 files changed, 20 insertions(+), 2 deletions(-)

diffs (40 lines):

diff -r 58c13cf69965 -r 0500aef09fe9 lang/python27/Makefile
--- a/lang/python27/Makefile    Sat Jul 23 08:30:43 2016 +0000
+++ b/lang/python27/Makefile    Sat Jul 23 13:09:15 2016 +0000
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.62 2016/07/11 12:17:13 ryoon Exp $
+# $NetBSD: Makefile,v 1.63 2016/07/23 13:09:15 kamil Exp $
 
 .include "dist.mk"
 
 PKGNAME=       python27-${PY_DISTVERSION}
-PKGREVISION=   1
+PKGREVISION=   2
 CATEGORIES=    lang python
 
 MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
@@ -162,6 +162,24 @@
 SUBST_FILES.findlib=   Lib/distutils/unixccompiler.py
 SUBST_SED.findlib=     -e 's,/usr/local,${PREFIX},'
 
+# XXX: It might be needed to add manually more paths like ${PREFIX}/qt5/lib
+# Testing:
+# >>> from ctypes.util import find_library
+# >>> find_library("m")
+# 'libm.so.0'
+# >>> find_library("crypto")
+# 'libcrypto.so.11'
+# >>> find_library("GL")
+# 'libGL.so.2'
+# >>> find_library("curl")
+# 'libcurl.so.4'
+
+SUBST_CLASSES+=                pfindlib
+SUBST_MESSAGE.pfindlib=        Fixing find_library() on POSIX-like (excluding Darwin) systems.
+SUBST_STAGE.pfindlib=  pre-configure
+SUBST_FILES.pfindlib=  Lib/ctypes/util.py
+SUBST_SED.pfindlib=    -e 's!\(-Wl,-t -o\)!${COMPILER_RPATH_FLAG}${X11BASE}/lib -L${X11BASE}/lib ${COMPILER_RPATH_FLAG}${PREFIX}/lib -L${PREFIX}/lib \1!'
+
 SUBST_CLASSES+=                sslbase
 SUBST_MESSAGE.sslbase= Fixing find-file for openssl with SSLBASE.
 SUBST_STAGE.sslbase=   pre-configure



Home | Main Index | Thread Index | Old Index