mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-23 04:00:05 +02:00
cffi, bump version, fix recipe, add python3.10 (#7174)
This commit is contained in:
94
dev-python/cffi/cffi-1.15.1.recipe
Normal file
94
dev-python/cffi/cffi-1.15.1.recipe
Normal file
@@ -0,0 +1,94 @@
|
||||
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="1"
|
||||
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
|
||||
cmd:pkg_config$secondaryArchSuffix
|
||||
"
|
||||
|
||||
PYTHON_PACKAGES=(python3 python38 python39 python310)
|
||||
PYTHON_VERSIONS=(3.7 3.8 3.9 3.10)
|
||||
PYTHON_LIBSUFFIXES+=(m)
|
||||
for i in "${!PYTHON_PACKAGES[@]}"; do
|
||||
pythonPackage=${PYTHON_PACKAGES[i]}
|
||||
pythonVersion=${PYTHON_VERSIONS[$i]}
|
||||
pythonLibSuffix=${PYTHON_LIBSUFFIXES[$i]}
|
||||
eval "PROVIDES_${pythonPackage}=\"\
|
||||
${portName}_$pythonPackage = $portVersion\
|
||||
\"; \
|
||||
REQUIRES_$pythonPackage=\"\
|
||||
haiku\n\
|
||||
lib:libffi$secondaryArchSuffix\n\
|
||||
lib:libpython$pythonVersion$pythonLibSuffix$secondaryArchSuffix\n\
|
||||
pycparser_$pythonPackage\n\
|
||||
cmd:python$pythonVersion\
|
||||
\""
|
||||
BUILD_REQUIRES="$BUILD_REQUIRES
|
||||
setuptools_$pythonPackage
|
||||
pycparser_$pythonPackage"
|
||||
BUILD_PREREQUIRES="$BUILD_PREREQUIRES
|
||||
cmd:python$pythonVersion"
|
||||
done
|
||||
|
||||
TEST_REQUIRES+="
|
||||
${portName}_$pythonPackage
|
||||
py_$pythonPackage
|
||||
pycparser_$pythonPackage
|
||||
pytest_$pythonPackage
|
||||
"
|
||||
|
||||
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()
|
||||
{
|
||||
for i in "${!PYTHON_PACKAGES[@]}"; do
|
||||
pythonPackage=${PYTHON_PACKAGES[i]}
|
||||
pythonVersion=${PYTHON_VERSIONS[$i]}
|
||||
|
||||
cd "$sourceDir"-$pythonPackage
|
||||
|
||||
python=python$pythonVersion
|
||||
echo import cffi | $python
|
||||
$python setup.py test
|
||||
cd testing
|
||||
$python support.py
|
||||
done
|
||||
}
|
||||
Reference in New Issue
Block a user