Subject: CVS commit: pkgsrc/lang/python34
From: Kamil Rytarowski
Date: 2016-09-18 14:36:41
Message id: 20160918123641.7BE59FBD1@cvs.NetBSD.org

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

Files:
RevisionActionfile
1.17modifypkgsrc/lang/python34/Makefile
1.1addpkgsrc/lang/python34/options.mk