summaryrefslogtreecommitdiff
path: root/lang/python38
diff options
context:
space:
mode:
authorschmonz <schmonz@pkgsrc.org>2020-08-14 19:28:43 +0000
committerschmonz <schmonz@pkgsrc.org>2020-08-14 19:28:43 +0000
commitdebecddf83a7d0dcc8f7ce7074d24195fc5051da (patch)
tree9ce22773483f5848eceb190c14c8e10621ccc22a /lang/python38
parent5bb0180bb5d0d9271bc769b0f4baac880d2ba1f6 (diff)
downloadpkgsrc-debecddf83a7d0dcc8f7ce7074d24195fc5051da.tar.gz
On systems where both of the conditions
1. LD_LIBRARY_PATH does _not_ take precedence over DT_RPATH (e.g. Linux) 2. A previous libpython with the same major.minor is already installed (e.g. a previous version of this package) hold, the built python will be linked with the installed libpython, causing it to report an old teeny version in sys.version_info while staging the install. Then "make package" fails with PLIST mismatches for {,Pattern}Grammar.*.pickle. pkgsrc knows which version we're building. Pass that down instead. For platforms that weren't having this problem, no functional change intended. For platforms that were, this simply restores "make package", so no PKGREVISION bump.
Diffstat (limited to 'lang/python38')
-rw-r--r--lang/python38/Makefile7
-rw-r--r--lang/python38/distinfo3
-rw-r--r--lang/python38/patches/patch-Lib_lib2to3_pgen2_driver.py28
3 files changed, 36 insertions, 2 deletions
diff --git a/lang/python38/Makefile b/lang/python38/Makefile
index f6f4ab70d58..1fa8429e907 100644
--- a/lang/python38/Makefile
+++ b/lang/python38/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.12 2020/07/14 19:12:31 adam Exp $
+# $NetBSD: Makefile,v 1.13 2020/08/14 19:28:44 schmonz Exp $
.include "dist.mk"
@@ -158,6 +158,11 @@ SUBST_SED.findlib= -e 's,/usr/local,${PREFIX},'
SUBST_SED.findlib+= -e "s!\('-Wl,-t'\)!'${COMPILER_RPATH_FLAG}${PREFIX}/lib', '-L${PREFIX}/lib', \1!"
SUBST_NOOP_OK.findlib= yes
+SUBST_CLASSES+= pkgversion
+SUBST_STAGE.pkgversion= pre-configure
+SUBST_FILES.pkgversion= Lib/lib2to3/pgen2/driver.py
+SUBST_VARS.pkgversion= PKGVERSION_NOREV
+
.include "options.mk"
CHECK_INTERPRETER_SKIP= lib/python${PY_VER_SUFFIX}/venv/scripts/posix/pydoc
diff --git a/lang/python38/distinfo b/lang/python38/distinfo
index 998272ffe5b..28f8727bdbe 100644
--- a/lang/python38/distinfo
+++ b/lang/python38/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.9 2020/07/21 16:31:15 adam Exp $
+$NetBSD: distinfo,v 1.10 2020/08/14 19:28:44 schmonz Exp $
SHA1 (Python-3.8.5.tar.xz) = 68d6c7f948801cc755905162f5ee7589595edee4
RMD160 (Python-3.8.5.tar.xz) = e39eafd2303fa8dc59c16ad5d987c7bc035236a8
@@ -8,6 +8,7 @@ SHA1 (patch-Lib_ctypes_util.py) = 032cc99ebad93ddddfd89073c60424a952e3faa3
SHA1 (patch-Lib_distutils_command_install.py) = 6fc6f5d918b7581fc62cd0fe55857ee932c3a341
SHA1 (patch-Lib_distutils_sysconfig.py) = 6822eafb4dfded86d7f7353831816aeb8119e6cf
SHA1 (patch-Lib_distutils_unixccompiler.py) = 2e65a8dd5dd3fe25957206c062106fa7a6fc4e69
+SHA1 (patch-Lib_lib2to3_pgen2_driver.py) = abe876142a20e60a3c0a0cf80abeecf54855c07c
SHA1 (patch-Lib_sysconfig.py) = a4f009ed73ebbd9d9c4bf7e12b7981182ed8fd7c
SHA1 (patch-Makefile.pre.in) = d42f9f5bca1dd663f64122dc95b49111452fe6e8
SHA1 (patch-Modules_makesetup) = a06786eebffadecedba5e3a50a9785fb47613567
diff --git a/lang/python38/patches/patch-Lib_lib2to3_pgen2_driver.py b/lang/python38/patches/patch-Lib_lib2to3_pgen2_driver.py
new file mode 100644
index 00000000000..f50bc3c3107
--- /dev/null
+++ b/lang/python38/patches/patch-Lib_lib2to3_pgen2_driver.py
@@ -0,0 +1,28 @@
+$NetBSD: patch-Lib_lib2to3_pgen2_driver.py,v 1.1 2020/08/14 19:28:44 schmonz Exp $
+
+On systems where both of the conditions
+
+1. LD_LIBRARY_PATH does _not_ take precedence over DT_RPATH
+ (e.g. Linux)
+2. A previous libpython with the same major.minor is already installed
+ (e.g. a previous version of this package)
+
+hold, the built python will be linked with the installed libpython,
+causing it to report an old teeny version in sys.version_info while
+staging the install. Then "make package" fails with PLIST mismatches for
+{,Pattern}Grammar.*.pickle.
+
+pkgsrc knows which version we're building. Pass that down instead.
+
+--- Lib/lib2to3/pgen2/driver.py.orig 2020-06-27 08:35:53.000000000 +0000
++++ Lib/lib2to3/pgen2/driver.py
+@@ -108,7 +108,8 @@ def _generate_pickle_name(gt):
+ head, tail = os.path.splitext(gt)
+ if tail == ".txt":
+ tail = ""
+- return head + tail + ".".join(map(str, sys.version_info)) + ".pickle"
++ sys_version_info = "@PKGVERSION_NOREV@" + ".final.0"
++ return head + tail + sys_version_info + ".pickle"
+
+
+ def load_grammar(gt="Grammar.txt", gp=None,