From nobody Tue Apr 16 17:17:43 2024 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VJrMW3GpGz5HCfC; Tue, 16 Apr 2024 17:17:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VJrMW2mVRz4c1F; Tue, 16 Apr 2024 17:17:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713287863; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U5Vvz/t+VgJ3N1MD91KzB3eqsvjh5nbjKw1KO1uQo6w=; b=wZNy15IfqyFOOt+jWD8EQdz/ElPbmbNdxZgvYQZUZhF51339hSrlQF/MU7xiNZq26jHAEQ 9oYQLNbsHLFGlR6YQHhg44CHQ/ipHaHBdD5XIejC5ePpXmcFpVKsKIy42BwtQJ2OyytOtg o+6TXpnXrfeC5dGArGcwOB6DHSC4ZjG7uCsLD4S3XDDdHXm5S0Y+N9GtpEZzAktyurDatK edJftvCEdFAik0Ci/pt6Zi7nYe/TDUhIsw8HoOFfaJcjTcC8r5yo8zYYBBjH7Xx+dmULZW t8qduVQUXALZwqcV/PpGaeW5/m84kCZW/J0QGMjwchWlmt14WbHjymG/UyUMxA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713287863; a=rsa-sha256; cv=none; b=nmpJIZ2KRv4TSdMojGNc8fByQSd7OB/cCBmJr0sDOnCwfeHUflBz6dK1actS8scbVEgCFr q6L0tt1oXy9EUZ8Mw3yGuotGMOQbDmlhTjTowW6DCWzmfs6qvxf0V6OAXVt7byswwiDKHr QDWyGJt14vXN8rGZ4sNjGB4KdZc9G1H9z+CsfvR4vMzEEMcJaTSExH5xl23b6xrE2fKJmO Y1KTxe4VuDgZOXkgTfUGUOLkvDfqaAGv1y//tupdu8c4EH5lnlX8ltE/T9W7NiuZWC+Ql4 bFHHlIYmsSiNARiXw2a8uOKEmjj1Kmwkl6DsWJDVENn//js9kvMSzLdEb3uLFw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713287863; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=U5Vvz/t+VgJ3N1MD91KzB3eqsvjh5nbjKw1KO1uQo6w=; b=urlWNNjWNm9Rk11iMmgqeojf0MQI3b+1pSnCqGGGKn6cgLxotsic/Qnr0rYpV+BYW2xCpj ep7IVHMZOleG5cqGmADtip1uxHZFdq9Dr9OsfVcC3PxYXPGYd3BrGoDp1au/TkdEy6Tl+i DGml7I47rruBzOj5cUTJk+N8mxkIM2QpX9fbwHxhjr6sPbUqqtfsjdPYNhvnKpv1wc4nY2 QybzK0DCCtmdIVAuhLiEZZAm8rj4caAEemePemxFXMmGJtDWIqVm7qq7Wq6J8/oAER8HBx uqr1W6AFgaJSgEw90kvhMuw1NZhuZjiHpBxCeaxW7LRQbcsTdoL/igQ738Hr9Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VJrMW24tPzs9Q; Tue, 16 Apr 2024 17:17:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43GHHhtf031126; Tue, 16 Apr 2024 17:17:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43GHHhjo031123; Tue, 16 Apr 2024 17:17:43 GMT (envelope-from git) Date: Tue, 16 Apr 2024 17:17:43 GMT Message-Id: <202404161717.43GHHhjo031123@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Mathieu Arnold Subject: git: 06606280dd4e - main - Mk/bsd.port.mk: simplify WITH_ code List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-main@freebsd.org Sender: owner-dev-commits-ports-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mat X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 06606280dd4e2fd08da8e0cb3080577cf03c70a7 Auto-Submitted: auto-generated The branch main has been updated by mat: URL: https://cgit.FreeBSD.org/ports/commit/?id=06606280dd4e2fd08da8e0cb3080577cf03c70a7 commit 06606280dd4e2fd08da8e0cb3080577cf03c70a7 Author: Mathieu Arnold AuthorDate: 2024-04-16 17:16:20 +0000 Commit: Mathieu Arnold CommitDate: 2024-04-16 17:16:20 +0000 Mk/bsd.port.mk: simplify WITH_ code Differential Revision: https://reviews.freebsd.org/D44793 --- Mk/bsd.port.mk | 42 ++++++++++-------------------------------- 1 file changed, 10 insertions(+), 32 deletions(-) diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk index f396d4ee4eec..8e13aa4f9b24 100644 --- a/Mk/bsd.port.mk +++ b/Mk/bsd.port.mk @@ -1324,45 +1324,23 @@ LDCONFIG32_DIR= libdata/ldconfig32 TMPDIR?= /tmp . endif # defined(PACKAGE_BUILDING) -# If user specified WITH_FEATURE=yes for a feature that is disabled by default -# treat it as enabled by default -. for feature in ${_LIST_OF_WITH_FEATURES} -. if ${_DEFAULT_WITH_FEATURES:N${feature}} && defined(WITH_${feature:tu}) -_DEFAULT_WITH_FEATURES+= ${feature} +# Enable default features unless they have been disabled by the user, and cleanup +. for feature in ${_DEFAULT_WITH_FEATURES} +. if !defined(WITHOUT_${feature:tu}) +WITH_${feature:tu}= yes +.undef WITHOUT_${feature:tu} . endif . endfor -. for feature in ${_LIST_OF_WITH_FEATURES} -# Create _{WITH,WITHOUT}_FEATURE vars based on user-provided {WITH,WITHOUT}_FEATURE -# Test WITHOUT_* first to make sure a port can disable the feature -. if defined(WITHOUT_${feature:tu}) -_WITHOUT_${feature:tu}= ${WITHOUT_${feature:tu}} -. elif defined(WITH_${feature:tu}) -_WITH_${feature:tu}= ${WITH_${feature:tu}} -. endif # For each Feature we support, process the # WITH_FEATURE_PORTS and WITHOUT_FEATURE_PORTS variables -. if ${_DEFAULT_WITH_FEATURES:M${feature}} -. if defined(WITHOUT_${feature:tu}_PORTS) && ${WITHOUT_${feature:tu}_PORTS:M${PKGORIGIN}} -_WITHOUT_${feature:tu}= yes -.undef _WITH_${feature:tu} -. endif -. else -. if defined(WITH_${feature:tu}_PORTS) && ${WITH_${feature:tu}_PORTS:M${PKGORIGIN}} -_WITH_${feature:tu}= yes -.undef _WITHOUT_${feature:tu} -. endif -. endif -. endfor - -# Now we made sure the features are either on or off, let's put them back in -# the WITH_* variable. From now on, we only need to test defined(WITH_*) or -# !defined(WITH_*) . for feature in ${_LIST_OF_WITH_FEATURES} -. if defined(_WITH_${feature:tu}) -WITH_${feature:tu}= _WITH_${feature:tu} -. else +. if defined(WITHOUT_${feature:tu}_PORTS) && ${WITHOUT_${feature:tu}_PORTS:M${PKGORIGIN}} +# Feature disabled for this port, remove WITH_ .undef WITH_${feature:tu} +. elif defined(WITH_${feature:tu}_PORTS) && ${WITH_${feature:tu}_PORTS:M${PKGORIGIN}} +# Feature enabled for this port, set WITH_ +WITH_${feature:tu}= yes . endif . endfor