aboutsummaryrefslogtreecommitdiff
path: root/Mk/bsd.port.mk
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2019-09-03 14:36:00 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2019-09-03 14:36:00 +0000
commit7610a280b57ed2313f506799bf8afe39d74482a2 (patch)
tree74477210536a9532c246622b0b4fabbb456310d8 /Mk/bsd.port.mk
parentb425021f226d8509a5261cfa28460626d6c17399 (diff)
downloadports-7610a280b57ed2313f506799bf8afe39d74482a2.tar.gz
ports-7610a280b57ed2313f506799bf8afe39d74482a2.zip
Add support for overlays
overlays are a way to help users to integrate their own ports tree with the official ports tree without having to maintain clone of the official tree and remerge on regular basis. The ports tree will lookup in the overlays (in the order the are listed in OVERLAY variable) for the dependencies and the USES. It will use the first found. in order to use it the user have to declare his overlays that way in their make.conf: OVERLAYS= overlay1 overlay2 overlay3 Reviewed by: manu Approved by: swills Differential Revision: https://reviews.freebsd.org/D21468
Notes
Notes: svn path=/head/; revision=510950
Diffstat (limited to 'Mk/bsd.port.mk')
-rw-r--r--Mk/bsd.port.mk27
1 files changed, 25 insertions, 2 deletions
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index b6d630ead0b5..fb88ab5614d4 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -1029,6 +1029,7 @@ STAGEDIR?= ${WRKDIR}/stage
NOTPHONY?=
FLAVORS?=
FLAVOR?=
+OVERLAYS?=
# Disallow forced FLAVOR as make argument since we cannot change it to the
# proper default.
.if empty(FLAVOR) && !empty(.MAKEOVERRIDES:MFLAVOR)
@@ -1450,7 +1451,17 @@ ${_f}_ARGS:= ${f:C/^[^\:]*(\:|\$)//:S/,/ /g}
.endif
.endfor
.for f in ${USES}
-.include "${USESDIR}/${f:C/\:.*//}.mk"
+.undef _usefound
+.for udir in ${OVERLAYS:C,$,/Mk/Uses,} ${USESDIR}
+_usefile= ${udir}/${f:C/\:.*//}.mk
+.if exists(${_usefile}) && !defined(_usefound)
+_usefound=
+.include "${_usefile}"
+.endif
+.endfor
+.if !defined(_usefound)
+ERROR+= "Unkonwn USES=${f:C/\:.*//}"
+.endif
.endfor
.if !empty(FLAVORS)
@@ -1962,7 +1973,17 @@ ${_f}_ARGS:= ${f:C/^[^\:]*(\:|\$)//:S/,/ /g}
.endif
.endfor
.for f in ${_USES_POST}
-.include "${USESDIR}/${f:C/\:.*//}.mk"
+.undef _usefound
+.for udir in ${OVERLAYS:C,$,/Mk/Uses,} ${USESDIR}
+_usefile= ${udir}/${f:C/\:.*//}.mk
+.if exists(${_usefile}) && !defined(_usefound)
+_usefound=
+.include "${_usefile}"
+.endif
+.endfor
+.if !defined(_usefound)
+ERROR+= "Unkonwn USES=${f:C/\:.*//}"
+.endif
.endfor
.if defined(PORTNAME)
@@ -3964,6 +3985,7 @@ ${deptype:tl}-depends:
dp_SH="${SH}" \
dp_SCRIPTSDIR="${SCRIPTSDIR}" \
PORTSDIR="${PORTSDIR}" \
+ dp_OVERLAYS="${OVERLAYS}" \
dp_MAKE="${MAKE}" \
dp_MAKEFLAGS='${.MAKEFLAGS}' \
${SH} ${SCRIPTSDIR}/do-depends.sh
@@ -4018,6 +4040,7 @@ DEPENDS-LIST= \
dp_PKGNAME="${PKGNAME}" \
dp_PKG_INFO="${PKG_INFO}" \
dp_SCRIPTSDIR="${SCRIPTSDIR}" \
+ dp_OVERLAYS="${OVERLAYS}" \
${SH} ${SCRIPTSDIR}/depends-list.sh \
${DEPENDS_SHOW_FLAVOR:D-f}