Files
haikuports/dev-python/haiku-pyapi/haiku_pyapi-0.2.recipe
Zardshard b93f943392 haiku-pyapi: Release 0.2 (#10062)
Co-authored-by: Oscar Lesta <oscar.lesta@gmail.com>
Co-authored-by: Jérôme Duval <jerome.duval@gmail.com>
2024-02-08 14:03:08 +01:00

81 lines
1.9 KiB
Bash

SUMMARY="Python bindings for the Haiku API"
DESCRIPTION="This lets you build apps for Haiku using the Haiku API directly \
from Python. \
\
For the most part, Haiku-PyAPI tries to copy the C++ API. There are some \
places where we have had to deviate from the C++ API, however. \
\
Currently the library is unstable and has plenty of bugs."
HOMEPAGE="https://github.com/coolcoder613eb/Haiku-PyAPI/"
COPYRIGHT="2023-2024 Elozor Bruce
2023-2024 Zardshard
2023-2024 TmTFx
2023 OscarL"
LICENSE="MIT"
REVISION="1"
SOURCE_URI="https://github.com/coolcoder613eb/Haiku-PyAPI/archive/refs/tags/v$portVersion.tar.gz"
CHECKSUM_SHA256="a534151ba988a406da5e278db5af127fca257c6b260374be054a385335b779d2"
SOURCE_DIR="Haiku-PyAPI-$portVersion"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
PROVIDES="
$portName = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
"
BUILD_PREREQUIRES="
cmd:gcc$secondaryArchSuffix
cmd:jam
"
PYTHON_VERSIONS=(3.9 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+=\"
haiku_pyapi_$pythonPackage = $portVersion
\""
fi
eval "REQUIRES_$pythonPackage=\"
haiku$secondaryArchSuffix
cmd:python$pythonVersion
\""
BUILD_REQUIRES+="
pybind11${secondaryArchSuffix}_$pythonPackage
"
BUILD_PREREQUIRES+="
cmd:python$pythonVersion
"
done
INSTALL()
{
for i in "${!PYTHON_VERSIONS[@]}"; do
pythonVersion=${PYTHON_VERSIONS[$i]}
pythonPackage=python${pythonVersion//.}
installLocation=$prefix/lib/python$pythonVersion/vendor-packages
jam -q $jobArgs -spython_version="$pythonVersion" \
-sinstall_location="$installLocation" install
packageEntries $pythonPackage \
$prefix/lib/python*
done
}