# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Andrea Scarpino <andrea@archlinux.org>

_name=frameworkintegration
pkgname=${_name}5
pkgver=5.116.0
pkgrel=2
pkgdesc='Framework providing components to allow applications to integrate with a KDE Workspace'
arch=(x86_64)
url='https://community.kde.org/Frameworks'
license=(LGPL)
depends=(gcc-libs
         glibc
         kconfig5
         kconfigwidgets5
         kiconthemes5
         knotifications5
         kwidgetsaddons5
         qt5-base)
makedepends=(extra-cmake-modules)
conflicts=("$_name<5.111")
replaces=("$_name<5.111")
groups=(kf5)
source=(https://download.kde.org/stable/frameworks/${pkgver%.*}/$_name-$pkgver.tar.xz{,.sig}
        appstream-1.0.patch)
sha256sums=('2f70ee4b34d70645a647a5fe0ffe0b6efd468e79a01d6de3978c8509f55de2c3'
            'SKIP'
            '0a325f16b62b630212a5279ff229944504ed479311338194f406f44582ec2998')
validpgpkeys=(53E6B47B45CEA3E0D5B7457758D0EE648A48B3BB) # David Faure <faure@kde.org>

prepare() {
  patch -d $_name-$pkgver -p1 < appstream-1.0.patch # Support appstream 1.0
}

build() {
  cmake -B build -S $_name-$pkgver \
    -DCMAKE_INSTALL_LIBEXECDIR=lib \
    -DBUILD_KPACKAGE_INSTALL_HANDLERS=OFF \
    -DBUILD_TESTING=OFF
  cmake --build build
}

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