# Maintainer: Antonio Rojas <arojas@archlinux.org>

pkgbase=pyqt6
pkgname=python-pyqt6
pkgdesc='A set of Python bindings for the Qt6 toolkit'
pkgver=6.10.0
pkgrel=1
arch=(x86_64)
url='https://riverbankcomputing.com/software/pyqt/intro'
license=(GPL)
groups=(pyqt6)
depends=(gcc-libs
         glibc
         python-pyqt6-sip
         qt6-base)
optdepends=('qt6-tools: QtHelp, QtDesigner bindings'
            'qt6-svg: QtSvg bindings'
            'qt6-declarative: QtQml bindings, qmlplugin'
            'qt6-quick3d: QtQuick3D bindings'
            'qt6-connectivity: QtBluetooth, QtNfc bindings'
            'qt6-multimedia: QtMultimedia, QtSpatialAudio bindings'
            'qt6-positioning: QtPositioning bindings'
            'qt6-remoteobjects: QtRemoteObjects bindings'
            'qt6-scxml: QtStateMachine bindings'
            'qt6-sensors: QtSensors bindings'
            'qt6-serialport: QtSerialPort bindings'
            'qt6-speech: QtTextToSpeech bindings'
            'qt6-webchannel: QtWebChannel bindings'
            'qt6-webengine: QtPdf bindings'
            'qt6-websockets: QtWebSockets bindings'
            'dbus-python: for python-dbus mainloop support')
makedepends=(dbus-python
             pyqt-builder
             python-opengl
             qt6-connectivity
             qt6-declarative
             qt6-multimedia
             qt6-positioning
             qt6-quick3d
             qt6-remoteobjects
             qt6-scxml
             qt6-sensors
             qt6-serialport
             qt6-shadertools
             qt6-speech
             qt6-svg
             qt6-tools
             qt6-webchannel
             qt6-webengine
             qt6-websockets
             sip)
provides=(qt6-python-bindings)
source=(https://pypi.python.org/packages/source/P/PyQt6/pyqt6-$pkgver.tar.gz)
sha256sums=('710ecfd720d9a03b2c684881ae37f528e11d17e8f1bf96431d00a6a73f308e36')

build() {
  cd pyqt6-$pkgver
  sip-build \
    --confirm-license \
    --no-make \
    --qmake=/usr/bin/qmake6 \
    --api-dir /usr/share/qt6/qsci/api/python \
    --pep484-pyi
  cd build
  make
}

package_python-pyqt6(){
  cd pyqt6-$pkgver/build
  make INSTALL_ROOT="$pkgdir" install

  # compile Python bytecode
  python -m compileall -d / "$pkgdir"/usr/lib
  python -O -m compileall -d / "$pkgdir"/usr/lib
}
