summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lang/python34/Makefile23
-rw-r--r--lang/python34/options.mk28
2 files changed, 50 insertions, 1 deletions
diff --git a/lang/python34/Makefile b/lang/python34/Makefile
index df1c4978df5..f5780b2ef30 100644
--- a/lang/python34/Makefile
+++ b/lang/python34/Makefile
@@ -1,8 +1,9 @@
-# $NetBSD: Makefile,v 1.16 2016/05/13 16:35:03 adam Exp $
+# $NetBSD: Makefile,v 1.17 2016/09/18 12:36:41 kamil Exp $
.include "dist.mk"
PKGNAME= python34-${PY_DISTVERSION}
+PKGREVISION= 1
CATEGORIES= lang python
MAINTAINER= pkgsrc-users@NetBSD.org
@@ -122,6 +123,26 @@ 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}${PREFIX}/lib -L${PREFIX}/lib \1!'
+
+.include "options.mk"
+
SUBST_CLASSES+= sslbase
SUBST_MESSAGE.sslbase= Fixing OpenSSL base directory to find header file.
SUBST_STAGE.sslbase= pre-configure
diff --git a/lang/python34/options.mk b/lang/python34/options.mk
new file mode 100644
index 00000000000..23f8d43c1fb
--- /dev/null
+++ b/lang/python34/options.mk
@@ -0,0 +1,28 @@
+# $NetBSD: options.mk,v 1.1 2016/09/18 12:36:41 kamil Exp $
+
+PKG_OPTIONS_VAR= PKG_OPTIONS.python27
+PKG_SUPPORTED_OPTIONS+= x11
+PKG_SUGGESTED_OPTIONS= x11
+
+.include "../../mk/bsd.prefs.mk"
+.include "../../mk/bsd.options.mk"
+
+.if !empty(PKG_OPTIONS:Mx11)
+# Support for native X11 paths as an option
+# This code is no-op for modular X11, however for simplicity don't make it conditional.
+SUBST_CLASSES+= x11findlib
+SUBST_MESSAGE.x11findlib= Fixing find_library() for native X11.
+SUBST_STAGE.x11findlib= pre-configure
+SUBST_FILES.x11findlib= Lib/ctypes/util.py
+SUBST_SED.x11findlib= -e 's!\(-Wl,-t -o\)!${COMPILER_RPATH_FLAG}${X11BASE}/lib -L${X11BASE}/lib \1!'
+
+# Required to get definition of X11BASE and retain X11 rpath paths for linker
+# We need to pass rpath to _ctypes.so to get functional dlopen(3) for X11 libs
+USE_X11= yes
+
+SUBST_CLASSES+= cdlopen
+SUBST_MESSAGE.cdlopen= Handle X11BASE paths in dlopen(3) calls of _ctypes.so
+SUBST_STAGE.cdlopen= pre-configure
+SUBST_FILES.cdlopen= setup.py
+SUBST_SED.cdlopen= -e "s!\(libraries=\[\],\)!\1 runtime_library_dirs=\['${X11BASE}/lib'\],!"
+.endif