mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-10 22:00:09 +02:00
Reworked recipe, removed python2-sip since both are the same binary. The headers was also moved to includeDir. Now also builds a version for PyQt5
138 lines
3.2 KiB
Bash
138 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="2018 Riverbank Computing Limited"
|
|
LICENSE="GNU GPL v2
|
|
GNU GPL v3
|
|
SIP"
|
|
REVISION="1"
|
|
SOURCE_URI="https://downloads.sourceforge.net/pyqt/sip-$portVersion.tar.gz"
|
|
CHECKSUM_SHA256="24617fc31b983df075500ecac0e99d2fb48bf63ba82d4a17518659e571923822"
|
|
SOURCE_DIR="sip-$portVersion"
|
|
PATCHES="sip-$portVersion.patch"
|
|
|
|
ARCHITECTURES="!x86_gcc2 x86 x86_64"
|
|
SECONDARY_ARCHITECTURES="x86"
|
|
|
|
commandSuffix=$secondaryArchSuffix
|
|
commandBinDir=$binDir
|
|
if [ "$targetArchitecture" = "x86_gcc2" ]; then
|
|
commandSuffix=
|
|
commandBinDir=$prefix/bin
|
|
fi
|
|
|
|
PROVIDES="
|
|
sip$secondaryArchSuffix = $portVersion
|
|
cmd:sip = $portVersion
|
|
"
|
|
REQUIRES="
|
|
haiku$secondaryArchSuffix
|
|
"
|
|
|
|
BUILD_REQUIRES="
|
|
haiku${secondaryArchSuffix}_devel
|
|
"
|
|
BUILD_PREREQUIRES="
|
|
cmd:gcc$secondaryArchSuffix
|
|
cmd:make
|
|
"
|
|
|
|
PYTHON_PACKAGES=(python python3)
|
|
PYTHON_VERSIONS=(2.7 3.6)
|
|
for i in "${!PYTHON_PACKAGES[@]}"; do
|
|
pythonPackage=${PYTHON_PACKAGES[i]}
|
|
pythonVersion=${PYTHON_VERSIONS[$i]}
|
|
|
|
maybe_sipNoSuffix=
|
|
maybe_sipPyQtNoSuffix=
|
|
if [ "$targetArchitecture" = "x86_gcc2" ]; then
|
|
maybe_sipNoSuffix="sip_$pythonPackage = $portVersion"
|
|
maybe_sipPyQtNoSuffix="sip_pyqt_$pythonPackage = $portVersion"
|
|
fi
|
|
|
|
eval "
|
|
PROVIDES_${pythonPackage}=\"
|
|
sip${secondaryArchSuffix}_$pythonPackage = $portVersion
|
|
$maybe_sipNoSuffix
|
|
\"
|
|
REQUIRES_$pythonPackage=\"
|
|
haiku$secondaryArchSuffix
|
|
cmd:python$pythonVersion
|
|
\"
|
|
PROVIDES_pyqt_${pythonPackage}=\"
|
|
sip${secondaryArchSuffix}_pyqt_${pythonPackage} = $portVersion
|
|
$maybe_sipPyQtNoSuffix
|
|
\"
|
|
REQUIRES_pyqt_${pythonPackage}=\"
|
|
haiku$secondaryArchSuffix
|
|
cmd:python$pythonVersion
|
|
\"
|
|
"
|
|
|
|
BUILD_PREREQUIRES+="
|
|
cmd:python$pythonVersion
|
|
"
|
|
done
|
|
|
|
BUILD()
|
|
{
|
|
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"
|
|
|
|
mkdir -p build_$pythonPackage build_pyqt_$pythonPackage
|
|
cd build_$pythonPackage
|
|
|
|
$python ../configure.py \
|
|
--platform=haiku-g++ \
|
|
--bindir=$commandBinDir \
|
|
--incdir=$includeDir \
|
|
--destdir=$installLocation
|
|
make $jobArgs
|
|
|
|
cd ../build_pyqt_$pythonPackage
|
|
$python ../configure.py \
|
|
--platform=haiku-g++ \
|
|
--bindir=$commandBinDir \
|
|
--incdir=$includeDir \
|
|
--destdir=$installLocation \
|
|
--sip-module PyQt5.sip \
|
|
--no-tools
|
|
make $jobArgs
|
|
|
|
cd ..
|
|
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/
|
|
|
|
cd build_$pythonPackage
|
|
make install
|
|
|
|
packageEntries $pythonPackage \
|
|
"$prefix/lib/$python"
|
|
|
|
cd ../build_pyqt_$pythonPackage
|
|
make install
|
|
|
|
packageEntries pyqt_$pythonPackage \
|
|
"$prefix/lib/$python"
|
|
|
|
cd ..
|
|
done
|
|
}
|