Files
haikuports/dev-python/pyaes/pyaes-1.6.1.recipe
2023-06-08 16:04:36 +02:00

89 lines
1.9 KiB
Bash

SUMMARY="Python implementation of the AES block cipher algorithm"
DESCRIPTION="A pure-Python implementation of the AES block cipher algorithm \
and the common modes of operation (CBC, CFB, CTR, ECB and OFB)."
HOMEPAGE="https://pypi.python.org/pypi/pip"
COPYRIGHT="2014 Richard Moore"
LICENSE="MIT"
REVISION="3"
SOURCE_URI="https://pypi.org/packages/source/p/pyaes/pyaes-$portVersion.tar.gz"
CHECKSUM_SHA256="02c1b1405c38d3c370b085fb952dd8bea3fadcee6411ad99f312cc129c536d8f"
ARCHITECTURES="any"
PROVIDES="
$portName = $portVersion
"
REQUIRES="
haiku
"
BUILD_REQUIRES="
haiku_devel
"
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
\""
eval "REQUIRES_$pythonPackage=\"
haiku
cmd:python$pythonVersion
setuptools_$pythonPackage
\""
BUILD_REQUIRES+="
setuptools_$pythonPackage
"
BUILD_PREREQUIRES+="
cmd:python$pythonVersion
"
# Tests Needs "Crypto", but PyCrypto is deprecated, so use a replacement.
TEST_REQUIRES+="
pycryptodome_$pythonPackage
"
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:$PYTHONPATH
mkdir -p $installLocation
rm -rf build
$python setup.py build install \
--root=/ --prefix=$prefix
packageEntries $pythonPackage \
$prefix/lib/python*
done
}
TEST()
{
cd tests
# Make sure the tests can find the local "pyaes" module
export PYTHONPATH="../":$PYTHONPATH
for i in "${!PYTHON_VERSIONS[@]}"; do
pythonVersion=${PYTHON_VERSIONS[$i]}
python=python$pythonVersion
for f in *.py; do
$python $f
done
done
}