# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Lukas Jirkovsky <l.jirkovsky@gmail.com>
# Contributor: BlackEagle < ike DOT devolder AT gmail DOT com >
# Contributor: Dany Martineau <dany.luc.martineau at gmail.com>
# Contributor: Dylon Edwards <deltaecho@archlinux.us>

pkgname=kcm-wacomtablet
pkgver=3.2.0
pkgrel=4
epoch=1
pkgdesc="KDE GUI for the Wacom Linux Drivers"
arch=(x86_64)
url="https://invent.kde.org/kde/wacomtablet.git"
license=(GPL)
depends=(xf86-input-wacom plasma-workspace)
makedepends=(extra-cmake-modules kdoctools)
source=("https://download.kde.org/stable/wacomtablet/$pkgver/wacomtablet-$pkgver.tar.xz"{,.sig}
        "add_missing_includes.diff"
        wacomtablet-qt5.15.patch::"https://invent.kde.org/system/wacomtablet/-/commit/4f73ff02.patch")
sha256sums=('c80ce63a41f6fcbb50ac4c2130ed2f8273c4b744e62e33d4b714bf83e8e5f7a4'
            'SKIP'
            '143b2e81e5152c2f1db6e03089b32d9b9fdf1e61739743179b0efb299eb5b44d'
            '8cb4ca5b3b1fb65cd14a1c6dd20cca249e183169eeb43aef90b056dda7465c32')
validpgpkeys=('E6E4C916590026E45836A12EA8896AFDFEF5DF53') # Valeriy Malov

prepare() {
  patch -d wacomtablet-$pkgver -p1 -i ../add_missing_includes.diff
  patch -d wacomtablet-$pkgver -p1 -i ../wacomtablet-qt5.15.patch # Fix build with Qt 5.15
}

build() {
  cmake -B build -S wacomtablet-$pkgver
  cmake --build build
}

package() {
  DESTDIR="$pkgdir" cmake --install build
}
