aboutsummaryrefslogtreecommitdiff
path: root/Mk
diff options
context:
space:
mode:
authorPo-Chuan Hsieh <sunpoet@FreeBSD.org>2023-09-29 14:19:56 +0000
committerPo-Chuan Hsieh <sunpoet@FreeBSD.org>2023-09-29 14:19:56 +0000
commit3754fc5f190b9a31f617d662bb35fd0f96ee8088 (patch)
tree3896798f9cfeb2241f037b4ae5874dd2f85b784e /Mk
parent2a4bb83e076d875d1b4e91208ca8d3babfb6d522 (diff)
downloadports-3754fc5f190b9a31f617d662bb35fd0f96ee8088.tar.gz
ports-3754fc5f190b9a31f617d662bb35fd0f96ee8088.zip
*: Replace USES=pycryptography* with USE_PYTHON=cryptography{,_build,_test}
- Introduce USE_PYTHON=cryptography{,_build,_test} - Switch all 96 ports from USES=pycryptography to with USE_PYTHON=cryptography{,_build,_test} - Remove Mk/Uses/pycryptography.mk PR: 273727 Approved by: tcberner (portmgr) Exp-run by: antoine
Diffstat (limited to 'Mk')
-rw-r--r--Mk/Uses/pycryptography.mk46
-rw-r--r--Mk/Uses/python.mk30
2 files changed, 30 insertions, 46 deletions
diff --git a/Mk/Uses/pycryptography.mk b/Mk/Uses/pycryptography.mk
deleted file mode 100644
index a7687b40a4cd..000000000000
--- a/Mk/Uses/pycryptography.mk
+++ /dev/null
@@ -1,46 +0,0 @@
-# Handle dependency on security/py-cryptography[-legacy]
-#
-# Feature: pycryptography
-# 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 ===
-_PYCRYPTOGRAPHY_MK_MODES= # empty
-. for _mode in ${_PYCRYPTOGRAPHY_MK_VALID_MODES}
-. if ${pycryptography_ARGS:M${_mode}}
-_PYCRYPTOGRAPHY_MK_MODES+= ${_mode}
-. endif
-. endfor
-. if empty(_PYCRYPTOGRAPHY_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
diff --git a/Mk/Uses/python.mk b/Mk/Uses/python.mk
index 57254be9b048..b65b2150f214 100644
--- a/Mk/Uses/python.mk
+++ b/Mk/Uses/python.mk
@@ -82,6 +82,14 @@
# prefix-less original name, e.g.
# bin/foo-2.7 --> bin/foo.
#
+# cryptography_build
+# - Depend on security/cryptography at build-time.
+#
+# cryptography - Depend on security/cryptography at run-time.
+#
+# cryptography_test
+# - Depend on security/cryptography at test-time.
+#
# cython - Depend on lang/cython at build-time.
#
# cython_run - Depend on lang/cython at run-time.
@@ -317,6 +325,9 @@ _PYTHON_RELPORTDIR= lang/python
_VALID_PYTHON_FEATURES= allflavors \
autoplist \
concurrent \
+ cryptography_build \
+ cryptography \
+ cryptography_test \
cython \
cython_run \
cython_test \
@@ -597,6 +608,25 @@ _PYTHONPKGLIST= ${WRKDIR}/.PLIST.pymodtmp
# - it uses USE_PYTHON=distutils
#
+# cryptography* support
+. if ${PYCRYPTOGRAPHY_DEFAULT} == rust
+CRYPTOGRAPHY_DEPENDS= ${PYTHON_PKGNAMEPREFIX}cryptography>=41.0.3_1,1:security/py-cryptography@${PY_FLAVOR}
+. else
+CRYPTOGRAPHY_DEPENDS= ${PYTHON_PKGNAMEPREFIX}cryptography-legacy>=3.4.8_1,1:security/py-cryptography-legacy@${PY_FLAVOR}
+. endif
+
+. if defined(_PYTHON_FEATURE_CRYPTOGRAPHY_BUILD)
+BUILD_DEPENDS+= ${CRYPTOGRAPHY_DEPENDS}
+. endif
+
+. if defined(_PYTHON_FEATURE_CRYPTOGRAPHY)
+RUN_DEPENDS+= ${CRYPTOGRAPHY_DEPENDS}
+. endif
+
+. if defined(_PYTHON_FEATURE_CRYPTOGRAPHY_TEST)
+TEST_DEPENDS+= ${CRYPTOGRAPHY_DEPENDS}
+. endif
+
# cython* support
. if defined(_PYTHON_FEATURE_CYTHON)
BUILD_DEPENDS+= cython-${PYTHON_VER}:lang/cython@${PY_FLAVOR}