Files
haikuports/dev-python/sip/sip-6.12.0.recipe
Jérôme Duval 715dcb6848 sip: bump version
2025-09-23 19:07:31 +02:00

127 lines
3.2 KiB
Bash

SUMMARY="A tool to create Python bindings for C and C++ libraries"
DESCRIPTION="SIP comprises a code generator and a Python module. The code generator \
processes a set of specification files and generates C or C++ code which is \
then compiled to create the bindings extension module. The SIP Python \
module provides support functions to the automatically generated code."
HOMEPAGE="https://www.riverbankcomputing.com/software/sip/"
COPYRIGHT="2019 Riverbank Computing Limited"
LICENSE="GNU GPL v2
GNU GPL v3
SIP"
REVISION="1"
SOURCE_URI="https://pypi.python.org/packages/source/s/sip/sip-$portVersion.tar.gz"
CHECKSUM_SHA256="083ced94f85315493231119a63970b2ba42b1d38b38e730a70e02a99191a89c6"
SOURCE_DIR="sip-$portVersion"
PATCHES="sip-$portVersion.patchset"
ARCHITECTURES="all !x86_gcc2"
if [ "$targetArchitecture" = "x86_gcc2" ]; then
SECONDARY_ARCHITECTURES="x86"
fi
commandBinDir=$binDir
if [ "$targetArchitecture" = "x86_gcc2" ]; then
commandBinDir=$prefix/bin
fi
PROVIDES="
sip$secondaryArchSuffix = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
"
BUILD_PREREQUIRES="
cmd:gcc$secondaryArchSuffix
cmd:make
"
PYTHON_PACKAGES=(python310)
PYTHON_VERSIONS=(3.10)
defaultVersion=3.10
for i in "${!PYTHON_PACKAGES[@]}"; do
pythonPackage=${PYTHON_PACKAGES[i]}
pythonVersion=${PYTHON_VERSIONS[$i]}
eval "PROVIDES_${pythonPackage}=\"
sip${secondaryArchSuffix}_$pythonPackage = $portVersion
cmd:sip_$pythonVersion = $portVersion
cmd:sip_build_$pythonVersion = $portVersion
cmd:sip_distinfo_$pythonVersion = $portVersion
cmd:sip_install_$pythonVersion = $portVersion
cmd:sip_module_$pythonVersion = $portVersion
cmd:sip_sdist_$pythonVersion = $portVersion
cmd:sip_wheel_$pythonVersion = $portVersion
\""
if [ $pythonVersion = $defaultVersion ]; then
eval "PROVIDES_${pythonPackage}+=\"
cmd:sip = $portVersion
cmd:sip_build = $portVersion
cmd:sip_distinfo = $portVersion
cmd:sip_install = $portVersion
cmd:sip_module = $portVersion
cmd:sip_sdist = $portVersion
cmd:sip_wheel = $portVersion
\""
fi
if [ "$targetArchitecture" = x86_gcc2 ]; then
eval "PROVIDES_${pythonPackage}+=\"
sip_$pythonPackage = $portVersion
\""
fi
eval "REQUIRES_$pythonPackage=\"
haiku$secondaryArchSuffix
packaging_$pythonPackage
ply_$pythonPackage
setuptools_$pythonPackage
tomli_$pythonPackage # for Python < 3.11
cmd:python$pythonVersion
\""
BUILD_REQUIRES+="
build_$pythonPackage
installer_$pythonPackage
setuptools_$pythonPackage
wheel_$pythonPackage
"
BUILD_PREREQUIRES+="
cmd:python$pythonVersion
"
done
INSTALL()
{
for i in "${!PYTHON_PACKAGES[@]}"; do
pythonPackage=${PYTHON_PACKAGES[i]}
pythonVersion=${PYTHON_VERSIONS[$i]}
python=python$pythonVersion
rm -rf dist
$python -m build --wheel --no-isolation --skip-dependency-check
$python -m installer --prefix=$prefix dist/*.whl
# Version suffix all the scripts
for f in $commandBinDir/*; do
mv $f $f-$pythonVersion
done
# And provide suffix-less symlinks for the default version
if [ $pythonVersion = $defaultVersion ]; then
for f in $commandBinDir/*; do
ln -sr $f ${f%-$pythonVersion}
done
fi
packageEntries $pythonPackage \
$prefix/lib/python* \
$commandBinDir
done
}