From nobody Tue Jul 11 22:08:32 2023 X-Original-To: dev-commits-ports-all@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 4R0w4J5T6Kz4lR8v; Tue, 11 Jul 2023 22:08:32 +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 4R0w4J44KRz4GKc; Tue, 11 Jul 2023 22:08:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689113312; 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=Unu/gNXd4YggIUQjRVamaAwnD4mDKALD8hnsvnSA0JE=; b=i1G2jZqYOH6qzMiOu88+MzTNr4MUeuqhki5tvkGko+8XOlFFFx4+cGUUSiYcB+oGRpHyav doYSryF9SbnDtAQ0frE6QM946mS4xcoS/KXyFb2FgmfNEC4gcACpDFS9rNiFXXADb7srXc Gy1XNTYe2var7jT50qI2ertF9ylmQy9uc1LgtCj+oKRvVI0HHDBPWrQdfp+A5DzeZFsSFl UtqpEBOXTVBJ7YE3g5gxkx2pGRlRM2nsYcNmpeotXJUPJgKCBAD1wEdpnhYk7LW0ERHEgr d/czc7sOOv/mjPwOwufdg2PURZWiVJ82qY4QsRI+tH0gzi6QTNKqKz4fENhPbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689113312; 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=Unu/gNXd4YggIUQjRVamaAwnD4mDKALD8hnsvnSA0JE=; b=uJ2CnaKeAteNEIscHaAC4wxthIYPOUvwWcbBTINeB0XeJ8W+HLwd5MuromQdYYnFNmLQUg hKlhTCfSIBbz3jsnU+P5JRrFU7bXH04eQhg26uOabSnO38FWVl+Md/ujXjjgeCBFc/+vlk wEiAdtGxsyRUNtLDPx9TIZ+vGxwpspSb8nu8e4ziG1fPSMoPoBxxMtxcWgoCPpA8P8Csfr Qb5/WVKjRdpsuPzS6zzJXo5FIoDQvhv1Sk9B56478o0qzzRhxz38yhbSIGZQBE5vqiBPPT B1smEpcz7gyK+0Z6XowFGQ7n9BeUzDpkhQ9q5BeRwD4qZTTnAOHp4zDBD/J1Ig== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689113312; a=rsa-sha256; cv=none; b=T7l4J7KFgZjaHfsX8J0ThFBm3C+vB8u8r5GJNstk/vPldJ3qTHNPgDTlw4HUL85yLk4NK1 wRAS9Bd+kkeSOQtEqmp3mEjdOszPKpVlvss8we6LEHhospSGyhr/0eeuE4+ju7yd2h+vkI EKqfFrRoxuYhlUcKvIhMJbH3BcIE3np7RtVpdct3+v7UcD+Hk8e731KhUTFrhN0pzri/Y9 ErpF/Oc1MwW/oU9LwMTWXXPvABWeTIFNZqKwAZ2FPpXYxIyxW9z5NnPxX7We8h5wknzUDM yJgy5ShXIF0upBxYs5lTWfk//wyCjKAWjNYND1w65vbW+SohzrwpSljini03PA== 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 4R0w4J2znfzk2r; Tue, 11 Jul 2023 22:08:32 +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 36BM8WfQ004788; Tue, 11 Jul 2023 22:08:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36BM8WrG004787; Tue, 11 Jul 2023 22:08:32 GMT (envelope-from git) Date: Tue, 11 Jul 2023 22:08:32 GMT Message-Id: <202307112208.36BM8WrG004787@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Robert Clausecker Subject: git: f685268e17b6 - main - Mk/bsd.port.mk: Allow category_port_VARS= in make.conf for arbitrary per-port overrides. List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f685268e17b60e84024b0c7378b459c82ea1ee57 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by fuz: URL: https://cgit.FreeBSD.org/ports/commit/?id=f685268e17b60e84024b0c7378b459c82ea1ee57 commit f685268e17b60e84024b0c7378b459c82ea1ee57 Author: Andrew Gierth AuthorDate: 2023-07-11 07:44:53 +0000 Commit: Robert Clausecker CommitDate: 2023-07-11 22:04:07 +0000 Mk/bsd.port.mk: Allow category_port_VARS= in make.conf for arbitrary per-port overrides. Currently the only way to specify make.conf variables (other than port options which have their own mechanism) in a per-port fashion is to use conditionals on .CURDIR, which is fragile since it tends to involve assumptions about where the ports tree is mounted. Instead, allow category_portname_VARS= to be set in make.conf to provide arbitrary assignments when building a specified port. For example one might use devel_llvm10_VARS= MAKE_JOBS_NUMBER=2 or converters_lua-iconv_VARS= TRYBROKEN=yes This is intended to be consistent with the existing category_portname_SET= variables for port options, and uses the same syntax for values as option_VARS= in port makefiles, but without the case-folding behavior since that makes it impossible to handle mixed-case or lowercase variable names. Reviewed by: koobs, mat, adamw, mandree, 0mp Approved by: portmgr (bapt) Differential Revision: https://reviews.freebsd.org/D24324 VAR+=val can be used to append to a variable, and VAR@ to unset one entirely. --- Mk/bsd.port.mk | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk index 703a8541e383..e35313491bcb 100644 --- a/Mk/bsd.port.mk +++ b/Mk/bsd.port.mk @@ -1283,6 +1283,23 @@ _PORTDIRNAME= ${.CURDIR:T} PORTDIRNAME?= ${_PORTDIRNAME} PKGORIGIN?= ${PKGCATEGORY}/${PORTDIRNAME} +# Now that PKGORIGIN is set, look for origin-specific variables. +# These are typically set in a make.conf, in the form: +# +# category_portname_VARS= varname=value othervar+=value novar@ +# +# e.g. devel_llvm10_VARS= MAKE_JOBS_NUMBER=2 + +. for var in ${${PKGORIGIN:S/\//_/}_VARS:C/=.*//:O:u} +. if ${var:M*@} +. undef ${var:C/.$//} +. elif ${var:M*+} +${var:C/.$//}+= ${${PKGORIGIN:S/\//_/}_VARS:M${var}=*:C/[^+]*\+=//:C/^"(.*)"$$/\1/} +. else +${var}= ${${PKGORIGIN:S/\//_/}_VARS:M${var}=*:C/[^=]*=//:C/^"(.*)"$$/\1/} +. endif +. endfor + # where 'make config' records user configuration options PORT_DBDIR?= /var/db/ports