summaryrefslogtreecommitdiff
path: root/sysutils
diff options
context:
space:
mode:
authorfhajny <fhajny>2015-12-01 13:04:53 +0000
committerfhajny <fhajny>2015-12-01 13:04:53 +0000
commit7e99997323b7bd262e15d06d8d382c446e4cbe39 (patch)
treebad5ca9612180284ce9aba80c101a6bb948da9d8 /sysutils
parentf644a2083ec11e3e4f7e557a15a1ebe801b954f2 (diff)
downloadpkgsrc-7e99997323b7bd262e15d06d8d382c446e4cbe39.tar.gz
Fix PKGNAME to properly version Python.
Fix lib loading to not use find_library. Fixes NetBSD/SunOS at least.
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/py-augeas/Makefile3
-rw-r--r--sysutils/py-augeas/distinfo3
-rw-r--r--sysutils/py-augeas/patches/patch-augeas.py34
3 files changed, 38 insertions, 2 deletions
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 <nils@redhat.com>
+ 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