|
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 |
3 | 5 |
|
| 6 | +pkgname=( |
| 7 | + pyside2 |
| 8 | + pyside2-tools |
| 9 | + shiboken2 |
| 10 | + python-shiboken2 |
| 11 | +) |
4 | 12 | 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 |
8 | 14 | pkgrel=1
|
| 15 | +pkgdesc="CPython bindings generator for C++ libraries - Debian rel ${pkgver#*+}" |
9 | 16 | 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 |
45 | 53 | }
|
46 | 54 |
|
47 | 55 | 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 |
55 | 75 | }
|
56 | 76 |
|
57 | 77 | package_shiboken2() {
|
58 | 78 | 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 |
60 | 83 |
|
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" |
66 | 87 | }
|
67 | 88 |
|
68 | 89 | package_python-shiboken2() {
|
69 | 90 | 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 |
71 | 96 |
|
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}} |
75 | 99 |
|
76 |
| -# Install egg-info |
77 |
| - cd $_pkgfqn |
| 100 | + # Install egg-info |
78 | 101 | 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" |
81 | 104 | }
|
82 | 105 |
|
83 | 106 | package_pyside2() {
|
84 | 107 | 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 |
106 | 133 | 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" |
109 | 136 | }
|
110 | 137 |
|
111 | 138 | package_pyside2-tools() {
|
112 | 139 | 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 |
114 | 144 |
|
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} |
117 | 147 | }
|
| 148 | +# vim:set ts=2 sw=2 et: |
0 commit comments