206 lines
8.0 KiB
Bash
206 lines
8.0 KiB
Bash
# Maintainer: Alexey Pavlov <alexpux@gmail.com>
|
|
# Contributor: Andrew Smeltzov <andrew.smeltzov@gmail.com>
|
|
|
|
_realname=pyside2
|
|
pkgbase=mingw-w64-${_realname}
|
|
pkgname=(${MINGW_PACKAGE_PREFIX}-shiboken2
|
|
${MINGW_PACKAGE_PREFIX}-${_realname}
|
|
${MINGW_PACKAGE_PREFIX}-${_realname}-tools)
|
|
pkgdesc="Provides LGPL Qt5 bindings for Python and related tools for binding generation (mingw-w64)"
|
|
pkgver=5.15.17
|
|
pkgrel=1
|
|
arch=('any')
|
|
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
|
|
url="https://doc.qt.io/qtforpython-5/"
|
|
msys2_references=(
|
|
'purl: pkg:pypi/pyside2'
|
|
)
|
|
license=('spdx:LGPL-3.0-only OR GPL-3.0-or-later')
|
|
makedepends=("${MINGW_PACKAGE_PREFIX}-cc"
|
|
"${MINGW_PACKAGE_PREFIX}-cmake"
|
|
"${MINGW_PACKAGE_PREFIX}-ninja"
|
|
"${MINGW_PACKAGE_PREFIX}-clang"
|
|
"${MINGW_PACKAGE_PREFIX}-llvm-tools"
|
|
"${MINGW_PACKAGE_PREFIX}-python-setuptools"
|
|
"${MINGW_PACKAGE_PREFIX}-qt5-declarative"
|
|
"${MINGW_PACKAGE_PREFIX}-qt5-winextras"
|
|
"${MINGW_PACKAGE_PREFIX}-qt5-xmlpatterns"
|
|
"${MINGW_PACKAGE_PREFIX}-qt5-tools"
|
|
"${MINGW_PACKAGE_PREFIX}-qt5-multimedia"
|
|
"${MINGW_PACKAGE_PREFIX}-qt5-location"
|
|
"${MINGW_PACKAGE_PREFIX}-qt5-quickcontrols2"
|
|
"${MINGW_PACKAGE_PREFIX}-qt5-remoteobjects"
|
|
"${MINGW_PACKAGE_PREFIX}-qt5-scxml"
|
|
"${MINGW_PACKAGE_PREFIX}-qt5-script"
|
|
"${MINGW_PACKAGE_PREFIX}-qt5-sensors"
|
|
"${MINGW_PACKAGE_PREFIX}-qt5-serialport"
|
|
"${MINGW_PACKAGE_PREFIX}-qt5-speech"
|
|
"${MINGW_PACKAGE_PREFIX}-qt5-charts"
|
|
"${MINGW_PACKAGE_PREFIX}-qt5-svg"
|
|
"${MINGW_PACKAGE_PREFIX}-qt5-datavis3d"
|
|
"${MINGW_PACKAGE_PREFIX}-qt5-activeqt"
|
|
"${MINGW_PACKAGE_PREFIX}-qt5-webchannel"
|
|
"${MINGW_PACKAGE_PREFIX}-qt5-websockets"
|
|
"${MINGW_PACKAGE_PREFIX}-qt5-3d"
|
|
"${MINGW_PACKAGE_PREFIX}-qt5-gamepad")
|
|
_pkgfqn=pyside-setup-opensource-src-$pkgver
|
|
source=(https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-${pkgver}-src/${_pkgfqn}.tar.xz
|
|
001-pyside.patch
|
|
002-shiboken.patch
|
|
003-cmake-relative-paths.patch
|
|
004-llvm-paths.patch
|
|
010-Python-3.12-Fix-the-structure-of-class-property.patch
|
|
011-Support-running-PySide-on-Python-3.12.patch
|
|
012-Final-details-to-enable-3.12-wheel-compatibility.patch)
|
|
noextract=("${_pkgfqn}.tar.xz")
|
|
sha256sums=('84a4b328f6a60235b8717ad522b88a7b600059260c57a2189ed005109f24c527'
|
|
'8120f1d29c4fe6928ab58d01586370af6d7c03f5a4c656d3e80ea03965a032d5'
|
|
'8fe6965a942fd527d77d38c2a0b8e5c4f9bc1b51999f292af7a656b55a443713'
|
|
'09c076b3fd61d8b972f05996e1383b6f31a695a8ae5db1aa6e0d9512d34db681'
|
|
'75e720dc346d92167a6b6dde241f467ecdb1d1c4b9085843755b782f8c6c80a8'
|
|
'77a851ed10997bd4e4990fd9d30f1a727efe4b0b0eb8c86eac9a7d712f88ec96'
|
|
'b47d8709ecfe7347bb0f4e55ede8d756270ccce6daf5ef18fe503237f60be1bc'
|
|
'6a904d070d1f25217a0ec58ce903a193369a12a5e6997ed11ccceb497aee7e66')
|
|
|
|
apply_patch_with_msg() {
|
|
for _patch in "$@"
|
|
do
|
|
msg2 "Applying ${_patch}"
|
|
patch -Nbp1 -i "${srcdir}/${_patch}"
|
|
done
|
|
}
|
|
|
|
prepare() {
|
|
cd "${srcdir}"
|
|
tar -xJf "${srcdir}"/${_pkgfqn}.tar.xz -C "${srcdir}" || true
|
|
|
|
cd "${srcdir}"/${_pkgfqn}
|
|
|
|
apply_patch_with_msg \
|
|
001-pyside.patch \
|
|
002-shiboken.patch \
|
|
003-cmake-relative-paths.patch \
|
|
004-llvm-paths.patch
|
|
|
|
# https://salsa.debian.org/qt-kde-team/qt/pyside2/-/commit/34279c27272f57c3be78ed71bde92c477bb3a894
|
|
apply_patch_with_msg \
|
|
010-Python-3.12-Fix-the-structure-of-class-property.patch \
|
|
011-Support-running-PySide-on-Python-3.12.patch \
|
|
012-Final-details-to-enable-3.12-wheel-compatibility.patch
|
|
}
|
|
|
|
build() {
|
|
mkdir -p "${srcdir}"/build-${MSYSTEM} && cd "${srcdir}"/build-${MSYSTEM}
|
|
|
|
declare -a _extra_config
|
|
if check_option "debug" "n"; then
|
|
_extra_config+=("-DCMAKE_BUILD_TYPE=Release")
|
|
else
|
|
_extra_config+=("-DCMAKE_BUILD_TYPE=Debug")
|
|
fi
|
|
|
|
MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX" \
|
|
${MINGW_PREFIX}/bin/cmake.exe \
|
|
-G"Ninja" \
|
|
-DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \
|
|
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
|
|
${_extra_config[@]} \
|
|
-DBUILD_TESTS=OFF \
|
|
-DPYTHON_EXECUTABLE=${MINGW_PREFIX}/bin/python.exe \
|
|
../${_pkgfqn}
|
|
|
|
MSYS2_ARG_CONV_EXCL="--include-paths=;--typesystem-paths=" \
|
|
${MINGW_PREFIX}/bin/cmake.exe --build ./
|
|
}
|
|
|
|
package_shiboken2() {
|
|
pkgdesc="CPython bindings generator for C++ libraries (mingw-w64)"
|
|
depends=("${MINGW_PACKAGE_PREFIX}-clang-libs"
|
|
"${MINGW_PACKAGE_PREFIX}-python"
|
|
"${MINGW_PACKAGE_PREFIX}-qt5-xmlpatterns"
|
|
"${MINGW_PACKAGE_PREFIX}-libxslt")
|
|
|
|
DESTDIR="${pkgdir}" ${MINGW_PREFIX}/bin/cmake.exe --install build-${MSYSTEM}/sources/shiboken2
|
|
|
|
local _PREFIX_WIN=$(cygpath -wm ${MINGW_PREFIX})
|
|
for _f in "${pkgdir}${MINGW_PREFIX}"/lib/pkgconfig/*.pc; do
|
|
sed -s "s|${_PREFIX_WIN}|${MINGW_PREFIX}|g" -i "${_f}"
|
|
done
|
|
|
|
# Conflicts with shiboken6
|
|
rm "$pkgdir"${MINGW_PREFIX}/bin/shiboken_tool.py
|
|
|
|
for _f in "${pkgdir}${MINGW_PREFIX}"/lib/cmake/Shiboken2-${pkgver}/*.cmake; do
|
|
sed -e "s|${MINGW_PREFIX}|\$\{_IMPORT_PREFIX\}|g" -i "${_f}"
|
|
done
|
|
|
|
# Install egg-info
|
|
cd "${srcdir}"/${_pkgfqn}
|
|
${MINGW_PREFIX}/bin/python setup.py egg_info --build-type=shiboken2
|
|
_pythonpath=`${MINGW_PREFIX}/bin/python -c "from sysconfig import get_path; print(get_path('platlib'))"`
|
|
cp -r shiboken2.egg-info "$pkgdir"/$(cygpath ${_pythonpath})
|
|
}
|
|
|
|
package_pyside2() {
|
|
pkgdesc="Provides LGPL Qt5 bindings for Python and related tools for binding generation (mingw-w64)"
|
|
depends=("${MINGW_PACKAGE_PREFIX}-python"
|
|
"${MINGW_PACKAGE_PREFIX}-shiboken2"
|
|
"${MINGW_PACKAGE_PREFIX}-qt5-declarative")
|
|
optdepends=("${MINGW_PACKAGE_PREFIX}-qt5-winextras"
|
|
"${MINGW_PACKAGE_PREFIX}-qt5-xmlpatterns"
|
|
"${MINGW_PACKAGE_PREFIX}-qt5-tools"
|
|
"${MINGW_PACKAGE_PREFIX}-qt5-multimedia"
|
|
"${MINGW_PACKAGE_PREFIX}-qt5-location"
|
|
"${MINGW_PACKAGE_PREFIX}-qt5-quickcontrols2"
|
|
"${MINGW_PACKAGE_PREFIX}-qt5-remoteobjects"
|
|
"${MINGW_PACKAGE_PREFIX}-qt5-scxml"
|
|
"${MINGW_PACKAGE_PREFIX}-qt5-script"
|
|
"${MINGW_PACKAGE_PREFIX}-qt5-sensors"
|
|
"${MINGW_PACKAGE_PREFIX}-qt5-serialport"
|
|
"${MINGW_PACKAGE_PREFIX}-qt5-speech"
|
|
"${MINGW_PACKAGE_PREFIX}-qt5-charts"
|
|
"${MINGW_PACKAGE_PREFIX}-qt5-svg"
|
|
"${MINGW_PACKAGE_PREFIX}-qt5-datavis3d"
|
|
"${MINGW_PACKAGE_PREFIX}-qt5-activeqt"
|
|
"${MINGW_PACKAGE_PREFIX}-qt5-webchannel"
|
|
"${MINGW_PACKAGE_PREFIX}-qt5-websockets"
|
|
"${MINGW_PACKAGE_PREFIX}-qt5-3d")
|
|
|
|
DESTDIR="${pkgdir}" ${MINGW_PREFIX}/bin/cmake.exe --install build-${MSYSTEM}/sources/pyside2
|
|
|
|
local _PREFIX_WIN=$(cygpath -wm ${MINGW_PREFIX})
|
|
for _f in "${pkgdir}${MINGW_PREFIX}"/lib/pkgconfig/*.pc; do
|
|
sed -s "s|${_PREFIX_WIN}|${MINGW_PREFIX}|g" -i "${_f}"
|
|
done
|
|
|
|
for _f in "${pkgdir}${MINGW_PREFIX}"/lib/cmake/PySide2-${pkgver}/*.cmake; do
|
|
sed -e "s|${MINGW_PREFIX}|\$\{_IMPORT_PREFIX\}|g" -i "${_f}"
|
|
done
|
|
|
|
# Install egg-info
|
|
cd "${srcdir}"/${_pkgfqn}
|
|
${MINGW_PREFIX}/bin/python setup.py egg_info --build-type=pyside2
|
|
_pythonpath=`${MINGW_PREFIX}/bin/python -c "from sysconfig import get_path; print(get_path('platlib'))"`
|
|
cp -r pyside2.egg-info "$pkgdir"/$(cygpath ${_pythonpath})
|
|
}
|
|
|
|
package_pyside2-tools() {
|
|
pkgdesc="PySide2 Tools (mingw-w64)"
|
|
depends=("${MINGW_PACKAGE_PREFIX}-pyside2")
|
|
|
|
DESTDIR="${pkgdir}" ${MINGW_PREFIX}/bin/cmake.exe --install build-${MSYSTEM}/sources/pyside2-tools
|
|
|
|
rm -f "${pkgdir}"${MINGW_PREFIX}/bin/{rcc,uic,designer}.exe # provided by qt5-base
|
|
}
|
|
|
|
# template start; name=mingw-w64-splitpkg-wrappers; version=1.0;
|
|
# vim: set ft=bash :
|
|
|
|
# generate wrappers
|
|
for _name in "${pkgname[@]}"; do
|
|
_short="package_${_name#${MINGW_PACKAGE_PREFIX}-}"
|
|
_func="$(declare -f "${_short}")"
|
|
eval "${_func/#${_short}/package_${_name}}"
|
|
done
|
|
# template end;
|