Changeset View
Changeset View
Standalone View
Standalone View
head/Mk/Uses/python.mk
Show First 20 Lines • Show All 318 Lines • ▼ Show 20 Lines | |||||
_PYTHON_RUN_DEP= yes | _PYTHON_RUN_DEP= yes | ||||
_PYTHON_TEST_DEP= yes | _PYTHON_TEST_DEP= yes | ||||
.endif | .endif | ||||
.if ${PYTHON2_DEFAULT} != ${PYTHON_DEFAULT} && ${PYTHON3_DEFAULT} != ${PYTHON_DEFAULT} | .if ${PYTHON2_DEFAULT} != ${PYTHON_DEFAULT} && ${PYTHON3_DEFAULT} != ${PYTHON_DEFAULT} | ||||
WARNING+= "PYTHON_DEFAULT must be a version present in PYTHON2_DEFAULT or PYTHON3_DEFAULT, if you want more Python flavors, set BUILD_ALL_PYTHON_FLAVORS in your make.conf" | WARNING+= "PYTHON_DEFAULT must be a version present in PYTHON2_DEFAULT or PYTHON3_DEFAULT, if you want more Python flavors, set BUILD_ALL_PYTHON_FLAVORS in your make.conf" | ||||
.endif | .endif | ||||
.if ${_PYTHON_ARGS} == "2" | .if ${_PYTHON_ARGS} == 2.7 | ||||
DEV_WARNING+= "lang/python27 reached End of Life and will be removed on 2020-12-31, consider converting to a modern version of python" | |||||
.elif ${_PYTHON_ARGS} == 2 | |||||
DEV_ERROR+= "USES=python:2 is no longer supported, use USES=python:2.7" | DEV_ERROR+= "USES=python:2 is no longer supported, use USES=python:2.7" | ||||
.elif ${_PYTHON_ARGS} == "3" | .elif ${_PYTHON_ARGS} == 3 | ||||
DEV_ERROR+= "USES=python:3 is no longer supported, use USES=python:3.5+ or an appropriate version range" | DEV_ERROR+= "USES=python:3 is no longer supported, use USES=python:3.5+ or an appropriate version range" | ||||
.endif # ${_PYTHON_ARGS} == "2" | .endif # ${_PYTHON_ARGS} == 2.7 | ||||
_PYTHON_VERSION:= ${PYTHON_DEFAULT} | _PYTHON_VERSION:= ${PYTHON_DEFAULT} | ||||
# Validate Python version whether it meets the version restriction. | # Validate Python version whether it meets the version restriction. | ||||
_PYTHON_VERSION_CHECK:= ${_PYTHON_ARGS:C/^([1-9]\.[0-9])$/\1-\1/} | _PYTHON_VERSION_CHECK:= ${_PYTHON_ARGS:C/^([1-9]\.[0-9])$/\1-\1/} | ||||
_PYTHON_VERSION_MINIMUM_TMP:= ${_PYTHON_VERSION_CHECK:C/([1-9]\.[0-9])[-+].*/\1/} | _PYTHON_VERSION_MINIMUM_TMP:= ${_PYTHON_VERSION_CHECK:C/([1-9]\.[0-9])[-+].*/\1/} | ||||
_PYTHON_VERSION_MINIMUM:= ${_PYTHON_VERSION_MINIMUM_TMP:M[1-9].[0-9]} | _PYTHON_VERSION_MINIMUM:= ${_PYTHON_VERSION_MINIMUM_TMP:M[1-9].[0-9]} | ||||
_PYTHON_VERSION_MAXIMUM_TMP:= ${_PYTHON_VERSION_CHECK:C/.*-([1-9]\.[0-9])/\1/} | _PYTHON_VERSION_MAXIMUM_TMP:= ${_PYTHON_VERSION_CHECK:C/.*-([1-9]\.[0-9])/\1/} | ||||
▲ Show 20 Lines • Show All 382 Lines • Show Last 20 Lines |