| 6 |
# |
# |
| 7 |
# Feature: python |
# Feature: python |
| 8 |
# Usage: USES=python or USES=python:args |
# Usage: USES=python or USES=python:args |
| 9 |
# Valid ARGS: <version>, build, run |
# Valid ARGS: <version>, build, run, test |
| 10 |
# |
# |
| 11 |
# version If your port requires only some set of Python versions, you |
# version If your port requires only some set of Python versions, you |
| 12 |
# can set this to [min]-[max] or min+ or -max or as an |
# can set this to [min]-[max] or min+ or -max or as an |
| 23 |
# # version |
# # version |
| 24 |
# |
# |
| 25 |
# build Indicates that Python is needed at build time and adds |
# build Indicates that Python is needed at build time and adds |
| 26 |
# it as BUILD_DEPENDS. |
# it to BUILD_DEPENDS. |
| 27 |
# run Indicates that Python is needed at run time and adds |
# run Indicates that Python is needed at run time and adds |
| 28 |
# it as RUN_DEPENDS. |
# it to RUN_DEPENDS. |
| 29 |
# |
# test Indicates that Python is needed at test time and adds |
| 30 |
# If build and run are omitted, Python will be added as BUILD_DEPENDS and |
# it to TEST_DEPENDS. |
| 31 |
# RUN_DEPENDS. PYTHON_NO_DEPENDS can be set to not add any dependencies. |
# |
| 32 |
|
# If build, run and test are omitted, Python will be added as BUILD_DEPENDS, |
| 33 |
|
# RUN_DEPENDS and TEST_DEPENDS. PYTHON_NO_DEPENDS can be set to not add any |
| 34 |
|
# dependencies. |
| 35 |
# |
# |
| 36 |
# Variables, which can be set by a user: |
# Variables, which can be set by a user: |
| 37 |
# |
# |
| 234 |
# pollutes the build/run dependency detection |
# pollutes the build/run dependency detection |
| 235 |
.undef _PYTHON_BUILD_DEP |
.undef _PYTHON_BUILD_DEP |
| 236 |
.undef _PYTHON_RUN_DEP |
.undef _PYTHON_RUN_DEP |
| 237 |
|
.undef _PYTHON_TEST_DEP |
| 238 |
_PYTHON_ARGS= ${python_ARGS:S/,/ /g} |
_PYTHON_ARGS= ${python_ARGS:S/,/ /g} |
| 239 |
.if ${_PYTHON_ARGS:Mbuild} |
.if ${_PYTHON_ARGS:Mbuild} |
| 240 |
_PYTHON_BUILD_DEP= yes |
_PYTHON_BUILD_DEP= yes |
| 244 |
_PYTHON_RUN_DEP= yes |
_PYTHON_RUN_DEP= yes |
| 245 |
_PYTHON_ARGS:= ${_PYTHON_ARGS:Nrun} |
_PYTHON_ARGS:= ${_PYTHON_ARGS:Nrun} |
| 246 |
.endif |
.endif |
| 247 |
|
.if ${_PYTHON_ARGS:Mtest} |
| 248 |
|
_PYTHON_TEST_DEP= yes |
| 249 |
|
_PYTHON_ARGS:= ${_PYTHON_ARGS:Ntest} |
| 250 |
|
.endif |
| 251 |
|
|
| 252 |
# The port does not specify a build or run dependency, assume both are |
# The port does not specify a build, run or test dependency, assume all are |
| 253 |
# required. |
# required. |
| 254 |
.if !defined(_PYTHON_BUILD_DEP) && !defined(_PYTHON_RUN_DEP) && \ |
.if !defined(_PYTHON_BUILD_DEP) && !defined(_PYTHON_RUN_DEP) && \ |
| 255 |
!defined(PYTHON_NO_DEPENDS) |
!defined(_PYTHON_TEST_DEP) && !defined(PYTHON_NO_DEPENDS) |
| 256 |
_PYTHON_BUILD_DEP= yes |
_PYTHON_BUILD_DEP= yes |
| 257 |
_PYTHON_RUN_DEP= yes |
_PYTHON_RUN_DEP= yes |
| 258 |
|
_PYTHON_TEST_DEP= yes |
| 259 |
.endif |
.endif |
| 260 |
|
|
| 261 |
# Determine version number of Python to use |
# Determine version number of Python to use |
| 570 |
RUN_DEPENDS+= python${_WANTS_META_PORT}:${_PYTHON_RELPORTDIR}${_WANTS_META_PORT} |
RUN_DEPENDS+= python${_WANTS_META_PORT}:${_PYTHON_RELPORTDIR}${_WANTS_META_PORT} |
| 571 |
.endif |
.endif |
| 572 |
.endif |
.endif |
| 573 |
|
.if defined(_PYTHON_TEST_DEP) |
| 574 |
|
TEST_DEPENDS+= ${PYTHON_CMD}:${PYTHON_PORTSDIR} |
| 575 |
|
.if defined(_WANTS_META_PORT) |
| 576 |
|
TEST_DEPENDS+= python${_WANTS_META_PORT}:${_PYTHON_RELPORTDIR}${_WANTS_META_PORT} |
| 577 |
|
.endif |
| 578 |
|
.endif |
| 579 |
|
|
| 580 |
# set $PREFIX as Python's one |
# set $PREFIX as Python's one |
| 581 |
.if defined(_PYTHON_FEATURE_PYTHONPREFIX) |
.if defined(_PYTHON_FEATURE_PYTHONPREFIX) |