diff options
author | kamil <kamil@pkgsrc.org> | 2016-07-23 13:09:15 +0000 |
---|---|---|
committer | kamil <kamil@pkgsrc.org> | 2016-07-23 13:09:15 +0000 |
commit | bdccb5e4f63f21974c707c3a858651b7d8cd0210 (patch) | |
tree | 0ceeeecd3a34e2bfa2f1c706c003bf6768dbc367 /lang/python27 | |
parent | bb018dedc55a5acacffff68b780a843e2e54741e (diff) | |
download | pkgsrc-bdccb5e4f63f21974c707c3a858651b7d8cd0210.tar.gz |
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 (limited to 'lang/python27')
-rw-r--r-- | lang/python27/Makefile | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/lang/python27/Makefile b/lang/python27/Makefile index 01733fbdfc9..a53ced374ae 100644 --- a/lang/python27/Makefile +++ b/lang/python27/Makefile @@ -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 @@ -162,6 +162,24 @@ SUBST_STAGE.findlib= pre-configure 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 |