From 7e99997323b7bd262e15d06d8d382c446e4cbe39 Mon Sep 17 00:00:00 2001 From: fhajny Date: Tue, 1 Dec 2015 13:04:53 +0000 Subject: Fix PKGNAME to properly version Python. Fix lib loading to not use find_library. Fixes NetBSD/SunOS at least. --- sysutils/py-augeas/Makefile | 3 ++- sysutils/py-augeas/distinfo | 3 ++- sysutils/py-augeas/patches/patch-augeas.py | 34 ++++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 sysutils/py-augeas/patches/patch-augeas.py (limited to 'sysutils') diff --git a/sysutils/py-augeas/Makefile b/sysutils/py-augeas/Makefile index 1776ecf7e0b..de179fe1edc 100644 --- a/sysutils/py-augeas/Makefile +++ b/sysutils/py-augeas/Makefile @@ -1,6 +1,7 @@ -# $NetBSD: Makefile,v 1.1 2014/12/30 17:04:15 bsiegert Exp $ +# $NetBSD: Makefile,v 1.2 2015/12/01 13:04:53 fhajny Exp $ DISTNAME= python-augeas-0.5.0 +PKGNAME= ${DISTNAME:S/python/${PYPKGPREFIX}/} CATEGORIES= sysutils MASTER_SITES= https://fedorahosted.org/released/python-augeas/ diff --git a/sysutils/py-augeas/distinfo b/sysutils/py-augeas/distinfo index affecb63954..467e54df95e 100644 --- a/sysutils/py-augeas/distinfo +++ b/sysutils/py-augeas/distinfo @@ -1,6 +1,7 @@ -$NetBSD: distinfo,v 1.2 2015/11/04 01:32:27 agc Exp $ +$NetBSD: distinfo,v 1.3 2015/12/01 13:04:53 fhajny Exp $ SHA1 (python-augeas-0.5.0.tar.gz) = b758e3d1349999b5d9f3397af3b9e186a2fcfd48 RMD160 (python-augeas-0.5.0.tar.gz) = 909056aeef54735a398581b7a30acb5eff190279 SHA512 (python-augeas-0.5.0.tar.gz) = d93d9e21c720084ee3c1841a2172dd1a4cfb41e668de0f557bd214efd65e685a1e5fc713a7d34e0fed727fe908bb1e8a09a1c10587bc27f3708cbcdee575cc51 Size (python-augeas-0.5.0.tar.gz) = 90667 bytes +SHA1 (patch-augeas.py) = a7efcc8a9b6fd41fd869f6001e0515435d5aafcd diff --git a/sysutils/py-augeas/patches/patch-augeas.py b/sysutils/py-augeas/patches/patch-augeas.py new file mode 100644 index 00000000000..480b7f99a8c --- /dev/null +++ b/sysutils/py-augeas/patches/patch-augeas.py @@ -0,0 +1,34 @@ +$NetBSD: patch-augeas.py,v 1.1 2015/12/01 13:04:54 fhajny Exp $ + +Simplify the way to look up and load the native lib, as +find_library is unreliable on NetBSD and SunOS at least. +--- augeas.py.orig 2014-08-31 16:44:49.000000000 +0000 ++++ augeas.py +@@ -41,7 +41,7 @@ Nils Philippsen + import types + import ctypes + import ctypes.util +-from sys import version_info as _pyver ++from sys import platform, version_info as _pyver + from functools import reduce + + +@@ -65,12 +65,15 @@ def dec(st): + return st.decode(AUGENC) + + +-def _dlopen(*args): ++def _dlopen(args): + """Search for one of the libraries given as arguments and load it. + Returns the library. + """ +- libs = [l for l in [ ctypes.util.find_library(a) for a in args ] if l] +- lib = reduce(lambda x, y: x or ctypes.cdll.LoadLibrary(y), libs, None) ++ if platform == "darwin": ++ libname = "lib" + args + ".dylib" ++ else: ++ libname = "lib" + args + ".so" ++ lib = ctypes.cdll.LoadLibrary(libname) + if not lib: + raise ImportError("Unable to import lib%s!" % args[0]) + return lib -- cgit v1.2.3