db-move: moved polari from [testing] to [extra] (x86_64)
[arch-packages.git] / pyside2 / trunk / PKGBUILD
blobc34f02d30edfbe72840d2c75a087affc3279833f
1 # Maintainer: Antonio Rojas <arojas@archlinux.org>
2 # Maintainer: Felix Yan <felixonmars@archlinux.org>
4 pkgbase=pyside2
5 pkgname=(shiboken2 python-shiboken2 pyside2 pyside2-tools)
6 _qtver=5.15.9
7 _clangver=15.0.7
8 pkgver=${_qtver/-/}
9 pkgrel=5
10 arch=(x86_64)
11 url='https://www.qt.io'
12 license=(LGPL)
13 makedepends=(cmake python-setuptools llvm clang=$_clangver
14              qt5-multimedia qt5-tools qt5-sensors qt5-charts qt5-webengine qt5-datavis3d
15              qt5-websockets qt5-speech qt5-3d qt5-svg qt5-script qt5-scxml qt5-x11extras
16              qt5-quickcontrols2 qt5-serialport qt5-remoteobjects qt5-xmlpatterns)
17 optdepends=('qt5-svg: QtSvg bindings'
18             'qt5-script: QtScript bindings'
19             'qt5-speech: QtTextToSpeech bindings'
20             'qt5-websockets: QtWebSockets bindings'
21             'qt5-webengine: QtWebEngine bindings'
22             'qt5-datavis3d: QtDataVisualization bindings'
23             'qt5-scxml: QtScxml bindings'
24             'qt5-sensors: QtSensors bindings'
25             'qt5-3d: Qt3D bindings'
26             'qt5-x11extras: QtX11Extras bindings'
27             'qt5-charts: QtCharts bindings'
28             'qt5-tools: QtHelp bindings'
29             'qt5-remoteobjects: QtRemoteObjects bindings'
30             'qt5-serialport: QtSerialPort bindings'
31             'qt5-quickcontrols2: QtQuickControls2 bindings')
32 _pkgfqn=pyside-setup-opensource-src-$_qtver
33 source=(https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-$pkgver-src/${_pkgfqn}-1.tar.xz
34         python3.11.patch)
35 sha256sums=('3298660742037c71274a30770541abf6d1552ec65fc93678eedee5718852a62c'
36             'e91549f7d3da412e864af26f604d0023b80233a7165f50fa21e53cbe861db886')
38 prepare() {
39   patch -d $_pkgfqn -p1 < python3.11.patch # Fix build with Python 3.11
40   sed -e 's|0x030AFFFF|0x030BFFFF|' -i $_pkgfqn/sources/shiboken2/libshiboken/pep384impl.h
43 build() {
44   cmake -B build -S $_pkgfqn \
45     -DCMAKE_INSTALL_PREFIX=/usr \
46     -DCMAKE_BUILD_TYPE=None \
47     -DBUILD_TESTS=OFF \
48     -DPYTHON_EXECUTABLE=/usr/bin/python
49   cmake --build build
52 package_shiboken2() {
53   pkgdesc='Generates bindings for C++ libraries using CPython source code'
54   depends=(clang=$_clangver llvm libxslt qt5-xmlpatterns)
56   DESTDIR="$pkgdir" cmake --install build/sources/shiboken2
57 # Provided in python-shiboken2
58   rm -r "$pkgdir"/usr/lib/{python*,libshiboken*}
59 # Conflicts with shiboken6 and doesn't work anyway
60   rm "$pkgdir"/usr/bin/shiboken_tool.py
63 package_python-shiboken2() {
64   pkgdesc='Python bindings for shiboken2'
65   depends=(python)
67   DESTDIR="$pkgdir" cmake --install build/sources/shiboken2
68 # Provided in shiboken2
69   rm -r "$pkgdir"/usr/{bin,include,lib/{cmake,pkgconfig}}
71 # Install egg-info
72   cd $_pkgfqn
73   python setup.py egg_info --build-type=shiboken2
74   _pythonpath=`python -c "from sysconfig import get_path; print(get_path('platlib'))"`
75   cp -r shiboken2.egg-info "$pkgdir"/$_pythonpath
78 package_pyside2() {
79   pkgdesc='Enables the use of Qt5 APIs in Python applications'
80   depends=(python-shiboken2 qt5-declarative)
81   optdepends=('qt5-svg: QtSvg bindings'
82               'qt5-script: QtScript bindings'
83               'qt5-speech: QtTextToSpeech bindings'
84               'qt5-websockets: QtWebSockets bindings'
85               'qt5-webengine: QtWebEngine bindings'
86               'qt5-datavis3d: QtDataVisualization bindings'
87               'qt5-scxml: QtScxml bindings'
88               'qt5-sensors: QtSensors bindings'
89               'qt5-3d: Qt3D bindings'
90               'qt5-x11extras: QtX11Extras bindings'
91               'qt5-charts: QtCharts bindings'
92               'qt5-tools: QtHelp bindings'
93               'qt5-remoteobjects: QtRemoteObjects bindings'
94               'qt5-serialport: QtSerialPort bindings'
95               'qt5-quickcontrols2: QtQuickControls2 bindings')
96   provides=(qt5-python-bindings)
98   DESTDIR="$pkgdir" cmake --install build/sources/pyside2
99 # Install egg-info
100   cd $_pkgfqn
101   python setup.py egg_info --build-type=pyside2
102   _pythonpath=`python -c "from sysconfig import get_path; print(get_path('platlib'))"`
103   cp -r PySide2.egg-info "$pkgdir"/$_pythonpath
106 package_pyside2-tools() {
107   pkgdesc='Tools for PySide2'
108   depends=(pyside2)
110   DESTDIR="$pkgdir" cmake --install build/sources/pyside2-tools
111   rm "$pkgdir"/usr/bin/{rcc,uic,designer,pyside_tool.py} # provided by qt5-base