Files
haikuports/dev-python/cryptography/cryptography-2.9.2.recipe
2022-03-31 11:27:01 +02:00

83 lines
2.3 KiB
Bash

SUMMARY="A Python module providing cryptographic recipes and primitives"
DESCRIPTION="cryptography is a module designed to expose cryptographic \
primitives and recipes to Python developers. \
It includes both high level recipes and low level interfaces to common \
cryptographic algorithms such as symmetric ciphers, message digests, and key \
derivation functions."
HOMEPAGE="https://cryptography.io/"
COPYRIGHT="2013-2020 The cryptography developers"
LICENSE="Apache v2
BSD (3-clause)"
REVISION="2"
SOURCE_URI="https://pypi.io/packages/source/c/cryptography/cryptography-$portVersion.tar.gz"
CHECKSUM_SHA256="a0c30272fb4ddda5f5ffc1089d7405b7a71b0b0f51993cb4e5dbb4590b2fc229"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
PROVIDES="
cryptography$secondaryArchSuffix = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libcrypto$secondaryArchSuffix
devel:libffi$secondaryArchSuffix
devel:libssl$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:gcc$secondaryArchSuffix
cmd:pkg_config$secondaryArchSuffix
"
PYTHON_PACKAGES=(python3 python38 python39)
PYTHON_VERSIONS=(3.7 3.8 3.9)
PYTHON_LIBSUFFIXES+=(m)
for i in "${!PYTHON_PACKAGES[@]}"; do
pythonPackage=${PYTHON_PACKAGES[i]}
pythonVersion=${PYTHON_VERSIONS[$i]}
pythonLibSuffix=${PYTHON_LIBSUFFIXES[$i]}
eval "PROVIDES_$pythonPackage=\"
${portName}_$pythonPackage = $portVersion
\""
eval "REQUIRES_$pythonPackage=\"
haiku$secondaryArchSuffix
asn1crypto_$pythonPackage
cffi${secondaryArchSuffix}_$pythonPackage
idna_$pythonPackage
pyasn1_$pythonPackage
six_$pythonPackage
lib:libcrypto$secondaryArchSuffix
lib:libpython$pythonVersion$pythonLibSuffix$secondaryArchSuffix
lib:libssl$secondaryArchSuffix
\""
BUILD_REQUIRES="$BUILD_REQUIRES
setuptools_$pythonPackage
wheel_$pythonPackage
pip_$pythonPackage"
BUILD_PREREQUIRES="$BUILD_PREREQUIRES
cmd:python$pythonVersion"
done
INSTALL()
{
for i in "${!PYTHON_PACKAGES[@]}"; do
pythonPackage=${PYTHON_PACKAGES[i]}
pythonVersion=${PYTHON_VERSIONS[$i]}
python=python$pythonVersion
installLocation=$prefix/lib/$python/vendor-packages/
export PYTHONPATH=$installLocation
mkdir -p "$installLocation"
$python setup.py build install \
--optimize=1 \
--root=/ --prefix="$prefix"
packageEntries $pythonPackage \
"$prefix"/lib/$python
done
}