summaryrefslogtreecommitdiff
path: root/lang/python36
diff options
context:
space:
mode:
authoradam <adam@pkgsrc.org>2019-03-02 13:23:35 +0000
committeradam <adam@pkgsrc.org>2019-03-02 13:23:35 +0000
commitb50a14528543df8c4b557096d345df1402237b96 (patch)
treedbaf89021fa97e3380b965dc9b00f627f45255e3 /lang/python36
parentde56b550a83e9a091e9b94bbe26a194a429a5fcc (diff)
downloadpkgsrc-b50a14528543df8c4b557096d345df1402237b96.tar.gz
python3[4567]: find_library() fixes; remove -stack_size from LDFLAGS on Darwin.
PkgSrc changes: * Make find_library() consitant for all Python versions: - Fallback to clang, when gcc is not installed. - Find libraries in PkgSrc prefix. * Do not use -stack_size; it ends up in 'pythonNN-config --ldflags', and some modules fail to build.
Diffstat (limited to 'lang/python36')
-rw-r--r--lang/python36/Makefile22
-rw-r--r--lang/python36/distinfo6
-rw-r--r--lang/python36/options.mk13
-rw-r--r--lang/python36/patches/patch-Lib_ctypes_util.py17
-rw-r--r--lang/python36/patches/patch-configure35
5 files changed, 48 insertions, 45 deletions
diff --git a/lang/python36/Makefile b/lang/python36/Makefile
index 711cf3ead91..e7c79d0725c 100644
--- a/lang/python36/Makefile
+++ b/lang/python36/Makefile
@@ -1,8 +1,9 @@
-# $NetBSD: Makefile,v 1.15 2018/07/03 03:52:41 adam Exp $
+# $NetBSD: Makefile,v 1.16 2019/03/02 13:23:36 adam Exp $
.include "dist.mk"
PKGNAME= python36-${PY_DISTVERSION}
+PKGREVISION= 1
CATEGORIES= lang python
MAINTAINER= pkgsrc-users@NetBSD.org
@@ -12,7 +13,7 @@ LICENSE= python-software-foundation
CONFLICTS+= python-[0-9]*
-PLIST_AWK+= -f ${PKGSRCDIR}/lang/python/plist-python.awk
+PLIST_AWK= -f ${PKGSRCDIR}/lang/python/plist-python.awk
PLIST_AWK_ENV+= PYVERS=36
PRINT_PLIST_AWK+= /^[^@]/ && /[^\/]+\.pyc$$/ {
PRINT_PLIST_AWK+= sub(/__pycache__\//, "")
@@ -152,25 +153,16 @@ REPLACE_FILES.python+= Lib/turtledemo/yinyang.py
REPLACE_FILES.python+= Lib/uu.py
REPLACE_FILES.python+= Lib/webbrowser.py
+# XXX: It might be needed to add manually more paths like ${PREFIX}/qt5/lib
+# Test: python -c 'from ctypes.util import find_library; print(find_library("ffi"));'
SUBST_CLASSES+= findlib
-SUBST_MESSAGE.findlib= Fixing find_library_file on Darwin.
+SUBST_MESSAGE.findlib= Fixing find_library().
SUBST_STAGE.findlib= pre-configure
SUBST_FILES.findlib= Lib/ctypes/macholib/dyld.py
SUBST_FILES.findlib+= Lib/ctypes/util.py
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'
-
-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', \)!'${COMPILER_RPATH_FLAG}${PREFIX}/lib', '-L${PREFIX}/lib', \1!"
+SUBST_SED.findlib+= -e "s!\('-Wl,-t'\)!'${COMPILER_RPATH_FLAG}${PREFIX}/lib', '-L${PREFIX}/lib', \1!"
.include "options.mk"
diff --git a/lang/python36/distinfo b/lang/python36/distinfo
index 5633544742d..acc4b2d5ca6 100644
--- a/lang/python36/distinfo
+++ b/lang/python36/distinfo
@@ -1,10 +1,10 @@
-$NetBSD: distinfo,v 1.23 2018/12/31 10:06:45 adam Exp $
+$NetBSD: distinfo,v 1.24 2019/03/02 13:23:36 adam Exp $
SHA1 (Python-3.6.8.tar.xz) = ee55acedef049268307633cbc9c7ff0610d1244f
RMD160 (Python-3.6.8.tar.xz) = 478ffd42f188414cd6c114740f90b147363b9b10
SHA512 (Python-3.6.8.tar.xz) = b17867e451ebe662f50df83ed112d3656c089e7d750651ea640052b01b713b58e66aac9e082f71fd16f5b5510bc9b797f5ccd30f5399581e9aa406197f02938a
Size (Python-3.6.8.tar.xz) = 17212420 bytes
-SHA1 (patch-Lib_ctypes_util.py) = 9f8b674e06eea11e723a34c8af762436a5e3f52e
+SHA1 (patch-Lib_ctypes_util.py) = 3b7aecb2879cce70c76bd4bc60f2ec577a5bed61
SHA1 (patch-Lib_distutils_command_install.py) = 29204f34296f36ab2b21c745f915ba73caf2b71c
SHA1 (patch-Lib_distutils_sysconfig.py) = 6822eafb4dfded86d7f7353831816aeb8119e6cf
SHA1 (patch-Lib_distutils_unixccompiler.py) = e7aa684fa186de7a01486c3d8bfa177afdd22ef9
@@ -15,6 +15,6 @@ SHA1 (patch-Modules_nismodule.c) = 1bafe9b06359586d027a77011b103877590d947d
SHA1 (patch-Modules_socketmodule.c) = e6bdb8990cd9b8cf0b0ff48e6ae7b664681a9924
SHA1 (patch-Modules_socketmodule.h) = 13a3290eb72078067060d3e71b7baa08f3eb591c
SHA1 (patch-Python_thread__pthread.h) = fb81eaa604b4ed7c1b64c3f4731d58a8aee257be
-SHA1 (patch-configure) = ab2fb05bb25ba11baecfeb58918f436d3717b2ae
+SHA1 (patch-configure) = 2c2f3e4bb0da0232f7c0c7eeae1eee782b06dd01
SHA1 (patch-pyconfig.h.in) = 58e2c03489f9b6e4d88f144d8c09773f92eacd61
SHA1 (patch-setup.py) = 56851b30c8a1538012e7c78e7d33af25da5f7db4
diff --git a/lang/python36/options.mk b/lang/python36/options.mk
index 7ca7488873b..5f5e36bfe20 100644
--- a/lang/python36/options.mk
+++ b/lang/python36/options.mk
@@ -1,4 +1,4 @@
-# $NetBSD: options.mk,v 1.2 2017/05/23 10:53:56 jperkin Exp $
+# $NetBSD: options.mk,v 1.3 2019/03/02 13:23:36 adam Exp $
PKG_OPTIONS_VAR= PKG_OPTIONS.python36
PKG_SUPPORTED_OPTIONS= dtrace x11
@@ -8,6 +8,7 @@ PKG_SUGGESTED_OPTIONS= x11
.include "../../mk/bsd.options.mk"
PLIST_VARS+= dtrace
+
.if !empty(PKG_OPTIONS:Mdtrace)
CONFIGURE_ARGS+= --with-dtrace
PLIST.dtrace= yes
@@ -16,11 +17,11 @@ PLIST.dtrace= yes
.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!'
+SUBST_CLASSES+= xfindlib
+SUBST_MESSAGE.xfindlib= Fixing find_library() for native X11.
+SUBST_STAGE.xfindlib= pre-configure
+SUBST_FILES.xfindlib= Lib/ctypes/util.py
+SUBST_SED.xfindlib= -e "s!\('-Wl,-t'\)!'${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
diff --git a/lang/python36/patches/patch-Lib_ctypes_util.py b/lang/python36/patches/patch-Lib_ctypes_util.py
index da7b0d54c8b..91249027e80 100644
--- a/lang/python36/patches/patch-Lib_ctypes_util.py
+++ b/lang/python36/patches/patch-Lib_ctypes_util.py
@@ -1,11 +1,22 @@
-$NetBSD: patch-Lib_ctypes_util.py,v 1.1 2018/06/17 19:21:22 adam Exp $
+$NetBSD: patch-Lib_ctypes_util.py,v 1.2 2019/03/02 13:23:36 adam Exp $
+
+Fallback to clang.
Look for shared libraries in PkgSrc prefix.
Note: /usr/local will get replaced by SUBST.
---- Lib/ctypes/util.py.orig 2018-03-28 09:19:31.000000000 +0000
+--- Lib/ctypes/util.py.orig 2018-12-23 21:37:14.000000000 +0000
+++ Lib/ctypes/util.py
-@@ -278,7 +278,7 @@ elif os.name == "posix":
+@@ -93,6 +93,8 @@ elif os.name == "posix":
+
+ c_compiler = shutil.which('gcc')
+ if not c_compiler:
++ c_compiler = shutil.which('clang')
++ if not c_compiler:
+ c_compiler = shutil.which('cc')
+ if not c_compiler:
+ # No C compiler available, give up
+@@ -278,7 +280,7 @@ elif os.name == "posix":
def _findLib_ld(name):
# See issue #9998 for why this is needed
expr = r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name)
diff --git a/lang/python36/patches/patch-configure b/lang/python36/patches/patch-configure
index 705c3d1c0ec..b4bc2bc3e9c 100644
--- a/lang/python36/patches/patch-configure
+++ b/lang/python36/patches/patch-configure
@@ -1,4 +1,4 @@
-$NetBSD: patch-configure,v 1.11 2018/06/02 23:31:48 youri Exp $
+$NetBSD: patch-configure,v 1.12 2019/03/02 13:23:36 adam Exp $
Simplify _sysconfigdata to include only platform name.
@@ -7,15 +7,15 @@ http://bugs.python.org/issue21458
Changes for consistency across pkgsrc platforms.
-Fix linking on Darwin. -stack_size is not yet supported.
+Fix linking on Darwin; don't use -stack_size.
Use gnu99 instead of c99 to avoid "alloca() undefined" problems on macppc.
detect netcan/can.h on NetBSD
---- configure.orig 2018-03-28 09:19:31.000000000 +0000
+--- configure.orig 2018-12-23 21:37:14.000000000 +0000
+++ configure
-@@ -2926,7 +2926,7 @@ $as_echo_n "checking for python interpre
+@@ -2932,7 +2932,7 @@ $as_echo_n "checking for python interpre
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $interp" >&5
$as_echo "$interp" >&6; }
@@ -24,7 +24,7 @@ detect netcan/can.h on NetBSD
fi
elif test "$cross_compiling" = maybe; then
as_fn_error $? "Cross compiling required --host=HOST-TUPLE and --build=ARCH" "$LINENO" 5
-@@ -3318,7 +3318,7 @@ case $ac_sys_system/$ac_sys_release in
+@@ -3324,7 +3324,7 @@ case $ac_sys_system/$ac_sys_release in
# Reconfirmed for OpenBSD 3.3 by Zachary Hamm, for 3.4 by Jason Ish.
# In addition, Stefan Krah confirms that issue #1244610 exists through
# OpenBSD 4.6, but is fixed in 4.7.
@@ -33,7 +33,7 @@ detect netcan/can.h on NetBSD
define_xopen_source=no
# OpenBSD undoes our definition of __BSD_VISIBLE if _XOPEN_SOURCE is
# also defined. This can be overridden by defining _BSD_SOURCE
-@@ -5963,7 +5963,7 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>
+@@ -5969,7 +5969,7 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>
PY3LIBRARY=libpython3.so
fi
;;
@@ -42,7 +42,7 @@ detect netcan/can.h on NetBSD
LDLIBRARY='libpython$(LDVERSION).so'
BLDLIBRARY='-L. -lpython$(LDVERSION)'
RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
-@@ -6938,7 +6938,7 @@ UNIVERSAL_ARCH_FLAGS=
+@@ -6977,7 +6977,7 @@ UNIVERSAL_ARCH_FLAGS=
# tweak BASECFLAGS based on compiler and platform
case $GCC in
yes)
@@ -51,7 +51,7 @@ detect netcan/can.h on NetBSD
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -Wextra" >&5
$as_echo_n "checking for -Wextra... " >&6; }
-@@ -8121,7 +8121,7 @@ done
+@@ -8242,7 +8242,7 @@ done
# On Linux, can.h and can/raw.h require sys/socket.h
@@ -60,7 +60,7 @@ detect netcan/can.h on NetBSD
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "
-@@ -9237,8 +9237,8 @@ then
+@@ -9358,8 +9358,8 @@ then
LDCXXSHARED="$LDCXXSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
else
# No framework, use the Python app as bundle-loader
@@ -71,7 +71,7 @@ detect netcan/can.h on NetBSD
LDCXXSHARED="$LDCXXSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
fi ;;
Darwin/*)
-@@ -9262,9 +9262,9 @@ then
+@@ -9383,9 +9383,9 @@ then
LDCXXSHARED="$LDCXXSHARED "'$(PYTHONFRAMEWORKPREFIX)/$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
else
# No framework, use the Python app as bundle-loader
@@ -84,7 +84,7 @@ detect netcan/can.h on NetBSD
fi
else
# building for OS X 10.3 and later
-@@ -9303,6 +9303,9 @@ then
+@@ -9424,6 +9424,9 @@ then
;;
esac
fi;;
@@ -94,7 +94,7 @@ detect netcan/can.h on NetBSD
NetBSD*|DragonFly*)
LDSHARED='$(CC) -shared'
LDCXXSHARED='$(CXX) -shared';;
-@@ -9347,7 +9350,7 @@ then
+@@ -9468,7 +9471,7 @@ then
Linux-android*) ;;
Linux*|GNU*) CCSHARED="-fPIC";;
BSD/OS*/4*) CCSHARED="-fpic";;
@@ -103,16 +103,15 @@ detect netcan/can.h on NetBSD
OpenUNIX*|UnixWare*)
if test "$GCC" = "yes"
then CCSHARED="-fPIC"
-@@ -9387,7 +9390,7 @@ then
+@@ -9508,7 +9511,6 @@ then
# Issue #18075: the default maximum stack size (8MBytes) is too
# small for the default recursion limit. Increase the stack size
# to ensure that tests don't crash
- LINKFORSHARED="-Wl,-stack_size,1000000 $LINKFORSHARED"
-+ #LINKFORSHARED="-Wl,-stack_size,1000000 $LINKFORSHARED"
if test "$enable_framework"
then
-@@ -9397,7 +9400,7 @@ then
+@@ -9518,7 +9520,7 @@ then
OpenUNIX*|UnixWare*) LINKFORSHARED="-Wl,-Bexport";;
SCO_SV*) LINKFORSHARED="-Wl,-Bexport";;
ReliantUNIX*) LINKFORSHARED="-W1 -Blargedynsym";;
@@ -121,7 +120,7 @@ detect netcan/can.h on NetBSD
if [ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]
then
LINKFORSHARED="-Wl,--export-dynamic"
-@@ -11174,7 +11177,7 @@ if ${ac_cv_dtrace_link+:} false; then :
+@@ -11333,7 +11335,7 @@ if ${ac_cv_dtrace_link+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_cv_dtrace_link=no
@@ -130,7 +129,7 @@ detect netcan/can.h on NetBSD
"$DTRACE" -G -s conftest.d -o conftest.o > /dev/null 2>&1 && \
ac_cv_dtrace_link=yes
-@@ -15001,8 +15004,6 @@ $as_echo "$SOABI" >&6; }
+@@ -15177,8 +15179,6 @@ $as_echo "$SOABI" >&6; }
case $ac_sys_system in
@@ -139,7 +138,7 @@ detect netcan/can.h on NetBSD
*)
EXT_SUFFIX=${SHLIB_SUFFIX};;
esac
-@@ -15014,11 +15015,7 @@ LDVERSION='$(VERSION)$(ABIFLAGS)'
+@@ -15190,11 +15190,7 @@ LDVERSION='$(VERSION)$(ABIFLAGS)'
$as_echo "$LDVERSION" >&6; }