Changeset View
Changeset View
Standalone View
Standalone View
Mk/Uses/python.mk
Show First 20 Lines • Show All 88 Lines • ▼ Show 20 Lines | |||||
# cython_run - Depend on lang/cython at run-time. | # cython_run - Depend on lang/cython at run-time. | ||||
# | # | ||||
# flavors - Force creation of flavors for Python 2 and 3 default | # flavors - Force creation of flavors for Python 2 and 3 default | ||||
# versions, where applicable. | # versions, where applicable. | ||||
# | # | ||||
# noflavors - Disable automatic creation of flavors if they would | # noflavors - Disable automatic creation of flavors if they would | ||||
# otherwise be created and they are not wanted. | # otherwise be created and they are not wanted. | ||||
# | # | ||||
# nometapkg - Disable automatic generic meta package generation. | |||||
# This is used when flavors are enabled to generate a | |||||
# py-foo meta package that always installs the default | |||||
# version. | |||||
# | |||||
# allflavors - Generate flavors for all possible versions and not | # allflavors - Generate flavors for all possible versions and not | ||||
# simply the default ones. Only to be used for py-* | # simply the default ones. Only to be used for py-* | ||||
# ports that are part of the Python distribution, but | # ports that are part of the Python distribution, but | ||||
# kept as separate ports. | # kept as separate ports. | ||||
# | # | ||||
# optsuffix - Set PKGNAMESUFFIX to PYTHON_PKGNAMESUFFIX if not the | # optsuffix - Set PKGNAMESUFFIX to PYTHON_PKGNAMESUFFIX if not the | ||||
# default python version. | # default python version. | ||||
# | # | ||||
▲ Show 20 Lines • Show All 147 Lines • ▼ Show 20 Lines | |||||
# Mk/bsd.default-versions.mk in sync. | # Mk/bsd.default-versions.mk in sync. | ||||
_PYTHON_VERSIONS= 2.7 3.7 3.8 3.6 3.5 # preferred first | _PYTHON_VERSIONS= 2.7 3.7 3.8 3.6 3.5 # preferred first | ||||
_PYTHON_PORTBRANCH= 2.7 # ${_PYTHON_VERSIONS:[1]} | _PYTHON_PORTBRANCH= 2.7 # ${_PYTHON_VERSIONS:[1]} | ||||
_PYTHON_BASECMD= ${LOCALBASE}/bin/python | _PYTHON_BASECMD= ${LOCALBASE}/bin/python | ||||
_PYTHON_RELPORTDIR= lang/python | _PYTHON_RELPORTDIR= lang/python | ||||
# List all valid USE_PYTHON features here | # List all valid USE_PYTHON features here | ||||
_VALID_PYTHON_FEATURES= allflavors autoplist concurrent cython cython_run \ | _VALID_PYTHON_FEATURES= allflavors autoplist concurrent cython cython_run \ | ||||
distutils flavors noegginfo noflavors optsuffix \ | distutils flavors noegginfo noflavors nometapkg \ | ||||
py3kplist pythonprefix | optsuffix py3kplist pythonprefix | ||||
_INVALID_PYTHON_FEATURES= | _INVALID_PYTHON_FEATURES= | ||||
.for var in ${USE_PYTHON} | .for var in ${USE_PYTHON} | ||||
. if empty(_VALID_PYTHON_FEATURES:M${var}) | . if empty(_VALID_PYTHON_FEATURES:M${var}) | ||||
_INVALID_PYTHON_FEATURES+= ${var} | _INVALID_PYTHON_FEATURES+= ${var} | ||||
. endif | . endif | ||||
.endfor | .endfor | ||||
.if !empty(_INVALID_PYTHON_FEATURES) | .if !empty(_INVALID_PYTHON_FEATURES) | ||||
IGNORE= uses unknown USE_PYTHON features: ${_INVALID_PYTHON_FEATURES} | IGNORE= uses unknown USE_PYTHON features: ${_INVALID_PYTHON_FEATURES} | ||||
▲ Show 20 Lines • Show All 232 Lines • ▼ Show 20 Lines | |||||
# | # | ||||
.if defined(_PYTHON_FEATURE_CYTHON) | .if defined(_PYTHON_FEATURE_CYTHON) | ||||
BUILD_DEPENDS+= cython-${PYTHON_VER}:lang/cython@${PY_FLAVOR} | BUILD_DEPENDS+= cython-${PYTHON_VER}:lang/cython@${PY_FLAVOR} | ||||
.endif | .endif | ||||
.if defined(_PYTHON_FEATURE_CYTHON_RUN) | .if defined(_PYTHON_FEATURE_CYTHON_RUN) | ||||
RUN_DEPENDS+= cython-${PYTHON_VER}:lang/cython@${PY_FLAVOR} | RUN_DEPENDS+= cython-${PYTHON_VER}:lang/cython@${PY_FLAVOR} | ||||
.endif | |||||
# So: | |||||
# - we are doing flavors | |||||
# - we want the metapkg | |||||
# - we are doing the default flavor | |||||
# - our PKGNAMEPREFIX matches PYTHON_PKGNAMEPREFIX | |||||
.if defined(_PYTHON_FEATURE_FLAVORS) && \ | |||||
!defined(_PYTHON_FEATURE_NOMETAPKG) && \ | |||||
${FLAVOR} == ${FLAVORS:[1]} && \ | |||||
!empty(PKGNAMEPREFIX:M${PYTHON_PKGNAMEPREFIX}*) | |||||
SUBPACKAGES+= py_meta | |||||
_PKGS.py_meta= ${PKGBASE:S/${PYTHON_PKGNAMEPREFIX}/py-/} | |||||
DESCR.py_meta= ${DESCR} | |||||
SELF_DEPENDS.py_meta= main | |||||
COMMENT.py_meta= ${COMMENT} (default version) | |||||
.endif | .endif | ||||
.if defined(_PYTHON_FEATURE_CONCURRENT) | .if defined(_PYTHON_FEATURE_CONCURRENT) | ||||
.if !defined(_PYTHON_FEATURE_FLAVORS) && (${_PYTHON_VERSION_MINIMUM:M3*} || ${_PYTHON_VERSION_MAXIMUM:M2*}) | .if !defined(_PYTHON_FEATURE_FLAVORS) && (${_PYTHON_VERSION_MINIMUM:M3*} || ${_PYTHON_VERSION_MAXIMUM:M2*}) | ||||
DEV_WARNING+= "USE_PYTHON=concurrent when only one of Python 2 or 3 is supported AND not using flavors does not make any sense" | DEV_WARNING+= "USE_PYTHON=concurrent when only one of Python 2 or 3 is supported AND not using flavors does not make any sense" | ||||
.endif | .endif | ||||
_USES_POST+= uniquefiles:dirs | _USES_POST+= uniquefiles:dirs | ||||
.if defined(_PYTHON_FEATURE_FLAVORS) && ${FLAVOR} == ${FLAVORS:[1]} | .if defined(_PYTHON_FEATURE_FLAVORS) && ${FLAVOR} == ${FLAVORS:[1]} | ||||
▲ Show 20 Lines • Show All 204 Lines • Show Last 20 Lines |