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

pkgname=qgpgme
pkgver=2.0.0
pkgrel=2
pkgdesc='Qt bindings for GPGME'
arch=(x86_64 aarch64)
url='https://gnupg.org/software/gpgme/index.html'
license=(GPL-2.0-or-later)
depends=(gcc-libs
         glibc
         gpgmepp
         qt6-base)
makedepends=(cmake
             git)
conflicts=(qgpgme-qt6)
provides=(qgpgme-qt6)
replaces=(qgpgme-qt6)
source=(git+https://github.com/gpg/gpgmeqt#tag=gpgmeqt-$pkgver)
sha256sums=('d48db1e5c6cb36eeff4379169a9a7558da8e134a5ce6b88409ecbc70e3183afc')

prepare() {
  git -C gpgmeqt cherry-pick -n 150b23c105f3ea7034e6f106e60686aea4e4a13e # Fix kmail crashes
}

build() {
  cmake -B build -S gpgmeqt \
    -DCMAKE_INSTALL_PREFIX=/usr
  cmake --build build
}

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