Wed Oct 19 13:37:22 2022 UTC ()
python: Special handling of py-cryptography for versioned_dependencies.mk


(nia)
diff -r1.86 -r1.87 pkgsrc/lang/python/versioned_dependencies.mk
diff -r0 -r1.1 pkgsrc/security/py-cryptography/dependency.mk

cvs diff -r1.86 -r1.87 pkgsrc/lang/python/versioned_dependencies.mk (expand / switch to unified diff)

--- pkgsrc/lang/python/versioned_dependencies.mk 2022/09/11 18:10:43 1.86
+++ pkgsrc/lang/python/versioned_dependencies.mk 2022/10/19 13:37:21 1.87
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: versioned_dependencies.mk,v 1.86 2022/09/11 18:10:43 wiz Exp $ 1# $NetBSD: versioned_dependencies.mk,v 1.87 2022/10/19 13:37:21 nia Exp $
2# 2#
3# This file determines which separate distribution of a Python 3# This file determines which separate distribution of a Python
4# package is used as dependency, depending on the Python version 4# package is used as dependency, depending on the Python version
5# used. 5# used.
6# 6#
7# === User-settable variables === 7# === User-settable variables ===
8# 8#
9# PYTHON_VERSIONED_DEPENDENCIES 9# PYTHON_VERSIONED_DEPENDENCIES
10# The Python package which should be added as a dependency. 10# The Python package which should be added as a dependency.
11# 11#
12# Possible values: Pillow X cairo chardet click coverage cryptography dns flake8 hypothesis importlib-metadata jinja2 lama markdown mccabe more-itertools pip packaging pygments pyphen rsa setuptools setuptools_scm test test-cov 12# Possible values: Pillow X cairo chardet click coverage cryptography dns flake8 hypothesis importlib-metadata jinja2 lama markdown mccabe more-itertools pip packaging pygments pyphen rsa setuptools setuptools_scm test test-cov
13# Default: (nothing) 13# Default: (nothing)
14# 14#
@@ -39,27 +39,31 @@ _SUPPORTED_PACKAGES+= pip devel/py-pip20 @@ -39,27 +39,31 @@ _SUPPORTED_PACKAGES+= pip devel/py-pip20
39_SUPPORTED_PACKAGES+= pygments textproc/py-pygments25 textproc/py-pygments 39_SUPPORTED_PACKAGES+= pygments textproc/py-pygments25 textproc/py-pygments
40_SUPPORTED_PACKAGES+= pyphen textproc/py27-pyphen textproc/py-pyphen 40_SUPPORTED_PACKAGES+= pyphen textproc/py27-pyphen textproc/py-pyphen
41_SUPPORTED_PACKAGES+= rsa security/py-rsa40 security/py-rsa 41_SUPPORTED_PACKAGES+= rsa security/py-rsa40 security/py-rsa
42_SUPPORTED_PACKAGES+= setuptools devel/py-setuptools44 devel/py-setuptools 42_SUPPORTED_PACKAGES+= setuptools devel/py-setuptools44 devel/py-setuptools
43_SUPPORTED_PACKAGES+= setuptools_scm devel/py-setuptools_scm5 devel/py-setuptools_scm 43_SUPPORTED_PACKAGES+= setuptools_scm devel/py-setuptools_scm5 devel/py-setuptools_scm
44_SUPPORTED_PACKAGES+= test devel/py-test4 devel/py-test 44_SUPPORTED_PACKAGES+= test devel/py-test4 devel/py-test
45_SUPPORTED_PACKAGES+= test-cov devel/py27-test-cov devel/py-test-cov 45_SUPPORTED_PACKAGES+= test-cov devel/py27-test-cov devel/py-test-cov
46 46
47.for pattern in ${PYTHON_VERSIONED_DEPENDENCIES} 47.for pattern in ${PYTHON_VERSIONED_DEPENDENCIES}
48_PKG_MATCHED= no 48_PKG_MATCHED= no
49pkg:= ${pattern:C/:.*//} 49pkg:= ${pattern:C/:.*//}
50type:= ${pattern:C/[^:]*//} 50type:= ${pattern:C/[^:]*//}
51. for name py2dir py3dir in ${_SUPPORTED_PACKAGES} 51. for name py2dir py3dir in ${_SUPPORTED_PACKAGES}
52. if "${pkg}" == "${name}" 52. if "${pkg}" == "cryptography"
 53# Special due to Rust handling.
 54_PKG_MATCHED= yes
 55. include "../../security/py-cryptography/dependency.mk"
 56. elif "${pkg}" == "${name}"
53_PKG_MATCHED= yes 57_PKG_MATCHED= yes
54. if ${_PYTHON_VERSION} == 27 58. if ${_PYTHON_VERSION} == 27
55dir:= ${py2dir} 59dir:= ${py2dir}
56. else 60. else
57dir:= ${py3dir} 61dir:= ${py3dir}
58. endif 62. endif
59. if "${type}" == ":link" 63. if "${type}" == ":link"
60.include "../../${dir}/buildlink3.mk" 64.include "../../${dir}/buildlink3.mk"
61. elif "${type}" == ":build" 65. elif "${type}" == ":build"
62BUILD_DEPENDS:= ${BUILD_DEPENDS} ${PYPKGPREFIX}-${pkg}-[0-9]*:../../${dir} 66BUILD_DEPENDS:= ${BUILD_DEPENDS} ${PYPKGPREFIX}-${pkg}-[0-9]*:../../${dir}
63. elif "${type}" == ":test" 67. elif "${type}" == ":test"
64TEST_DEPENDS:= ${TEST_DEPENDS} ${PYPKGPREFIX}-${pkg}-[0-9]*:../../${dir} 68TEST_DEPENDS:= ${TEST_DEPENDS} ${PYPKGPREFIX}-${pkg}-[0-9]*:../../${dir}
65. elif "${type}" == ":tool" 69. elif "${type}" == ":tool"

File Added: pkgsrc/security/py-cryptography/dependency.mk
# $NetBSD: dependency.mk,v 1.1 2022/10/19 13:37:21 nia Exp $
#
# Not for public use - use through versioned_dependencies.mk.
#
# User-settable variables:
#
# PYCRYPTOGRAPHY_TYPE
#	Type of py-cryptography implementation used.
#
#	Possible values: c rust
#	Default: rust on platforms were Rust is supported
#

.include "../../mk/bsd.fast.prefs.mk"

.include "../../lang/rust/platform.mk"
.if ${PLATFORM_SUPPORTS_RUST:tl} == "yes" && empty(_PYTHON_VERSION:M2*)
PYCRYPTOGRAPHY_TYPE?=	rust
.else
PYCRYPTOGRAPHY_TYPE?=	c
.endif

.include "../../lang/python/pyversion.mk"
.if ${PYCRYPTOGRAPHY_TYPE:tl} == "rust"
PYCRYPTOGRAPHY_VERSION?=	cryptography>=0
PYCRYPTOGRAPHY_DIR?=		security/py-cryptography
.else
PYCRYPTOGRAPHY_VERSION?=	cryptography>=0<3.4
PYCRYPTOGRAPHY_DIR?=		security/py27-cryptography
.endif

.if "${type}" == ":build"
BUILD_DEPENDS:=	${BUILD_DEPENDS} ${PYPKGPREFIX}-${PYCRYPTOGRAPHY_VERSION}:../../${PYCRYPTOGRAPHY_DIR}
.elif "${type}" == ":test"
TEST_DEPENDS:=	${TEST_DEPENDS} ${PYPKGPREFIX}-${PYCRYPTOGRAPHY_VERSION}:../../${PYCRYPTOGRAPHY_DIR}
.elif "${type}" == ":tool"
TOOL_DEPENDS:=	${TOOL_DEPENDS} ${PYPKGPREFIX}-${PYCRYPTOGRAPHY_VERSION}:../../${PYCRYPTOGRAPHY_DIR}
.else
DEPENDS:=	${DEPENDS} ${PYPKGPREFIX}-${PYCRYPTOGRAPHY_VERSION}:../../${PYCRYPTOGRAPHY_DIR}
.endif