pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/lang/python



Module Name:    pkgsrc
Committed By:   wiz
Date:           Tue Jan 25 13:21:21 UTC 2022

Modified Files:
        pkgsrc/lang/python: wheel.mk

Log Message:
python/wheel.mk: add PLIST code for pyc/pyo

TODO: clean up/merge with extension.mk


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 pkgsrc/lang/python/wheel.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/lang/python/wheel.mk
diff -u pkgsrc/lang/python/wheel.mk:1.3 pkgsrc/lang/python/wheel.mk:1.4
--- pkgsrc/lang/python/wheel.mk:1.3     Thu Jan 13 21:23:25 2022
+++ pkgsrc/lang/python/wheel.mk Tue Jan 25 13:21:21 2022
@@ -1,4 +1,4 @@
-# $NetBSD: wheel.mk,v 1.3 2022/01/13 21:23:25 wiz Exp $
+# $NetBSD: wheel.mk,v 1.4 2022/01/25 13:21:21 wiz Exp $
 #
 # Initial mk for building and installing python wheels
 #
@@ -54,6 +54,19 @@ _WHEEL_INFODIR=      ${WHEEL_NAME}.dist-info
 PLIST_SUBST+=  PYSITELIB=${PYSITELIB}
 PLIST_SUBST+=  WHEEL_INFODIR=${_WHEEL_INFODIR}
 
+# from extension.mk
+
+# Python>=3.2 bytecode file location change
+# http://www.python.org/dev/peps/pep-3147/
+.if empty(_PYTHON_VERSION:M2?)
+PLIST_AWK+=            -f ${PKGSRCDIR}/lang/python/plist-python.awk
+PLIST_AWK_ENV+=                PYVERS="${PYVERSSUFFIX:S/.//}"
+EARLY_PRINT_PLIST_AWK+=        /^[^@]/ && /[^\/]+\.py[co]$$/ {
+EARLY_PRINT_PLIST_AWK+=        gsub(/__pycache__\//, "")
+EARLY_PRINT_PLIST_AWK+=        gsub(/opt-1\.pyc$$/, "pyo")
+EARLY_PRINT_PLIST_AWK+=        gsub(/\.cpython-${_PYTHON_VERSION}/, "")}
+.endif
+
 PRINT_PLIST_AWK+=      { gsub(/${_WHEEL_INFODIR:S,.,\.,g}/, "$${WHEEL_INFODIR}") }
 
 INSTALL_ENV+= PIP_NO_CACHEDIR=1



Home | Main Index | Thread Index | Old Index