Link [ pkgsrc | NetBSD | pkgsrc git mirror | PR fulltext-search | netbsd commit viewer ]


   
        usage: [branch:branch] [user:user] [path[@revision]] keyword [... [-excludekeyword [...]]] (e.g. branch:MAIN pkgtools/pkg)




switch to index mode

recent branches: MAIN (1h)  pkgsrc-2024Q1 (3d)  pkgsrc-2023Q4 (78d)  pkgsrc-2023Q2 (110d) 

2024-06-17 16:38:25 UTC Now

2016-07-23 13:09:15 UTC MAIN commitmail json YAML

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.

(kamil)