Skip to content

Commit 4503ebe

Browse files
committed
pyside2: add from AUR.
1 parent f4f90c8 commit 4503ebe

File tree

4 files changed

+190
-91
lines changed

4 files changed

+190
-91
lines changed

packages/pyside2/.nvchecker.toml

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
From: Dmitry Shachnev <[email protected]>
2+
Date: Sun, 4 Feb 2024 00:29:00 +0300
3+
Subject: Modify sendCommand signatures to use 0 as default value
4+
5+
The original default value was QNodeCommand::CommandId(), and shiboken
6+
copies it verbatim from the header file, however it does not work because
7+
we do not generate "using namespace Qt3DCore;".
8+
9+
0 is the same as QNodeCommand::CommandId().
10+
---
11+
sources/pyside2/PySide2/Qt3DCore/typesystem_3dcore.xml | 10 ++++++++++
12+
1 file changed, 10 insertions(+)
13+
14+
diff --git a/sources/pyside2/PySide2/Qt3DCore/typesystem_3dcore.xml b/sources/pyside2/PySide2/Qt3DCore/typesystem_3dcore.xml
15+
index 8696a12..310595f 100644
16+
--- a/sources/pyside2/PySide2/Qt3DCore/typesystem_3dcore.xml
17+
+++ b/sources/pyside2/PySide2/Qt3DCore/typesystem_3dcore.xml
18+
@@ -58,6 +58,11 @@
19+
<object-type name="QAspectJob"/>
20+
<object-type name="QBackendNode">
21+
<enum-type name="Mode"/>
22+
+ <modify-function signature="sendCommand(const QString&amp;,const QVariant&amp;,unsigned long long)">
23+
+ <modify-argument index="3">
24+
+ <replace-default-expression with="0"/>
25+
+ </modify-argument>
26+
+ </modify-function>
27+
</object-type>
28+
<!-- TODO: Solve issues related to windows and a unresolved
29+
external symbol
30+
@@ -82,6 +87,11 @@
31+
</object-type>
32+
<object-type name="QNode">
33+
<enum-type name="PropertyTrackingMode"/>
34+
+ <modify-function signature="sendCommand(const QString&amp;,const QVariant&amp;,unsigned long long)">
35+
+ <modify-argument index="3">
36+
+ <replace-default-expression with="0"/>
37+
+ </modify-argument>
38+
+ </modify-function>
39+
</object-type>
40+
<object-type name="QNodeCommand" since="5.10"/>
41+
<object-type name="QNodeCreatedChangeBase"/>

packages/pyside2/PKGBUILD

Lines changed: 118 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,117 +1,148 @@
1-
# Maintainer: Antonio Rojas <[email protected]>
2-
# Maintainer: Felix Yan <[email protected]>
1+
# Maintainer: envolution
2+
# Contributor: Antonio Rojas <[email protected]>
3+
# Contributor: Felix Yan <[email protected]>
4+
# shellcheck shell=bash disable=SC2034,SC2154
35

