Files
haikuports/dev-python/cffi/cffi-1.15.1.recipe
OscarL c50b5fadd6 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.
2025-02-03 13:42:12 +00:00

101 lines
2.2 KiB
Bash

SUMMARY="Foreign Function Interface for Python calling C code"
DESCRIPTION="CFFI is a Python module which allows to call C code."
HOMEPAGE="https://cffi.readthedocs.io/
https://pypi.org/project/cffi/"
COPYRIGHT="2012-2021 Armin Rigo, Maciej Fijalkowski"
LICENSE="MIT"
REVISION="4"
SOURCE_URI="https://files.pythonhosted.org/packages/source/c/cffi/cffi-$portVersion.tar.gz"
CHECKSUM_SHA256="d400bfb9a37b1351253cb402671cea7e89bdecc294e8016a707f6d1d8ac934f9"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
PROVIDES="
$portName = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libffi$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:gcc$secondaryArchSuffix
"
PYTHON_VERSIONS=(3.10)
for i in "${!PYTHON_VERSIONS[@]}"; do
pythonVersion=${PYTHON_VERSIONS[$i]}
pythonPackage=python${pythonVersion//.}
eval "PROVIDES_${pythonPackage}=\"
${portName}_$pythonPackage = $portVersion
\""
if [ "$targetArchitecture" = x86_gcc2 ]; then
eval "PROVIDES_${pythonPackage}+=\"
cffi_$pythonPackage = $portVersion
\""
fi
eval "REQUIRES_$pythonPackage=\"
haiku
pycparser_$pythonPackage
cmd:python$pythonVersion
lib:libffi$secondaryArchSuffix
\""
BUILD_REQUIRES+="
build_$pythonPackage
installer_$pythonPackage
setuptools_$pythonPackage
wheel_$pythonPackage
"
BUILD_PREREQUIRES+="
cmd:python$pythonVersion
"
TEST_REQUIRES="
cffi_$pythonPackage
py_$pythonPackage
pytest_$pythonPackage
"
done
INSTALL()
{
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
packageEntries $pythonPackage \
$prefix/lib/python*
done
}
# Results for reference:
# 6 failed, 1913 passed, 120 skipped, 4 xfailed, 567 warnings in 1034.70s (0:17:14)
# failures are harmless, due to tests expecting dl/libm/libc names instead of what Haiku provides.
TEST()
{
for i in "${!PYTHON_VERSIONS[@]}"; do
py.test c/ testing/
done
}