Files
haikuports/dev-python/pycryptodome/pycryptodomex-3.17.recipe
Oscar Lesta 75e614d685 pycryptodome(x): drop Python 3.9 support.
Nothing uses them on-tree at the moment. Leaving them in because we
might need them for yt-dlp at some point.
2025-09-19 22:53:14 -03:00

102 lines
2.4 KiB
Bash

SUMMARY="Cryptographic library for Python"
DESCRIPTION="PyCryptodome is a self-contained Python package of low-level cryptographic \
primitives.
PyCryptodome is a fork of PyCrypto. It brings several enhancements with respect \
to the last official version of PyCrypto (2.6.1).
This package ('pycryptodomex', mind the final "x") can co-exist with the 'pycrypto' \
packages, as it installs as a Python module under the name 'Cryptodome'."
HOMEPAGE="https://www.pycryptodome.org/"
COPYRIGHT="2014-2023 Legrandin"
LICENSE="BSD (2-clause)
Public Domain
Unlicense
"
REVISION="3"
SOURCE_URI="https://pypi.python.org/packages/source/p/pycryptodome/pycryptodome-$portVersion.tar.gz"
CHECKSUM_SHA256="bce2e2d8e82fcf972005652371a3e8731956a0c1fbb719cc897943b3695ad91b"
SOURCE_FILENAME="pycryptodome-$portVersion.tar.gz"
SOURCE_DIR="pycryptodome-$portVersion"
ARCHITECTURES="x86_64 !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
PROVIDES="
$portName = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libgmp$secondaryArchSuffix
"
PYTHON_VERSIONS=(3.10)
for pythonVersion in ${PYTHON_VERSIONS[@]}; do
pythonPackage=python${pythonVersion//.}
eval "PROVIDES_$pythonPackage=\"
${portName}_$pythonPackage = $portVersion
\""
if [ "$targetArchitecture" = x86_gcc2 ]; then
eval "PROVIDES_$pythonPackage+=\"
pycryptodomex_$pythonPackage = $portVersion
\""
fi
eval "REQUIRES_$pythonPackage=\"
haiku$secondaryArchSuffix
lib:libgmp$secondaryArchSuffix
cmd:python$pythonVersion
\""
BUILD_REQUIRES="$BUILD_REQUIRES
setuptools_$pythonPackage"
BUILD_PREREQUIRES="
cmd:cc$secondaryArchSuffix
cmd:python$pythonVersion"
done
TEST_REQUIRES="
cmd:make
"
INSTALL()
{
for pythonVersion in ${PYTHON_VERSIONS[@]}; do
pythonPackage=python${pythonVersion//.}
python=python$pythonVersion
installLocation=$prefix/lib/$python/vendor-packages/
export PYTHONPATH=$installLocation:$PYTHONPATH
mkdir -p $installLocation
rm -rf build
# This causes it to build as pycryptodomex (Cryptodome):
touch ".separate_namespace"
$python setup.py build install \
--root=/ --prefix=$prefix
# You don't get the docs with `pip install` either, skip docs for now.
# install -m 755 -d "$docDir"
# install -m 644 -t "$docDir" README.rst
packageEntries $pythonPackage \
$prefix/lib/python*
done
}
TEST()
{
python3 setup.py test
export PYTHON=/system/bin/python3
cd src/test
make
}