aboutsummaryrefslogtreecommitdiffstats
path: root/Mk
diff options
context:
space:
mode:
authormat <mat@FreeBSD.org>2018-01-25 20:36:54 +0800
committermat <mat@FreeBSD.org>2018-01-25 20:36:54 +0800
commitc3f34846641420270e02e4d0046d178b5fd7b18d (patch)
tree4c0a22151c7180403f507499641f9f1c0318c0e7 /Mk
parente9b859f4280f2af573ba87c3dd9e2b6c689ced57 (diff)
downloadfreebsd-ports-gnome-c3f34846641420270e02e4d0046d178b5fd7b18d.tar.gz
freebsd-ports-gnome-c3f34846641420270e02e4d0046d178b5fd7b18d.tar.zst
freebsd-ports-gnome-c3f34846641420270e02e4d0046d178b5fd7b18d.zip
Add a USES=python:patch for when Python is needed during the patch
phase. Sponsored by: Absolight
Diffstat (limited to 'Mk')
-rw-r--r--Mk/Uses/python.mk40
1 files changed, 19 insertions, 21 deletions
diff --git a/Mk/Uses/python.mk b/Mk/Uses/python.mk
index bc4bfec40d28..b655f13eecb8 100644
--- a/Mk/Uses/python.mk
+++ b/Mk/Uses/python.mk
@@ -6,7 +6,7 @@
#
# Feature: python
# Usage: USES=python or USES=python:args
-# Valid ARGS: <version>, build, run, test
+# Valid ARGS: <version>, patch, build, run, test
#
# version If your port requires only some set of Python versions, you
# can set this to [min]-[max] or min+ or -max or as an
@@ -22,6 +22,8 @@
# USES=python # Use the set default Python
# # version
#
+# patch Indicates that Python is needed at patch time and adds
+# it to PATCH_DEPENDS.
# build Indicates that Python is needed at build time and adds
# it to BUILD_DEPENDS.
# run Indicates that Python is needed at run time and adds
@@ -35,8 +37,10 @@
# PYTHON_NO_DEPENDS.
#
# If build, run and test are omitted, Python will be added as BUILD_DEPENDS,
-# RUN_DEPENDS and TEST_DEPENDS. PYTHON_NO_DEPENDS can be set to not add any
-# dependencies.
+# RUN_DEPENDS and TEST_DEPENDS.
+# patch is independant, it does not prevent the default build/run/test
+# dependency.
+# env or PYTHON_NO_DEPENDS can be set to not add any dependencies.
#
# Variables, which can be set by a user:
#
@@ -268,6 +272,10 @@ _PYTHON_FEATURE_FLAVORS= yes
.undef _PYTHON_RUN_DEP
.undef _PYTHON_TEST_DEP
_PYTHON_ARGS= ${python_ARGS:S/,/ /g}
+.if ${_PYTHON_ARGS:Mpatch}
+_PYTHON_PATCH_DEP= yes
+_PYTHON_ARGS:= ${_PYTHON_ARGS:Npatch}
+.endif
.if ${_PYTHON_ARGS:Mbuild}
_PYTHON_BUILD_DEP= yes
_PYTHON_ARGS:= ${_PYTHON_ARGS:Nbuild}
@@ -660,24 +668,14 @@ PY_FUTURES=
.endif
# dependencies
-.if defined(_PYTHON_BUILD_DEP)
-BUILD_DEPENDS+= ${PYTHON_CMD}:${PYTHON_PORTSDIR}
-.if defined(_WANTS_META_PORT)
-BUILD_DEPENDS+= python${_WANTS_META_PORT}:${_PYTHON_RELPORTDIR}${_WANTS_META_PORT}
-.endif
-.endif
-.if defined(_PYTHON_RUN_DEP)
-RUN_DEPENDS+= ${PYTHON_CMD}:${PYTHON_PORTSDIR}
-.if defined(_WANTS_META_PORT)
-RUN_DEPENDS+= python${_WANTS_META_PORT}:${_PYTHON_RELPORTDIR}${_WANTS_META_PORT}
-.endif
-.endif
-.if defined(_PYTHON_TEST_DEP)
-TEST_DEPENDS+= ${PYTHON_CMD}:${PYTHON_PORTSDIR}
-.if defined(_WANTS_META_PORT)
-TEST_DEPENDS+= python${_WANTS_META_PORT}:${_PYTHON_RELPORTDIR}${_WANTS_META_PORT}
-.endif
-.endif
+.for _stage in PATCH BUILD RUN TEST
+. if defined(_PYTHON_${_stage}_DEP)
+${_stage}_DEPENDS+= ${PYTHON_CMD}:${PYTHON_PORTSDIR}
+. if defined(_WANTS_META_PORT)
+${_stage}_DEPENDS+= python${_WANTS_META_PORT}:${_PYTHON_RELPORTDIR}${_WANTS_META_PORT}
+. endif
+. endif
+.endfor
# set $PREFIX as Python's one
.if defined(_PYTHON_FEATURE_PYTHONPREFIX)