From nobody Sat Jul 22 07:48:42 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 4R7JT63vn6z4nywk; Sat, 22 Jul 2023 07:48:42 +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 4R7JT62JGSz3mlr; Sat, 22 Jul 2023 07:48:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690012122; 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=hSLGiMC95VY6v+8qpId6N9BiTsfwpQovFmbVco0pRNk=; b=sPqLRQrAvyFhD6/5Wp2f34AuPbhi9XERwm2kJubE0NULZGTkT/WNIvlsiMr+kyM3hKLZ4W EgJJjMTwu1ecYG7GgkDMLeKiwcYhrmth/p/+dXTcKbGXSu3tggBdghlwoE8RNS784QHfZV RUCC4eQbeQQFqC/7JxDXZG3l0zEa8phbfq9pZyyHVgq02VuX6AfHulGouAxszbXCk0jOSy egtxsHrERq/D6fHbPJ8801Kf8w3Gs5q69G1b8ZDc+8V0ValxmCgMZjqXDFc9pJd6ALry5s qXgPRO1rBRia6+UWZgI0s7vdMrGSJnuy3dtvZutNgnHJcMEKkQ3OerGevGzbUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690012122; 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=hSLGiMC95VY6v+8qpId6N9BiTsfwpQovFmbVco0pRNk=; b=ySqvDyyDbu6RUH1M87C19BZQXkZcMzjtwD7WVSLgpKKAfzQU8dIOqpWFhFECCLYp3MIaZ9 5oe6CF+CXK3eokNn1AFZK8NP5gnox5WsyJ8A4NRfoAFShi36MNNgETbZuH0CwNfgszcYH1 ohT8R8kPD9hHntPIL/Bewr8viDK0cMgg3ZBeSAmBPXyszQytZA+2s0OXoFcTaznkR3GYfk kOz2lwWnIP+lhrevK+Be6Rrg7xt6dAckyJz9+pdPpujhhQSJMJvug1eGRnlCTrGmAdstcz wwUQ6QPRaBqNaXWcu06l0qLAUtwedQa7hiJR8sf7U/zLtKVYiAYBRxfB+Py0Yg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690012122; a=rsa-sha256; cv=none; b=x7z/2a0KgiS2tSMSGgyKNugnuP0OC8mn6FG4IgIpLGEzVBpqc0VWXGaJqENJnPEOPWqyqh 3MgsiAKJAUbi4VJYR30CpYmDJQrFca7xga4WuS9BxKw13Z/i8VBRvsj4C6ssmeoFfuaFS0 aSIIyswldX+vmBOInLRf6NR+C+Tna2OAD5sycgZnu1VxlC080Yd4m/xS78DkHtPXkx0PkV U3Brj4aom6qpWMtDVtXdi2YcvNvrhobaiYajA9gmYLUukGlVeBVeCMDIz7llL2z77HxCBZ KDh7PCX3Qa39/AnzZshAtWJGUfLn3vtapQQAmMug4pyVGZ65f1Nr75ppjXvnAA== 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 4R7JT60tH3zmGX; Sat, 22 Jul 2023 07:48:42 +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 36M7mgIT016873; Sat, 22 Jul 2023 07:48:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36M7mgIt016872; Sat, 22 Jul 2023 07:48:42 GMT (envelope-from git) Date: Sat, 22 Jul 2023 07:48:42 GMT Message-Id: <202307220748.36M7mgIt016872@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: "Tobias C. Berner" Subject: git: 7bb64b89d0e5 - main - framework: add Mk/Uses/pycryptography 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: tcberner X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7bb64b89d0e5ec8d77b28f8341269ffbad279ebf Auto-Submitted: auto-generated The branch main has been updated by tcberner: URL: https://cgit.FreeBSD.org/ports/commit/?id=7bb64b89d0e5ec8d77b28f8341269ffbad279ebf commit 7bb64b89d0e5ec8d77b28f8341269ffbad279ebf Author: Tobias C. Berner AuthorDate: 2023-07-22 06:16:46 +0000 Commit: Tobias C. Berner CommitDate: 2023-07-22 07:46:38 +0000 framework: add Mk/Uses/pycryptography With the added new DEFAULT_VERSION "PYCRYPTOGRAHY_DEFAULT=rust|legacy" it is important to transparently depend on the right one. This is the job of this new uses. So instead of manually adding dependency lines like RUN_DEPENDS=${PYTHON_PKGNAMEPREFIX}cryptography>0:security/py-cryptography@${PY_FLAVOR} this should now be USES=pycryptography:run Supported arguments: ,build,run,test If no argument is given, it defaults to 'build,run'. A future commit will update to security/py-cryptography will introduce a rust dependency. PR: 254853 --- CHANGES | 20 ++++++++++++++++++++ Mk/Uses/pycryptography.mk | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) diff --git a/CHANGES b/CHANGES index 25c7d5fa12a9..48f0ce9023cd 100644 --- a/CHANGES +++ b/CHANGES @@ -10,6 +10,26 @@ in the release notes and/or placed into UPDATING. All ports committers are allowed to commit to this file. +20230722: +AUTHOR: tcberner@FreeBSD.org + + A new uses 'pycryptography' has been added to transparently depend on the + proper variant of 'rust' or 'legacy' depending on the default version set + by the user. + + Supported arguments: ,build,run + Passing no arguments () is equivalent to passing both build and run. + + Usage: + USES=pycryptography:build + -> adds a BUILD_DEPENDS only + USES=pycryptography:run + -> adds a RUN_DEPENDS only + USES=pycryptography:test + -> adds a TEST_DEPENDS only + USES=pycryptography:build,run or USES=pycryptography + -> adds a BUILD_ and RUN_DEPENDS + 20230712: AUTHOR: zirias@FreeBSD.org diff --git a/Mk/Uses/pycryptography.mk b/Mk/Uses/pycryptography.mk new file mode 100644 index 000000000000..78576746e414 --- /dev/null +++ b/Mk/Uses/pycryptography.mk @@ -0,0 +1,46 @@ +# Handle dependency on security/py-cryptogrpaphy[-legacy] +# +# Feature: pycrptography +# Usage: USES=pycryptography +# Valid ARGS: , build, run +# : default same as build,run +# build: add BUILD_DEPENDS +# run: add RUN_DEPENDS +# test: add TEST_DEPENDS +# +# MAINTAINER: portmgr@FreeBSD.org +# + +.if ! defined(_INCLUDE_USES_PYCRYPTOGRAPHY_MK) +_INCLUDE_USES_PYCRYPTOGRAPHY_MK= YES + +# valid arguments: +_PYCRYPTOGRAPHY_MK_VALID_MODES= build run test + +# Suffixes +_PYCRYPTOGRAPHY_MK_SUFFIX_rust= # +_PYCRYPTOGRAPHY_MK_SUFFIX_legacy= -legacy + +# Dependency +_PYCRYPTOGRAPHY_MK_SUFFIX= ${_PYCRYPTOGRAPHY_MK_SUFFIX_${PYCRYPTOGRAPHY_DEFAULT}} +_PYCRYPTOGRAPHY_MK_PKG= ${PYTHON_PKGNAMEPREFIX}cryptography${_PYCRYPTOGRAPHY_MK_SUFFIX} +_PYCRYPTOGRAPHY_MK_PORT= security/py-cryptography${_PYCRYPTOGRAPHY_MK_SUFFIX} +_PYCRYPTOGRAPHY_MK_DEPENDENCY= ${_PYCRYPTOGRAPHY_MK_PKG}>0:${_PYCRYPTOGRAPHY_MK_PORT}@${PY_FLAVOR} + +# === parse version arguments === +_PYGRYPTOGRAPHY_MK_MODES= # empty +. for _mode in ${_PYCRYPTOGRAPHY_MK_VALID_MODES} +. if ${pycryptography_ARGS:M${_mode}} +_PYCRYPTOGRAPHY_MK_MODES+= ${_mode} +. endif +. endfor +. if empty(_PYGRYPTOGRAPHY_MK_MODES) +_PYCRYPTOGRAPHY_MK_MODES= build run +. endif + +# == add actual dependencies === +. for _mode in ${_PYCRYPTOGRAPHY_MK_MODES} +${_mode:tu}_DEPENDS+= ${_PYCRYPTOGRAPHY_MK_DEPENDENCY} +. endfor + +.endif