From owner-svn-ports-all@freebsd.org Thu Nov 30 15:33:47 2017 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C18EAE5EABA; Thu, 30 Nov 2017 15:33:47 +0000 (UTC) (envelope-from mat@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9BB9568A3F; Thu, 30 Nov 2017 15:33:47 +0000 (UTC) (envelope-from mat@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vAUFXkWW067163; Thu, 30 Nov 2017 15:33:46 GMT (envelope-from mat@FreeBSD.org) Received: (from mat@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vAUFXkom067161; Thu, 30 Nov 2017 15:33:46 GMT (envelope-from mat@FreeBSD.org) Message-Id: <201711301533.vAUFXkom067161@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mat set sender to mat@FreeBSD.org using -f From: Mathieu Arnold Date: Thu, 30 Nov 2017 15:33:46 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r455206 - in head: . Mk X-SVN-Group: ports-head X-SVN-Commit-Author: mat X-SVN-Commit-Paths: in head: . Mk X-SVN-Commit-Revision: 455206 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Nov 2017 15:33:47 -0000 Author: mat Date: Thu Nov 30 15:33:46 2017 New Revision: 455206 URL: https://svnweb.freebsd.org/changeset/ports/455206 Log: Add various FLAVOR related helpers. To help with flavored ports, helpers are available. In these, replace <*> with the flavor name. *_PKGNAMEPREFIX *_PKGNAMESUFFIX *_PLIST *_DESCR will overwrite the variable. *_CONFLICTS *_CONFLICTS_BUILD *_CONFLICTS_INSTALL *_PKG_DEPENDS *_EXTRACT_DEPENDS *_PATCH_DEPENDS *_FETCH_DEPENDS *_BUILD_DEPENDS *_LIB_DEPENDS *_RUN_DEPENDS *_TEST_DEPENDS will append to the variable. Reviewed by: portmgr Sponsored by: Absolight Differential Revision: https://reviews.freebsd.org/D12483 Modified: head/CHANGES head/Mk/bsd.port.mk (contents, props changed) Modified: head/CHANGES ============================================================================== --- head/CHANGES Thu Nov 30 15:33:29 2017 (r455205) +++ head/CHANGES Thu Nov 30 15:33:46 2017 (r455206) @@ -13,6 +13,28 @@ All ports committers are allowed to commit to this fil 20171130: AUTHOR: mat@FreeBSD.org + To help with flavored ports, helpers are available. In these, replace <*> + with the flavor name. + + *_PKGNAMEPREFIX *_PKGNAMESUFFIX *_PLIST *_DESCR will overwrite the variable. + + *_CONFLICTS *_CONFLICTS_BUILD *_CONFLICTS_INSTALL *_PKG_DEPENDS + *_EXTRACT_DEPENDS *_PATCH_DEPENDS *_FETCH_DEPENDS *_BUILD_DEPENDS + *_LIB_DEPENDS *_RUN_DEPENDS *_TEST_DEPENDS will append to the variable. + + For example: + + flavor2_PKGNAMESUFFIX= -foo + + can replace: + + .if ${FLAVOR:U} == flavor2 + PKGNAMESUFFIX= -foo + .endif + +20171130: +AUTHOR: mat@FreeBSD.org + Flavors are a way to have multiple variations of a port. The port is built multiple times, with the variations. To declare flavors, set the FLAVORS variable to the flavors you want defined. The first flavor will be the Modified: head/Mk/bsd.port.mk ============================================================================== --- head/Mk/bsd.port.mk Thu Nov 30 15:33:29 2017 (r455205) +++ head/Mk/bsd.port.mk Thu Nov 30 15:33:46 2017 (r455206) @@ -1084,6 +1084,34 @@ _PORTS_DIRECTORIES+= ${PKG_DBDIR} ${PREFIX} ${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