Files
haikuports/dev-python/pycryptodome/pycryptodome-3.17.recipe
OscarL da6f123984 pycryptodome/pycryptodomex: update to 3.17 (#7961)
- Dropped patchset, fix was made upstream.
- Also build for Python 3.10.
- Mention package differences in their descriptions.
2023-03-14 18:09:09 +01:00

102 lines
2.5 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 provides an almost drop-in replacement for PyCrypto (and thus \
conflicts with the 'pycrypto' packages, as it installs as a Python module with \
the name 'Crypto')."
HOMEPAGE="https://www.pycryptodome.org/"
COPYRIGHT="2014-2023 Legrandin"
LICENSE="BSD (2-clause)
Public Domain
Unlicense
"
REVISION="1"
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_PACKAGES=(python39 python310)
PYTHON_VERSIONS=(3.9 3.10)
for i in "${!PYTHON_PACKAGES[@]}"; do
pythonPackage=${PYTHON_PACKAGES[i]}
pythonVersion=${PYTHON_VERSIONS[$i]}
eval "PROVIDES_${pythonPackage}=\"\
${portName}_$pythonPackage = $portVersion\
\"; \
REQUIRES_$pythonPackage=\"\
haiku$secondaryArchSuffix\n\
lib:libgmp$secondaryArchSuffix\n\
cmd:python$pythonVersion\
\""
eval "CONFLICTS_$pythonPackage='
pycrypto_$pythonPackage
'"
BUILD_REQUIRES="$BUILD_REQUIRES
setuptools_$pythonPackage"
BUILD_PREREQUIRES="
cmd:cc$secondaryArchSuffix
cmd:python$pythonVersion"
done
TEST_REQUIRES="
cmd:make
"
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:$PYTHONPATH
mkdir -p $installLocation
rm -rf build
# Just in case... to avoid building as pycryptodomex (Cryptodome)
# when building locally (maybe after running "hp pycryptodomex").
rm -f ".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
}