pkgsrc-Changes archive

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

CVS commit: pkgsrc/lang/python27



Module Name:    pkgsrc
Committed By:   kamil
Date:           Sat Jul 23 13:09:15 UTC 2016

Modified Files:
        pkgsrc/lang/python27: Makefile

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 pkgsrc/lang/python27/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/lang/python27/Makefile
diff -u pkgsrc/lang/python27/Makefile:1.62 pkgsrc/lang/python27/Makefile:1.63
--- pkgsrc/lang/python27/Makefile:1.62  Mon Jul 11 12:17:13 2016
+++ pkgsrc/lang/python27/Makefile       Sat Jul 23 13:09:15 2016
@@ -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_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



Home | Main Index | Thread Index | Old Index