mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-09 05:10:05 +02:00
94 lines
2.2 KiB
Bash
94 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="1"
|
|
SOURCE_URI="https://files.pythonhosted.org/packages/source/c/cffi/cffi-$portVersion.tar.gz"
|
|
CHECKSUM_SHA256="920f0d66a896c2d99f0adbb391f990a84091179542c205fa53ce5787aff87954"
|
|
|
|
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)
|
|
PYTHON_VERSIONS=(3.7 3.8 3.9)
|
|
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\
|
|
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
|
|
}
|