void-packages/srcpkgs/python3-pyside2/template
Đoàn Trần Công Danh 49cb564d14 srcpkgs/p*: convert patches to -Np1
* par is kept at -Np0

```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.-][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.-][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

102 lines
3.2 KiB
Bash

# Template file for 'python3-pyside2'
pkgname=python3-pyside2
version=5.15.2
revision=1
_pkgname="pyside-setup-opensource-src-${version}"
wrksrc="${_pkgname/%5.14.2.1/5.14.2}"
build_wrksrc="sources/pyside2"
build_style=cmake
configure_args="-DPYTHON_EXECUTABLE=/usr/bin/python"
hostmakedepends="cmake python3 shiboken2"
makedepends="python3-devel libshiboken2-devel qt5-devel
qt5-multimedia-devel qt5-tools-devel qt5-plugin-mysql qt5-plugin-odbc
qt5-plugin-pgsql qt5-plugin-sqlite qt5-plugin-tds qt5-x11extras-devel
qt5-xmlpatterns-devel qt5-location-devel qt5-declarative-devel qt5-scxml-devel
qt5-script-devel qt5-sensors-devel qt5-speech-devel qt5-charts-devel
qt5-svg-devel qt5-datavis3d-devel qt5-webchannel-devel qt5-websockets-devel
qt5-3d-devel qt5-gamepad-devel qt5-remoteobjects-devel qt5-quickcontrols2-devel
qt5-serialport-devel
$(vopt_if webengine 'qt5-webengine-devel')"
depends="python3-shiboken2"
checkdepends="python3-distro tzdata pulseaudio qt5-quickcontrols"
short_desc="Python3 bindings for the Qt5 toolkit"
maintainer="yopito <pierre.bourgin@free.fr>"
license="LGPL-3.0-or-later"
homepage="https://wiki.qt.io/Qt_for_Python"
distfiles="https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-${version}-src/${_pkgname}.tar.xz"
checksum=b306504b0b8037079a8eab772ee774b9e877a2d84bab2dbefbe4fa6f83941418
build_options="webengine"
desc_option_webengine="Build Qt5 WebEngine bindings"
subpackages="libpyside2-python3-devel libpyside2-python3"
# needed by shiboken2 runtime
export CLANG_INSTALL_DIR=/usr
if [ ${CROSS_BUILD} ]; then
hostmakedepends+=" qt5-qmake qt5-host-tools qt5-tools qt5-remoteobjects qt5-scxml"
fi
if [ "$XBPS_TARGET_ENDIAN" = "le" ]; then
if [ "$XBPS_TARGET_WORDSIZE" = "$XBPS_WORDSIZE" ]; then
build_options_default="webengine"
fi
fi
if [ "$build_option_webengine" ]; then
subpackages+=" python3-pyside2-webengine"
fi
pre_build() {
if [ ${CROSS_BUILD} ]; then
# make clang of shiboken aware of crossbuild
SHIBOKEN_CLANG_OPTIONS="--target=${XBPS_CROSS_TRIPLET}"
SHIBOKEN_CLANG_OPTIONS+=" --sysroot=/usr/${XBPS_CROSS_TRIPLET}"
# qt5 is built with gcc, so shiboken's clang needs gcc corresponding headers
local gcc_ver="$(${XBPS_CROSS_TRIPLET}-gcc -dumpversion)"
local inc_root="/usr/${XBPS_CROSS_TRIPLET}/usr/include/c++/${gcc_ver}"
SHIBOKEN_CLANG_OPTIONS+=" -isystem ${inc_root}"
SHIBOKEN_CLANG_OPTIONS+=" -isystem ${inc_root}/${XBPS_CROSS_TRIPLET}"
# uneeded so far
SHIBOKEN_CLANG_OPTIONS+=" -isystem ${inc_root}/backward"
export SHIBOKEN_CLANG_OPTIONS
fi
}
pre_check() {
# no virtual backend is fine for OpenGL, vnc is fine for Qml tests
export QT_QPA_PLATFORM=vnc
}
python3-pyside2-webengine_package() {
depends="python3-pyside2-${version}_${revision}"
short_desc+=" - WebEngine component"
pkg_install() {
vmove "${py3_sitelib}/PySide2/QtWebEngine*"
}
}
libpyside2-python3-devel_package() {
depends="${sourcepkg}-${version}_${revision}
libpyside2-python3-${version}_${revision}"
short_desc+=" - shared library (development files)"
pkg_install() {
vmove usr/include
vmove usr/lib/cmake
vmove usr/lib/pkgconfig
vmove "usr/lib/*.so"
vmove usr/share
}
}
libpyside2-python3_package() {
short_desc+=" - shared library"
pkg_install() {
vmove "usr/lib/*.so.*"
}
}