1SUMMARY="A Python module providing cryptographic recipes and primitives"
2DESCRIPTION="cryptography is a module designed to expose cryptographic \
3primitives and recipes to Python developers. \
4It includes both high level recipes and low level interfaces to common \
5cryptographic algorithms such as symmetric ciphers, message digests, and key \
6derivation functions."
7HOMEPAGE="https://cryptography.io/"
8COPYRIGHT="2013-2020 The cryptography developers"
9LICENSE="Apache v2
10	BSD (3-clause)"
11REVISION="4"
12SOURCE_URI="https://pypi.io/packages/source/c/cryptography/cryptography-$portVersion.tar.gz"
13CHECKSUM_SHA256="5a60d3780149e13b7a6ff7ad6526b38846354d11a15e21068e57073e29e19bed"
14
15ARCHITECTURES="all !x86_gcc2"
16SECONDARY_ARCHITECTURES="x86"
17
18PROVIDES="
19	cryptography$secondaryArchSuffix = $portVersion
20	"
21REQUIRES="
22	haiku$secondaryArchSuffix
23	"
24
25BUILD_REQUIRES="
26	haiku${secondaryArchSuffix}_devel
27	devel:libcrypto$secondaryArchSuffix
28	devel:libffi$secondaryArchSuffix
29	devel:libssl$secondaryArchSuffix
30	"
31BUILD_PREREQUIRES="
32	cmd:gcc$secondaryArchSuffix
33	cmd:pkg_config$secondaryArchSuffix
34	"
35
36PYTHON_PACKAGES=(python39 python310)
37PYTHON_VERSIONS=(3.9 3.10)
38for i in "${!PYTHON_PACKAGES[@]}"; do
39pythonPackage=${PYTHON_PACKAGES[i]}
40pythonVersion=${PYTHON_VERSIONS[$i]}
41eval "PROVIDES_$pythonPackage=\"
42	${portName}_$pythonPackage = $portVersion
43	\""
44eval "REQUIRES_$pythonPackage=\"
45	haiku$secondaryArchSuffix
46	asn1crypto_$pythonPackage
47	cffi_$pythonPackage
48	idna_$pythonPackage
49	pyasn1_$pythonPackage
50	six_$pythonPackage
51	lib:libcrypto$secondaryArchSuffix
52	lib:libpython$pythonVersion$secondaryArchSuffix
53	lib:libssl$secondaryArchSuffix
54	\""
55if [ "$targetArchitecture" = "x86_gcc2" ]; then
56	eval "PROVIDES_${pythonPackage}+=\"\n\
57		cryptography_$pythonPackage = $portVersion\
58		\""
59fi
60BUILD_REQUIRES="$BUILD_REQUIRES
61	pip_$pythonPackage
62	setuptools_$pythonPackage
63	wheel_$pythonPackage
64	"
65BUILD_PREREQUIRES="$BUILD_PREREQUIRES
66	cmd:python$pythonVersion"
67done
68
69INSTALL()
70{
71	for i in "${!PYTHON_PACKAGES[@]}"; do
72		pythonPackage=${PYTHON_PACKAGES[i]}
73		pythonVersion=${PYTHON_VERSIONS[$i]}
74
75		python=python$pythonVersion
76		installLocation=$prefix/lib/$python/vendor-packages/
77		export PYTHONPATH=$installLocation
78		mkdir -p "$installLocation"
79		$python setup.py build install \
80			--optimize=1 \
81			--root=/ --prefix="$prefix"
82
83		packageEntries $pythonPackage \
84			"$prefix"/lib/$python
85	done
86}
87