# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Christian Hesse <mail@eworm.de>
# Maintainer: Antonio Rojas <arojas@archlinux.org>

pkgbase=packagekit-qt
pkgname=(packagekit-qt5 packagekit-qt6)
pkgver=1.1.1
pkgrel=1
arch=(x86_64 powerpc64le powerpc64 powerpc riscv64)
url='http://www.packagekit.org/'
license=('LGPL')
depends=('packagekit')
makedepends=('cmake' 'qt5-base' 'qt6-base')
source=("https://www.freedesktop.org/software/PackageKit/releases/PackageKit-Qt-$pkgver.tar.xz"{,.asc})
sha256sums=('8ad57523dbfd5a4b2086fa420b8ded63024e12efb8ca0ac42db767842e506212'
            'SKIP')
validpgpkeys=('163EB50119225DB3DF8F49EA17ACBA8DFA970E17'  # Richard Hughes <richard@hughsie.com>
              'D33A3F0CA16B0ACC51A60738494C8A5FBF4DECEB'  # Matthias Klumpp <matthias@tenstral.net>
              '70C26659D184ABC01FFAF45228DDEDC6E4480AD0') # Daniel Nicoletti <dantti12@gmail.com>

build() {
  cmake -B build-qt5 -S PackageKit-Qt-${pkgver} \
    -DCMAKE_INSTALL_PREFIX=/usr
  cmake --build build-qt5

  cmake -B build-qt6 -S PackageKit-Qt-${pkgver} \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DBUILD_WITH_QT6=ON
  cmake --build build-qt6
}

package_packagekit-qt5() {
  pkgdesc='Qt5 bindings for PackageKit'
  depends+=(qt5-base)

  DESTDIR="${pkgdir}" cmake --install build-qt5
}

package_packagekit-qt6() {
  pkgdesc='Qt6 bindings for PackageKit'
  depends+=(qt6-base)

  DESTDIR="${pkgdir}" cmake --install build-qt6
}
