cffi: clean up recipe, drop Python 3.9. (#11708)

On-tree recipes that depend on cffi:

- argon2_cffi_bindings
- bcrypt
- pycares
- pynacl

So we're doing the same on those too in one go.

Also:

- moved all recipes to use build/installer instead of setup.py.
- fixed calling of tests on cffi.
This commit is contained in:
OscarL
2025-02-03 10:42:12 -03:00
committed by GitHub
parent a5e7de042c
commit c50b5fadd6
5 changed files with 175 additions and 164 deletions

View File

@@ -3,7 +3,7 @@ DESCRIPTION="PyNaCl provides Python binding to the libsodium library."
HOMEPAGE="https://pypi.python.org/pypi/PyNaCl"
COPYRIGHT="2013,2018 Donald Stufft and individual contributors"
LICENSE="Apache v2"
REVISION="2"
REVISION="3"
SOURCE_URI="https://pypi.io/packages/source/p/pynacl/PyNaCl-$portVersion.tar.gz"
CHECKSUM_SHA256="8ac7448f09ab85811607bdd21ec2464495ac8b7c66d146bf545b0f08fb9220ba"
SOURCE_DIR="PyNaCl-$portVersion"
@@ -23,60 +23,60 @@ BUILD_REQUIRES="
devel:libsodium$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:awk
cmd:cmp
cmd:diff
cmd:gcc$secondaryArchSuffix
cmd:make
"
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\
cffi_$pythonPackage\n\
cmd:python$pythonVersion\n\
lib:libsodium$secondaryArchSuffix\
\""
if [ "$targetArchitecture" = "x86_gcc2" ]; then
eval "PROVIDES_${pythonPackage}+=\"\n\
pynacl_$pythonPackage = $portVersion\
PYTHON_VERSIONS=(3.10)
for i in "${!PYTHON_VERSIONS[@]}"; do
pythonVersion=${PYTHON_VERSIONS[$i]}
pythonPackage=python${pythonVersion//.}
eval "PROVIDES_${pythonPackage}=\"
${portName}_$pythonPackage = $portVersion
\""
fi
BUILD_REQUIRES="$BUILD_REQUIRES
cffi_$pythonPackage
setuptools_$pythonPackage
"
BUILD_PREREQUIRES="$BUILD_PREREQUIRES
cmd:python$pythonVersion
"
if [ "$targetArchitecture" = x86_gcc2 ]; then
eval "PROVIDES_${pythonPackage}+=\"
pynacl_$pythonPackage = $portVersion
\""
fi
eval "REQUIRES_$pythonPackage=\"
haiku$secondaryArchSuffix
cffi_$pythonPackage
cmd:python$pythonVersion
lib:libsodium$secondaryArchSuffix
\""
BUILD_REQUIRES+="
build_$pythonPackage
cffi_$pythonPackage
installer_$pythonPackage
setuptools_$pythonPackage
wheel_$pythonPackage
"
BUILD_PREREQUIRES+="
cmd:python$pythonVersion
"
done
INSTALL()
{
export SODIUM_INSTALL=system
for i in "${!PYTHON_PACKAGES[@]}"; do
pythonPackage=${PYTHON_PACKAGES[i]}
for i in "${!PYTHON_VERSIONS[@]}"; do
pythonVersion=${PYTHON_VERSIONS[$i]}
pythonPackage=python${pythonVersion//.}
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
$python -m build --wheel --skip-dependency-check --no-isolation
$python -m installer --p $prefix dist/*-$portVersion-cp${pythonVersion//.}-*.whl
install -m 755 -d "$docDir"
install -m 644 -t "$docDir" README.rst
packageEntries $pythonPackage \
packageEntries $pythonPackage \
$prefix/lib/python*
done
}