summaryrefslogtreecommitdiff
path: root/lang/python34/Makefile
diff options
context:
space:
mode:
authorkamil <kamil>2016-09-18 12:36:41 +0000
committerkamil <kamil>2016-09-18 12:36:41 +0000
commit802eff5bb8652dec7ec44189e9e827cd96bdf2a3 (patch)
tree848610dca4881abb44622c5f85bb3dcf97a5cf3c /lang/python34/Makefile
parentaa24c79fc51fb3b2c117cce061393754c29c7950 (diff)
downloadpkgsrc-802eff5bb8652dec7ec44189e9e827cd96bdf2a3.tar.gz
Forward port patches from python27 for dlopen(3)
Original changes in python27/Makefile r1.62-r1.67 ================================================= Add an option for Python: x11 Fix dlopen(3) calls in _ctypes.so for X11BASE libraries A Python code can dynamically load shared libraries and it's wrapped with a plain dlopen(3) call. The holder of this interface (_ctypes module) without rpath set to X11BASE cannot detect libs like 'GL'. 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.
Diffstat (limited to 'lang/python34/Makefile')
-rw-r--r--lang/python34/Makefile23
1 files changed, 22 insertions, 1 deletions
diff --git a/lang/python34/Makefile b/lang/python34/Makefile
index df1c4978df5..f5780b2ef30 100644
--- a/lang/python34/Makefile
+++ b/lang/python34/Makefile
@@ -1,8 +1,9 @@
-# $NetBSD: Makefile,v 1.16 2016/05/13 16:35:03 adam Exp $
+# $NetBSD: Makefile,v 1.17 2016/09/18 12:36:41 kamil Exp $
.include "dist.mk"
PKGNAME= python34-${PY_DISTVERSION}
+PKGREVISION= 1
CATEGORIES= lang python
MAINTAINER= pkgsrc-users@NetBSD.org
@@ -122,6 +123,26 @@ 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}${PREFIX}/lib -L${PREFIX}/lib \1!'
+
+.include "options.mk"
+
SUBST_CLASSES+= sslbase
SUBST_MESSAGE.sslbase= Fixing OpenSSL base directory to find header file.
SUBST_STAGE.sslbase= pre-configure