Files
haikuports/dev-python/pyqt/pyqt5-5.15.11.recipe
2024-10-11 07:53:07 +02:00

191 lines
6.2 KiB
Bash

SUMMARY="Python v2 and v3 bindings for Qt application framework"
DESCRIPTION="PyQt combines all the advantages of Qt and Python. A programmer \
has all the power of Qt, but is able to exploit it with the \
simplicity of Python."
HOMEPAGE="http://www.riverbankcomputing.com/software/pyqt/"
COPYRIGHT="2015-2023 Riverbank Computing Limited"
LICENSE="GNU GPL v3"
REVISION="1"
SOURCE_URI="https://pypi.python.org/packages/source/P/PyQt5/PyQt5-$portVersion.tar.gz"
CHECKSUM_SHA256="fda45743ebb4a27b4b1a51c6d8ef455c4c1b5d610c90d2934c7802b5c1557c52"
SOURCE_DIR="PyQt5-$portVersion"
PYTHON3_VERSION="3.10"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
commandSuffix=$secondaryArchSuffix
commandBinDir=$binDir
if [ "$targetArchitecture" = x86_gcc2 ]; then
commandSuffix=
commandBinDir=$prefix/bin
fi
portVersionCompat="$portVersion compat >= ${portVersion%%.*}"
qtVersion="${portVersion%.*}"
PROVIDES="
pyqt5$secondaryArchSuffix = $portVersionCompat
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libQt5Bluetooth$secondaryArchSuffix
lib:libQt5Core$secondaryArchSuffix
lib:libQt5Designer$secondaryArchSuffix
lib:libQt5DBus$secondaryArchSuffix
lib:libQt5Gui$secondaryArchSuffix
lib:libQt5Help$secondaryArchSuffix
lib:libQt5Location$secondaryArchSuffix
lib:libQt5Multimedia$secondaryArchSuffix
lib:libQt5MultimediaWidgets$secondaryArchSuffix
lib:libQt5Network$secondaryArchSuffix
lib:libQt5Nfc$secondaryArchSuffix
lib:libQt5OpenGL$secondaryArchSuffix
lib:libQt5PrintSupport$secondaryArchSuffix
lib:libQt5Positioning$secondaryArchSuffix
lib:libQt5Qml$secondaryArchSuffix
lib:libQt5Quick$secondaryArchSuffix
lib:libQt5QuickWidgets$secondaryArchSuffix
lib:libQt5Sensors$secondaryArchSuffix
lib:libQt5SerialPort$secondaryArchSuffix
lib:libQt5Sql$secondaryArchSuffix
lib:libQt5Svg$secondaryArchSuffix
lib:libQt5Test$secondaryArchSuffix
lib:libQt5WebChannel$secondaryArchSuffix
lib:libQt5WebKit$secondaryArchSuffix
lib:libQt5WebKitWidgets$secondaryArchSuffix
lib:libQt5WebSockets$secondaryArchSuffix
lib:libQt5Widgets$secondaryArchSuffix
lib:libQt5Xml$secondaryArchSuffix
lib:libQt5XmlPatterns$secondaryArchSuffix
lib:libGL${secondaryArchSuffix}
"
REPLACES="
pyqt$secondaryArchSuffix
"
PROVIDES_python310="
pyqt5${secondaryArchSuffix}_python310 = $portVersionCompat
cmd:pylupdate5$commandSuffix
cmd:pyrcc5$commandSuffix
cmd:pyuic5$commandSuffix
"
REQUIRES_python310="
haiku$secondaryArchSuffix
pyqt5$secondaryArchSuffix == $portVersion base
pyqt5_sip_python310
cmd:python$PYTHON3_VERSION
$REQUIRES
"
REPLACES_python310="
pyqt${secondaryArchSuffix}_python39
"
if [ "$targetArchitecture" = "x86_gcc2" ]; then
PROVIDES_python310+="
pyqt5_python310 = $portVersionCompat
"
fi
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
pyqt_builder_python310
setuptools_python310
sip_python310 >= 6
tomli_python310
devel:libQt5Bluetooth$secondaryArchSuffix >= $qtVersion
devel:libQt5Core$secondaryArchSuffix >= $qtVersion
devel:libQt5Designer$secondaryArchSuffix >= $qtVersion
devel:libQt5DBus$secondaryArchSuffix >= $qtVersion
devel:libQt5Gui$secondaryArchSuffix >= $qtVersion
devel:libQt5Help$secondaryArchSuffix >= $qtVersion
devel:libQt5Location$secondaryArchSuffix >= $qtVersion
devel:libQt5Multimedia$secondaryArchSuffix >= $qtVersion
devel:libQt5MultimediaWidgets$secondaryArchSuffix >= $qtVersion
devel:libQt5Network$secondaryArchSuffix >= $qtVersion
devel:libQt5Nfc$secondaryArchSuffix >= $qtVersion
devel:libQt5OpenGL$secondaryArchSuffix >= $qtVersion
devel:libQt5PrintSupport$secondaryArchSuffix >= $qtVersion
devel:libQt5Positioning$secondaryArchSuffix >= $qtVersion
devel:libQt5Qml$secondaryArchSuffix >= $qtVersion
devel:libQt5Quick$secondaryArchSuffix >= $qtVersion
devel:libQt5QuickWidgets$secondaryArchSuffix >= $qtVersion
devel:libQt5Sensors$secondaryArchSuffix >= $qtVersion
devel:libQt5SerialPort$secondaryArchSuffix >= $qtVersion
devel:libQt5Sql$secondaryArchSuffix >= $qtVersion
devel:libQt5Svg$secondaryArchSuffix >= $qtVersion
devel:libQt5Test$secondaryArchSuffix >= $qtVersion
devel:libQt5WebChannel$secondaryArchSuffix >= $qtVersion
devel:libQt5WebKit$secondaryArchSuffix
devel:libQt5WebKitWidgets$secondaryArchSuffix
devel:libQt5WebSockets$secondaryArchSuffix >= $qtVersion
devel:libQt5Widgets$secondaryArchSuffix >= $qtVersion
devel:libQt5Xml$secondaryArchSuffix >= $qtVersion
devel:libQt5XmlPatterns$secondaryArchSuffix >= $qtVersion
devel:libGL${secondaryArchSuffix}
"
BUILD_PREREQUIRES="
cmd:python$PYTHON3_VERSION
cmd:gcc${secondaryArchSuffix}
cmd:make
cmd:ld${secondaryArchSuffix}
cmd:sip >= 6
cmd:qmake${secondaryArchSuffix} >= 5
"
BUILD()
{
OLDPYTHONPATH=$PYTHONPATH
local packageLinksDir=$(dirname $portPackageLinksDir)
local python3PackageName="${portName}_python310-$portFullVersion"
# GENERIC: all python_setuptools-based installs need this
python=$packageLinksDir/$python3PackageName/cmd~python$PYTHON3_VERSION/bin/python$PYTHON3_VERSION
pythonVersion=$($python --version 2>&1 | sed 's/Python //' | head -c4)
installLocation=/lib/python$pythonVersion/vendor-packages/
export PYTHONPATH=$installLocation:$OLDPYTHONPATH
sip-build \
--confirm-license \
--no-designer-plugin \
--no-qml-plugin \
--no-make \
--target-dir=$installLocation \
--api-dir=$dataDir/sip/PyQt5 \
--pep484-pyi
cd build
make $jobArgs
}
INSTALL()
{
OLDPYTHONPATH=$PYTHONPATH
local packageLinksDir=$(dirname $portPackageLinksDir)
local python3PackageName="${portName}_python310-$portFullVersion"
# GENERIC: all python_setuptools-based installs need this
python=$packageLinksDir/$python3PackageName/cmd~python$PYTHON3_VERSION/bin/python$PYTHON3_VERSION
pythonVersion=$($python --version 2>&1 | sed 's/Python //' | head -c4)
installLocation=lib/python$pythonVersion/vendor-packages/
export PYTHONPATH=$installLocation:$OLDPYTHONPATH
mkdir -p $installLocation
cd build
make install INSTALL_ROOT="$prefix"
$python -m compileall -d / $prefix/lib/python$pythonVersion
$python -O -m compileall -d / $prefix/lib/python$pythonVersion
packageEntries python310 \
$installLocation \
$commandBinDir
rmdir $prefix/lib/python$pythonVersion
mkdir -p $dataDir
mv $prefix/packages/pyqt5$secondaryArchSuffix-5.15.11-$REVISION/.self/data/sip $dataDir
rm -r $prefix/packages
}