FreeBSD Bugzilla – Attachment 235732 Details for
Bug 255722
[meta] Mk/Uses/python.mk: PEP-517 (pyproject.toml) Support
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
WIP-2.patch
python-build.patch (text/plain), 3.49 KB, created by
Yuri Victorovich
on 2022-08-06 22:29:12 UTC
(
hide
)
Description:
WIP-2.patch
Filename:
MIME Type:
Creator:
Yuri Victorovich
Created:
2022-08-06 22:29:12 UTC
Size:
3.49 KB
patch
obsolete
>diff --git a/Mk/Uses/python.mk b/Mk/Uses/python.mk >index fa7c7b7b7084..aa251a897ca6 100644 >--- a/Mk/Uses/python.mk >+++ b/Mk/Uses/python.mk >@@ -103,6 +103,9 @@ > # distutils - Use distutils as do-configure, do-build and > # do-install targets. implies flavors. > # >+# build - Use build as do-build and >+# do-install targets. implies flavors. >+# > # autoplist - Automatically generates the packaging list for a > # port that uses distutils when defined. > # requires: distutils >@@ -139,6 +142,9 @@ > # package. > # default: setup.py > # >+# PYBUILD_WHEELNAME - Internal base name of the wheel file that build creates. >+# default: ${PORTNAME} with '-' replaced with '_' >+# > # PYDISTUTILS_PKGNAME > # - Internal name in the distutils for egg-info. > # default: ${PORTNAME} >@@ -281,7 +287,7 @@ _PYTHON_BASECMD= ${LOCALBASE}/bin/python > _PYTHON_RELPORTDIR= lang/python > > # List all valid USE_PYTHON features here >-_VALID_PYTHON_FEATURES= allflavors autoplist concurrent cython cython_run \ >+_VALID_PYTHON_FEATURES= allflavors autoplist build concurrent cython cython_run \ > distutils flavors noegginfo noflavors nose nose2 \ > optsuffix py3kplist pytest pytest4 pythonprefix \ > unittest unittest2 >@@ -309,6 +315,12 @@ IGNORE= uses either USE_PYTHON=pytest or USE_PYTHON=pytest4, not both of them > _PYTHON_FEATURE_FLAVORS= yes > . endif > >+# build automatically generates flavors depending on the supported >+# versions. >+. if defined(_PYTHON_FEATURE_BUILD) >+_PYTHON_FEATURE_FLAVORS= yes >+. endif >+ > . if defined(_PYTHON_FEATURE_NOFLAVORS) > .undef _PYTHON_FEATURE_FLAVORS > . endif >@@ -595,6 +607,16 @@ RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}setuptools>=63.1.0:devel/py-setuptools@${P > . endif > . endif > >+. if defined(_PYTHON_FEATURE_BUILD) >+. if ${PYTHON_VER} == 2.7 >+DEV_ERROR+= "USES=python:2.7 is incompatible with USE_PYTHON=build" >+. endif >+. if ${_CURRENTPORT} == ${PYTHON_PKGNAMEPREFIX}build >+DEV_ERROR+= "USE_PYTHON=build can't be used to build py-build itself" >+. endif >+BUILD_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}build>0:devel/py-build@${PY_FLAVOR} >+. endif >+ > # distutils support > PYSETUP?= setup.py > PYDISTUTILS_SETUP?= -c \ >@@ -618,6 +640,11 @@ PYDISTUTILS_PKGVERSION?=${PORTVERSION} > PYDISTUTILS_EGGINFO?= ${PYDISTUTILS_PKGNAME:C/[^A-Za-z0-9.]+/_/g}-${PYDISTUTILS_PKGVERSION:C/[^A-Za-z0-9.]+/_/g}-py${PYTHON_VER}.egg-info > PYDISTUTILS_EGGINFODIR?=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR} > >+# build support >+. if defined(_PYTHON_FEATURE_BUILD) >+PYBUILD_WHEELNAME?= ${PORTNAME:S/-/_/} >+. endif >+ > # nose support > . if defined(_PYTHON_FEATURE_NOSE) > TEST_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}nose>=0:devel/py-nose@${PY_FLAVOR} >@@ -790,6 +817,28 @@ do-install: > . endif > . endif # defined(_PYTHON_FEATURE_DISTUTILS) > >+. if defined(_PYTHON_FEATURE_BUILD) >+. if !target(do-configure) >+do-configure: >+ @${DO_NADA} >+. endif >+ >+. if !target(do-build) >+do-build: >+ # PENDING: dependencies are mishandled by build: https://github.com/pypa/build/issues/504 >+ cd ${BUILD_WRKSRC} && ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} -m build --wheel --no-isolation --outdir ${WRKDIR} >+. endif >+ >+. if !target(do-install) >+do-install: >+ @if ! [ -e ${WRKDIR}/wheel ]; then ${MKDIR} ${WRKDIR}/wheel; fi; >+ @cd ${WRKDIR}/wheel && \ >+ unzip ${WRKDIR}/${PYBUILD_WHEELNAME}-${DISTVERSION}-*.whl && \ >+ ${MKDIR} ${STAGEDIR}${PYTHON_SITELIBDIR} && \ >+ ${CP} -r * ${STAGEDIR}${PYTHON_SITELIBDIR} >+. endif >+. endif # defined(_PYTHON_FEATURE_BUILD) >+ > . if defined(_PYTHON_FEATURE_NOSE) > . if !target(do-test) > do-test:
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 255722
:
235704
|
235732
|
235745
|
235750
|
235751