diff options
-rw-r--r-- | CHANGES | 20 | ||||
-rw-r--r-- | Mk/Uses/pycryptography.mk | 46 |
2 files changed, 66 insertions, 0 deletions
@@ -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: <none>,build,run + Passing no arguments (<none>) 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: <none>, build, run +# <none>: 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 |