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:           Wed Apr  1 20:35:38 UTC 2026

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

Log Message:
python: add PY_RENAME_BINARIES variable

This will rename the listed binaries in ${PREFIX}/bin from "foo" to
"foo-${PYVERSSUFFIX}", e.g. "foo-3.14.

This will allow us to get rid of a lot of post-install targets in
Python packages.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 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.22 pkgsrc/lang/python/wheel.mk:1.23
--- pkgsrc/lang/python/wheel.mk:1.22    Sun May 11 19:34:25 2025
+++ pkgsrc/lang/python/wheel.mk Wed Apr  1 20:35:38 2026
@@ -1,4 +1,4 @@
-# $NetBSD: wheel.mk,v 1.22 2025/05/11 19:34:25 gdt Exp $
+# $NetBSD: wheel.mk,v 1.23 2026/04/01 20:35:38 wiz Exp $
 #
 # Build and install Python wheels
 #
@@ -24,6 +24,11 @@
 
 # Variables:
 #
+# PY_RENAME_BINARIES:  List of binaries (in ${PREFIX}/bin) that should
+#                      be renamed to have a '-${PYVERSSUFFIX}'
+#                      suffix. This allows parallel installation of a
+#                      package for different Python versions.
+#
 # WHEELFILE:           Path to the wheelfile to be installed.
 #                      Only needs to be set if do-build is redefined.
 #
@@ -49,6 +54,8 @@ WHEEL_ARGS?=  # empty
 
 PRINT_PLIST_AWK+=      { gsub(/${_WHEEL_INFODIR:S,.,\.,g}/, "$${WHEEL_INFODIR}") }
 
+PY_RENAME_BINARIES?=   # empty
+
 .include "../../mk/bsd.fast.prefs.mk"
 
 .if !target(do-build)
@@ -75,6 +82,9 @@ do-install:
                --prefix ${PREFIX:Q} \
                ${PYINSTALL_EXEC} \
                ${WHEELFILE}
+.for f in ${PY_RENAME_BINARIES}
+       cd ${DESTDIR}/${PREFIX}/bin && ${MV} $f $f-${PYVERSSUFFIX} || ${TRUE}
+.endfor
 .endif
 
 USE_PYTEST?=   yes



Home | Main Index | Thread Index | Old Index