6+
pkgname=(
7+
pyside2
8+
pyside2-tools
9+
shiboken2
10+
python-shiboken2
11+
)
412
pkgbase=pyside2
5-
pkgname=(shiboken2 python-shiboken2 pyside2 pyside2-tools)
6-
_qtver=5.15.17
7-
pkgver=${_qtver/-/}
13+
pkgver=5.15.16+3.1
814
pkgrel=1
15+
pkgdesc="CPython bindings generator for C++ libraries - Debian rel ${pkgver#*+}"
916
arch=('x86_64' 'aarch64')
10-
url='https://www.qt.io'
11-
license=(LGPL)
12-
makedepends=(cmake python-setuptools python-wheel llvm clang
13-
qt5-multimedia qt5-tools qt5-sensors qt5-charts qt5-webengine qt5-datavis3d
14-
qt5-websockets qt5-speech qt5-3d qt5-svg qt5-script qt5-scxml qt5-x11extras
15-
qt5-quickcontrols2 qt5-serialport qt5-remoteobjects qt5-xmlpatterns)
16-
optdepends=('qt5-svg: QtSvg bindings'
17-
'qt5-script: QtScript bindings'
18-
'qt5-speech: QtTextToSpeech bindings'
19-
'qt5-websockets: QtWebSockets bindings'
20-
'qt5-webengine: QtWebEngine bindings'
21-
'qt5-datavis3d: QtDataVisualization bindings'
22-
'qt5-scxml: QtScxml bindings'
23-
'qt5-sensors: QtSensors bindings'
24-
'qt5-3d: Qt3D bindings'
25-
'qt5-x11extras: QtX11Extras bindings'
26-
'qt5-charts: QtCharts bindings'
27-
'qt5-tools: QtHelp bindings'
28-
'qt5-remoteobjects: QtRemoteObjects bindings'
29-
'qt5-serialport: QtSerialPort bindings'
30-
'qt5-quickcontrols2: QtQuickControls2 bindings')
31-
_pkgfqn=pyside-setup-opensource-src-$_qtver
32-
source=(https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-$pkgver-src/${_pkgfqn}.tar.xz)
33-
sha512sums=('c9931f05c6b5505329c8672cd7dd25309c32142f03d69e01e2e645661ec98292bf20f15e003c5f90a39817f49e0317badab4f7e38a108d2ef3fc1e3a59836d39')
34-
35-
prepare(){
36-
cd "$srcdir/$_pkgfqn"
37-
38-
# https://github.com/python/cpython/issues/118777
39-
sed '/PyObject \*dict = type->tp_dict;/a\ if (dict == NULL) dict = PyType_GetDict(type);' -i sources/shiboken2/libshiboken/signature/signature_helper.cpp
40-
41-
# https://github.com/arch4edu/arch4edu/issues/268
42-
sed '/typing.TypeVar.__repr__ = _typevar__repr__/d' -i sources/pyside2/PySide2/support/generate_pyi.py
43-
44-
sed '/check_allowed_python_version()/d' -i setup.py
17+
url="https://wiki.qt.io/Qt_for_Python"
18+
license=('LGPL-3.0-or-later')
19+
depends=(qt5-multimedia qt5-tools qt5-sensors qt5-charts qt5-webengine qt5-datavis3d
20+
qt5-websockets qt5-speech qt5-3d qt5-svg qt5-script qt5-scxml qt5-x11extras
21+
qt5-quickcontrols2 qt5-serialport qt5-remoteobjects qt5-xmlpatterns)
22+
makedepends=(cmake python-setuptools python-wheel llvm clang)
23+
24+
_debver="${pkgver/+/-}"
25+
_pkgver="${pkgver%%+*}"
26+
27+
source=(
28+
"https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-${_pkgver}-src/pyside-setup-opensource-src-${_pkgver}.tar.xz"
29+
"http://deb.debian.org/debian/pool/main/p/pyside2/pyside2_${_debver}.debian.tar.xz"
30+
Modify-sendCommand-signatures.patch
31+
cmake-findpython.patch
32+
)
33+
34+
sha256sums=('6d3ed6fd17275ea74829ab56df9c2e7641bfca6b5b201cf244998fa81cf07360'
35+
'523d191e45b1a9720e8eb8ea66fd930f49ffad54df1295ca09efea8838257aa6'
36+
'2f39461136a718a9f75bd94c1e71fc358764af25f68c650fd503c777e32ff302'
37+
'4d82961c7f978dadae6e82c73fb0a239dbb62db5f66106975f75dd25161843e9')
38+
39+
_pkgdir="pyside-setup-opensource-src-${_pkgver}"
40+
41+
_get_python_libdir() {
42+
python -c "from sysconfig import get_path; print(get_path('platlib'))"
43+
}
44+
45+
prepare() {
46+
mapfile -t _patch_series <debian/patches/series
47+
cd $_pkgdir
48+
for _patch in "${_patch_series[@]}"; do
49+
patch -Np1 -i "../debian/patches/$_patch"
50+
done
51+
patch -Np1 -i ../Modify-sendCommand-signatures.patch
52+
patch -Np1 -i ../cmake-findpython.patch
4553
}
4654

4755
build() {
48-
cmake -B build -S $_pkgfqn \
49-
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
50-
-DCMAKE_INSTALL_PREFIX=/usr \
51-
-DCMAKE_BUILD_TYPE=None \
52-
-DBUILD_TESTS=OFF \
53-
-DPYTHON_EXECUTABLE=/usr/bin/python
54-
cmake --build build
56+
local _pythonpath="$(_get_python_libdir)"
57+
cd $_pkgdir
58+
export LLVM_INSTALL_DIR='/usr/bin'
59+
CFLAGS="-I${_pythonpath}/numpy/_core/include $CFLAGS"
60+
CXXFLAGS="-I${_pythonpath}/numpy/_core/include $CXXFLAGS"
61+
if [ ! -f "./.build-complete" ]; then
62+
cmake -B build -S "./" \
63+
-DCMAKE_INSTALL_PREFIX=/usr \
64+
-DCMAKE_BUILD_TYPE=None \
65+
-DBUILD_TESTS=OFF \
66+
-DPYTHON_EXECUTABLE=/usr/bin/python \
67+
-DPYTHON_CONFIG_SUFFIX='python-config' \
68+
-DCMAKE_POLICY_VERSION_MINIMUM=3.30
69+
70+
cmake --build build
71+
else
72+
msg2 'Pyside2 build cache found, skipping configuration and compilation. Remove ${pkgdir}/.build-complete to build again'
73+
fi
74+
touch .build-complete
5575
}
5676

5777
package_shiboken2() {
5878
pkgdesc='Generates bindings for C++ libraries using CPython source code'
59-
depends=(clang llvm libxslt qt5-xmlpatterns)
79+
depends=('clang' 'llvm' 'libxslt' 'qt5-xmlpatterns')
80+
81+
cd $_pkgdir
82+
DESTDIR="${pkgdir}" cmake --install build/sources/shiboken2
6083

61-
DESTDIR="$pkgdir" cmake --install build/sources/shiboken2
62-
# Provided in python-shiboken2
63-
rm -r "$pkgdir"/usr/lib/{python*,libshiboken*}
64-
# Conflicts with shiboken6 and doesn't work anyway
65-
rm "$pkgdir"/usr/bin/shiboken_tool.py
84+
# Remove files conflicting with other packages
85+
rm -r "${pkgdir}"/usr/lib/{python*,libshiboken*}
86+
rm "${pkgdir}/usr/bin/shiboken_tool.py"
6687
}
6788

6889
package_python-shiboken2() {
6990
pkgdesc='Python bindings for shiboken2'
70-
depends=(python)
91+
depends=('python' 'python-numpy' 'pyside2')
92+
local _pythonpath="$(_get_python_libdir)"
93+
94+
cd $_pkgdir
95+
DESTDIR="${pkgdir}" cmake --install build/sources/shiboken2
7196

72-
DESTDIR="$pkgdir" cmake --install build/sources/shiboken2
73-
# Provided in shiboken2
74-
rm -r "$pkgdir"/usr/{bin,include,lib/{cmake,pkgconfig}}
97+
# Remove unnecessary files
98+
rm -r "${pkgdir}"/usr/{bin,include,lib/{cmake,pkgconfig}}
7599

76-
# Install egg-info
77-
cd $_pkgfqn
100+
# Install egg-info
78101
python setup.py egg_info --build-type=shiboken2
79-
_pythonpath=`python -c "from sysconfig import get_path; print(get_path('platlib'))"`
80-
cp -r shiboken2.egg-info "$pkgdir"/$_pythonpath
102+
install -dm755 "${pkgdir}${_pythonpath}/shiboken2.egg-info"
103+
mv shiboken2.egg-info "${pkgdir}${_pythonpath}/shiboken2.egg-info"
81104
}
82105

83106
package_pyside2() {
84107
pkgdesc='Enables the use of Qt5 APIs in Python applications'
85-
depends=(python-shiboken2 qt5-declarative)
86-
optdepends=('qt5-svg: QtSvg bindings'
87-
'qt5-script: QtScript bindings'
88-
'qt5-speech: QtTextToSpeech bindings'
89-
'qt5-websockets: QtWebSockets bindings'
90-
'qt5-webengine: QtWebEngine bindings'
91-
'qt5-datavis3d: QtDataVisualization bindings'
92-
'qt5-scxml: QtScxml bindings'
93-
'qt5-sensors: QtSensors bindings'
94-
'qt5-3d: Qt3D bindings'
95-
'qt5-x11extras: QtX11Extras bindings'
96-
'qt5-charts: QtCharts bindings'
97-
'qt5-tools: QtHelp bindings'
98-
'qt5-remoteobjects: QtRemoteObjects bindings'
99-
'qt5-serialport: QtSerialPort bindings'
100-
'qt5-quickcontrols2: QtQuickControls2 bindings')
101-
provides=(qt5-python-bindings)
102-
103-
DESTDIR="$pkgdir" cmake --install build/sources/pyside2
104-
# Install egg-info
105-
cd $_pkgfqn
108+
depends=('python-shiboken2' 'qt5-declarative' 'qt5-xmlpatterns' 'shiboken2')
109+
optdepends=(
110+
'qt5-svg: QtSvg bindings'
111+
'qt5-script: QtScript bindings'
112+
'qt5-speech: QtTextToSpeech bindings'
113+
'qt5-websockets: QtWebSockets bindings'
114+
'qt5-webengine: QtWebEngine bindings'
115+
'qt5-datavis3d: QtDataVisualization bindings'
116+
'qt5-scxml: QtScxml bindings'
117+
'qt5-sensors: QtSensors bindings'
118+
'qt5-3d: Qt3D bindings'
119+
'qt5-x11extras: QtX11Extras bindings'
120+
'qt5-charts: QtCharts bindings'
121+
'qt5-tools: QtHelp bindings'
122+
'qt5-remoteobjects: QtRemoteObjects bindings'
123+
'qt5-serialport: QtSerialPort bindings'
124+
'qt5-quickcontrols2: QtQuickControls2 bindings'
125+
)
126+
provides=('qt5-python-bindings')
127+
local _pythonpath="$(_get_python_libdir)"
128+
129+
cd $_pkgdir
130+
DESTDIR="${pkgdir}" cmake --install build/sources/pyside2
131+
132+
# Install egg-info
106133
python setup.py egg_info --build-type=pyside2
107-
_pythonpath=`python -c "from sysconfig import get_path; print(get_path('platlib'))"`
108-
cp -r PySide2.egg-info "$pkgdir"/$_pythonpath
134+
install -dm755 "${pkgdir}${_pythonpath}/PySide2.egg-info"
135+
mv PySide2.egg-info "${pkgdir}${_pythonpath}/PySide2.egg-info"
109136
}
110137

111138
package_pyside2-tools() {
112139
pkgdesc='Tools for PySide2'
113-
depends=(pyside2)
140+
depends=('pyside2' 'qt5-base' 'gcc-libs' 'glibc')
141+
142+
cd $_pkgdir
143+
DESTDIR="${pkgdir}" cmake --install build/sources/pyside2-tools
114144

115-
DESTDIR="$pkgdir" cmake --install build/sources/pyside2-tools
116-
rm "$pkgdir"/usr/bin/{rcc,uic,designer,pyside_tool.py} # provided by qt5-base
145+
# Remove files provided by qt5-base
146+
rm "${pkgdir}/usr/bin/"{rcc,uic,designer,pyside_tool.py}
117147
}
148+
# vim:set ts=2 sw=2 et:
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
--- pyside-setup-opensource-src-5.15.16/sources/shiboken2/data/shiboken_helpers.cmake 2024-11-11 08:14:27.000000000 -0500
2+
+++ pyside-setup-opensource-src-5.15.16/sources/shiboken2/data/shiboken_helpers.cmake.patch 2025-03-30 16:29:05.997004168 -0400
3+
@@ -315,14 +315,24 @@
4+
5+
macro(shiboken_find_required_python)
6+
if(${ARGC} GREATER 0)
7+
- find_package(PythonInterp ${ARGV0} REQUIRED)
8+
- find_package(PythonLibs ${ARGV0} REQUIRED)
9+
+ find_package(Python ${ARGV0} REQUIRED COMPONENTS Interpreter Development)
10+
+ set(PYTHONINTERP_FOUND ${Python_Interpreter_FOUND})
11+
+ set(PYTHONLIBS_FOUND ${Python_Development_FOUND})
12+
+ set(PYTHON_EXECUTABLE ${Python_EXECUTABLE})
13+
+ set(PYTHON_INCLUDE_DIRS ${Python_INCLUDE_DIRS})
14+
+ set(PYTHON_LIBRARIES ${Python_LIBRARIES})
15+
+ set(PYTHON_VERSION "${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}")
16+
else()
17+
# If no version is specified, just use any interpreter that can be found (from PATH).
18+
# This is useful for super-project builds, so that the default system interpeter
19+
# gets picked up (e.g. /usr/bin/python and not /usr/bin/python2.7).
20+
- find_package(PythonInterp REQUIRED)
21+
- find_package(PythonLibs REQUIRED)
22+
+ find_package(Python REQUIRED COMPONENTS Interpreter Development)
23+
+ set(PYTHONINTERP_FOUND ${Python_Interpreter_FOUND})
24+
+ set(PYTHONLIBS_FOUND ${Python_Development_FOUND})
25+
+ set(PYTHON_EXECUTABLE ${Python_EXECUTABLE})
26+
+ set(PYTHON_INCLUDE_DIRS ${Python_INCLUDE_DIRS})
27+
+ set(PYTHON_LIBRARIES ${Python_LIBRARIES})
28+
+ set(PYTHON_VERSION "${Python_VERSION_MAJOR}.${Python_VERSION_MINOR}")
29+
endif()
30+
shiboken_validate_python_version()
31+

0 commit comments

Comments
 (0)