void-packages/srcpkgs/python3-pyside6/template

137 lines
4.1 KiB
Bash

# Template file for 'python3-pyside6'.
# NOTE: keep in sync with Qt6
pkgname=python3-pyside6
version=6.7.2
revision=1
build_style=cmake
configure_args="-DBUILD_TESTS=OFF -DFORCE_LIMITED_API=no -DNO_QT_TOOLS=yes
-DNUMPY_INCLUDE_DIR=/${py3_sitelib}/numpy/_core/include
-DPYTHON_EXECUTABLE=/usr/bin/python3 -Wno-dev"
hostmakedepends="python3-numpy python3-setuptools qt6-base"
makedepends="libedit-devel libxslt-devel llvm17-devel python3-devel qt6-3d-devel
qt6-base-private-devel qt6-charts-devel qt6-connectivity-devel
qt6-declarative-private-devel qt6-location-devel qt6-multimedia-devel
qt6-networkauth-devel qt6-position-devel qt6-quick3d-devel
qt6-remoteobjects-devel qt6-scxml-devel qt6-sensors-devel qt6-serialport-devel
qt6-shadertools-devel qt6-speech-devel qt6-speech-plugin-flite
qt6-speech-plugin-mock qt6-speech-plugin-speechd qt6-svg-devel qt6-tools-devel
qt6-webchannel-devel qt6-websockets-devel $(vopt_if pdf qt6-pdf-devel)
$(vopt_if webengine qt6-webengine-devel)"
depends="python3-shiboken6"
short_desc="Python bindings of Qt6-based libraries"
maintainer="chrysos349 <chrysostom349@gmail.com>"
license="LGPL-3.0-only, GPL-2.0-only"
homepage="https://doc.qt.io/qtforpython-6"
distfiles="https://download.qt.io/official_releases/QtForPython/pyside6/PySide6-${version}-src/pyside-setup-everywhere-src-${version}.tar.xz"
checksum=3a2b0d0d6e78c9aa5ddc7f06ca4b6f11a3fe14560baeb148eea53b5d98e368c7
conflicts="pyside2-tools"
build_options="pdf webengine"
subpackages="libpyside6 libpyside6-devel libshiboken6 libshiboken6-devel python3-shiboken6"
case "$XBPS_TARGET_MACHINE" in
armv5*|armv6*) build_options_default="" ;;
*) build_options_default="pdf" ;;
esac
export LLVM_INSTALL_DIR=${XBPS_CROSS_BASE}/usr
export PYTHONPATH=$PYTHONPATH:${XBPS_BUILDDIR}/${pkgname}-${version}/build/sources
if [ "$XBPS_WORDSIZE$XBPS_WORDSIZE" = "64$XBPS_TARGET_WORDSIZE" ]; then
build_options_default+=" webengine"
subpackages+=" python3-pyside6-webengine"
fi
if [ "$CROSS_BUILD" ]; then
hostmakedepends+=" libglvnd-devel libshiboken6-devel shiboken6"
case "$XBPS_TARGET_MACHINE" in
x86_64*|aarch64*) makedepends+=" libomp-devel" ;;
esac
configure_args+="
-DQFP_PYTHON_HOST_PATH=/usr/bin/python3
-DQFP_PYTHON_SITE_PACKAGES=/${py3_sitelib}"
else
subpackages+=" shiboken6"
fi
post_patch() {
if [ "$CROSS_BUILD" ]; then
# fix pkg-config file on cross
vsed -i sources/shiboken6/data/shiboken6.pc.in \
-e "s/Python_EXECUTABLE/QFP_PYTHON_HOST_PATH/"
fi
}
post_install() {
# remove extraneous scripts/files
find "$DESTDIR"/usr/bin -not -name shiboken6 -type f -delete
}
libpyside6_package() {
short_desc+=" - shared library"
pkg_install() {
vmove "usr/lib/libpyside*.so.*"
}
}
libpyside6-devel_package() {
depends="libpyside6-${version}_${revision} python3-pyside6-${version}_${revision}
libshiboken6-devel-${version}_${revision}"
short_desc+=" - development files"
pkg_install() {
vmove "usr/lib/cmake/PySide*"
vmove "usr/lib/libpyside*.so"
vmove usr/lib/qt6
vmove usr/include/PySide6
vmove usr/lib/pkgconfig/pyside6.pc
vmove usr/share
}
}
libshiboken6_package() {
short_desc="CPython bindings generator for C++ libraries - shared library"
pkg_install() {
vmove "usr/lib/libshiboken6.so.*"
}
}
libshiboken6-devel_package() {
depends="libshiboken6-${version}_${revision} python3-shiboken6-${version}_${revision}"
short_desc="CPython bindings generator for C++ libraries - development files"
pkg_install() {
vmove "usr/lib/cmake/Shiboken*"
vmove usr/include/shiboken6
vmove usr/lib/libshiboken6.so
vmove usr/lib/pkgconfig/shiboken6.pc
}
}
python3-shiboken6_package() {
short_desc="Python shiboken6 bindings"
depends="python3"
pkg_install() {
vmove ${py3_sitelib}/shiboken6
}
}
shiboken6_package() {
short_desc="CPython bindings generator for C++ libraries"
depends="python3"
conflicts="shiboken2"
pkg_install() {
vmove "usr/bin/shiboken*"
vmove ${py3_sitelib}/shiboken6_generator
}
}
python3-pyside6-webengine_package() {
depends="python3-pyside6-${version}_${revision}"
short_desc+=" - WebEngine component"
pkg_install() {
vmove "${py3_sitelib}/PySide6/QtWebEngine*"
}
}