diff options
author | Matthew Seaman <matthew@FreeBSD.org> | 2023-03-16 15:55:30 +0000 |
---|---|---|
committer | Matthew Seaman <matthew@FreeBSD.org> | 2023-03-18 14:20:02 +0000 |
commit | 2b7d76adec17cec8185635e6b2ad46e303cbc77b (patch) | |
tree | 6a9a0684f624edbd5926185cb2e798acc36d5595 /Mk | |
parent | 8d2f58feb60d5cedc3ebec12cb9e4571dd9ecc2b (diff) | |
download | ports-2b7d76adec17cec8185635e6b2ad46e303cbc77b.tar.gz ports-2b7d76adec17cec8185635e6b2ad46e303cbc77b.zip |
Mk/Uses/python.mk: Support PEP440 versioning
The python PEP440 version numbering standard is _mostly_ compatible
with FreeBSD port versioning rules. Exceptions exist, where the
PORTVERSION can be derived from the upstream DISTVERSION
automatically. For example:
PEP440 DISTVERSION: FreeBSD PORTVERSION:
2.3.post1 2.3.p1
Now, this interacts badly with PEP517 build setups. hatchling will
enforce PEP440 complicance, so it isn't practical to modify the ported
code to use exactly the FreeBSD version.
Instead, simply referring to DISTVERSION rather than PORTVERSION will
allow the build process to complete smoothly.
See https://reviews.freebsd.org/D39123 for an example port update
which depends on this change
Approved by: python (maintainer, vishwin)
Differential Revision: https://reviews.freebsd.org/D39124
Diffstat (limited to 'Mk')
-rw-r--r-- | Mk/Uses/python.mk | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Mk/Uses/python.mk b/Mk/Uses/python.mk index edf56e387102..b4155814d617 100644 --- a/Mk/Uses/python.mk +++ b/Mk/Uses/python.mk @@ -151,7 +151,7 @@ # default: <empty> # # PEP517_INSTALL_CMD - Command sequence for a PEP-517 install frontend that installs a wheel. -# default: ${PYTHON_CMD} -m installer -d ${STAGEDIR} -p ${PREFIX} --no-compile-bytecode ${BUILD_WRKSRC}/dist/${PORTNAME:C/[-_]+/_/g}-${PORTVERSION}-*.whl +# default: ${PYTHON_CMD} -m installer -d ${STAGEDIR} -p ${PREFIX} --no-compile-bytecode ${BUILD_WRKSRC}/dist/${PORTNAME:C/[-_]+/_/g}-${DISTVERSION}-*.whl # # PEP517_INSTALL_DEPEND - Port needed to execute ${PEP517_INSTALL_CMD}. # default: ${PYTHON_PKGNAMEPREFIX}installer>0:devel/py-installer@${PY_FLAVOR} @@ -680,7 +680,7 @@ PYDISTUTILS_EGGINFODIR?=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR} # PEP-517 support PEP517_BUILD_CMD?= ${PYTHON_CMD} -m build -n -w ${PEP517_BUILD_CONFIG_SETTING} PEP517_BUILD_DEPEND?= ${PYTHON_PKGNAMEPREFIX}build>0:devel/py-build@${PY_FLAVOR} -PEP517_INSTALL_CMD?= ${PYTHON_CMD} -m installer -d ${STAGEDIR} -p ${PREFIX} --no-compile-bytecode ${BUILD_WRKSRC}/dist/${PORTNAME:C/[-_]+/_/g}-${PORTVERSION}-*.whl +PEP517_INSTALL_CMD?= ${PYTHON_CMD} -m installer -d ${STAGEDIR} -p ${PREFIX} --no-compile-bytecode ${BUILD_WRKSRC}/dist/${PORTNAME:C/[-_]+/_/g}-${DISTVERSION}-*.whl PEP517_INSTALL_DEPEND?= ${PYTHON_PKGNAMEPREFIX}installer>0:devel/py-installer@${PY_FLAVOR} # nose support @@ -901,7 +901,7 @@ do-install: @${MKDIR} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR} @cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${PEP517_INSTALL_CMD} @${PYTHON_CMD} -B ${PORTSDIR}/Mk/Scripts/strip_RECORD.py \ - ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/${PORTNAME:C/[-_]+/_/g}-${PORTVERSION}.dist-info/RECORD >> ${_PYTHONPKGLIST} + ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/${PORTNAME:C/[-_]+/_/g}-${DISTVERSION}.dist-info/RECORD >> ${_PYTHONPKGLIST} @${REINPLACE_CMD} -e 's|^|${PYTHONPREFIX_SITELIBDIR}/|' \ -e 's|^${PYTHONPREFIX_SITELIBDIR}/../../../etc/|etc/|' \ -e 's|^${PYTHONPREFIX_SITELIBDIR}/../../../bin/|bin/|' \ |