From c17c2d109b499bf313f94cff6cad31775c6bde6b Mon Sep 17 00:00:00 2001 From: bdrewery Date: Mon, 8 Jan 2018 00:24:48 +0000 Subject: Fix flavor helpers when only bsd.port.pre.mk is not used and FLAVOR is not set. The helpers were being evaluated before the default FLAVOR was set. The helpers worked fine if the FLAVOR was specified by the user but not if it was left to the default value. Resolve this by moving the helpers right after the default FLAVOR is set. PR: 224879 exp-run by: antoine Approved by: portmgr (implicit) MFH: 2018Q1 Differential Revision: https://reviews.freebsd.org/D13756 --- Mk/bsd.port.mk | 57 +++++++++++++++++++++++++++++---------------------------- 1 file changed, 29 insertions(+), 28 deletions(-) (limited to 'Mk') diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk index 0b150f2df832..7d9702b4ed82 100644 --- a/Mk/bsd.port.mk +++ b/Mk/bsd.port.mk @@ -1089,34 +1089,6 @@ _PORTS_DIRECTORIES+= ${PKG_DBDIR} ${PREFIX} ${WRKDIR} ${EXTRACT_WRKDIR} \ # Do not leak flavors to childs make .MAKEOVERRIDES:= ${.MAKEOVERRIDES:NFLAVOR} -.if !empty(FLAVOR) && !defined(_DID_FLAVORS_HELPERS) -_DID_FLAVORS_HELPERS= yes -_FLAVOR_HELPERS_OVERRIDE= DESCR PLIST PKGNAMEPREFIX PKGNAMESUFFIX -_FLAVOR_HELPERS_APPEND= CONFLICTS CONFLICTS_BUILD CONFLICTS_INSTALL \ - PKG_DEPENDS EXTRACT_DEPENDS PATCH_DEPENDS \ - FETCH_DEPENDS BUILD_DEPENDS LIB_DEPENDS \ - RUN_DEPENDS TEST_DEPENDS -# These overwrite the current value -.for v in ${_FLAVOR_HELPERS_OVERRIDE} -.if defined(${FLAVOR}_${v}) -${v}= ${${FLAVOR}_${v}} -.endif -.endfor - -# These append to the current value -.for v in ${_FLAVOR_HELPERS_APPEND} -.if defined(${FLAVOR}_${v}) -${v}+= ${${FLAVOR}_${v}} -.endif -.endfor - -.for v in BROKEN IGNORE -.if defined(${FLAVOR}_${v}) -${v}= flavor "${FLAVOR}" ${${FLAVOR}_${v}} -.endif -.endfor -.endif # defined(${FLAVOR}) - .if defined(CROSS_TOOLCHAIN) .if !defined(CROSS_SYSROOT) IGNORE= CROSS_SYSROOT should be defined @@ -1516,6 +1488,35 @@ IGNORE= Unknown flavor '${FLAVOR}', possible flavors: ${FLAVORS}. FLAVOR= ${FLAVORS:[1]} .endif +.if !empty(FLAVOR) && !defined(_DID_FLAVORS_HELPERS) +_DID_FLAVORS_HELPERS= yes +_FLAVOR_HELPERS_OVERRIDE= DESCR PLIST PKGNAMEPREFIX PKGNAMESUFFIX +_FLAVOR_HELPERS_APPEND= CONFLICTS CONFLICTS_BUILD CONFLICTS_INSTALL \ + PKG_DEPENDS EXTRACT_DEPENDS PATCH_DEPENDS \ + FETCH_DEPENDS BUILD_DEPENDS LIB_DEPENDS \ + RUN_DEPENDS TEST_DEPENDS +# These overwrite the current value +.for v in ${_FLAVOR_HELPERS_OVERRIDE} +.if defined(${FLAVOR}_${v}) +${v}= ${${FLAVOR}_${v}} +.endif +.endfor + +# These append to the current value +.for v in ${_FLAVOR_HELPERS_APPEND} +.if defined(${FLAVOR}_${v}) +${v}+= ${${FLAVOR}_${v}} +.endif +.endfor + +.for v in BROKEN IGNORE +.if defined(${FLAVOR}_${v}) +${v}= flavor "${FLAVOR}" ${${FLAVOR}_${v}} +.endif +.endfor +.endif # defined(${FLAVOR}) + + EXTRACT_SUFX?= .tar.gz .if defined(USE_LINUX_PREFIX) -- cgit