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>
This commit is contained in:
Zardshard
2024-02-08 13:03:08 +00:00
committed by GitHub
parent faff217fa3
commit b93f943392
2 changed files with 80 additions and 65 deletions

View File

@@ -1,65 +0,0 @@
SUMMARY="Python bindings for the Haiku API"
DESCRIPTION="An initial release of the python bindings for the Haiku API. \
The API is not stable and subject to change. The bindings for the app kit \
are mostly complete, but a couple of functions are missing. The interface \
kit has the essentials (buttons, text boxes, etc.), but many items are \
missing. The other kits have not been ported yet."
HOMEPAGE="https://github.com/coolcoder613eb/Haiku-PyAPI/"
COPYRIGHT="2023 Elozor Bruce
2023 Zardshard"
LICENSE="MIT"
REVISION="1"
SOURCE_URI="https://github.com/coolcoder613eb/Haiku-PyAPI/archive/refs/tags/v$portVersion.tar.gz"
CHECKSUM_SHA256="32b52f52a44546459aabf3df56e650f9db8113413d10948b00d759546067aee0"
SOURCE_DIR="Haiku-PyAPI-0.1"
ARCHITECTURES="x86_64"
PROVIDES="
$portName = $portVersion
"
REQUIRES="
haiku
"
BUILD_REQUIRES="
haiku_devel
"
BUILD_PREREQUIRES="
cmd:gcc
cmd:jam
"
PYTHON_PACKAGES=(python39 python310)
PYTHON_VERSIONS=(3.9 3.10)
defaultVersion=3.10
for i in "${!PYTHON_PACKAGES[@]}"; do
pythonPackage=${PYTHON_PACKAGES[i]}
pythonVersion=${PYTHON_VERSIONS[$i]}
eval "PROVIDES_${pythonPackage}=\"
${portName}_$pythonPackage = $portVersion
\""
eval "REQUIRES_$pythonPackage=\"
haiku
\""
BUILD_REQUIRES+="
pybind11_$pythonPackage
"
done
INSTALL()
{
for i in "${!PYTHON_PACKAGES[@]}"; do
pythonPackage=${PYTHON_PACKAGES[i]}
pythonVersion=${PYTHON_VERSIONS[$i]}
python=python$pythonVersion
installLocation=$prefix/lib/$python/vendor-packages
jam -q $jobArgs -spython_version="$pythonVersion" \
-sinstall_location="$installLocation" install
packageEntries $pythonPackage \
$prefix/lib/python*
done
}

View File

@@ -0,0 +1,80 @@
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
}