# Packager = Tuxcore <dev@tuxcore.org> 
pkgbase=plasma-integration
pkgname=(plasma-integration
         plasma5-integration)
pkgver=6.1.1
_dirver=$(echo $pkgver | cut -d. -f1-3)
pkgrel=2
pkgdesc='Qt Platform Theme integration plugins for the Plasma workspaces'
arch=(x86_64)
url='https://kde.org/plasma-desktop/'
license=(LGPL-2.0-or-later)
depends=(gcc-libs
         glibc
         kcolorscheme
         kcompletion
         kconfig
         kcoreaddons
         kguiaddons
         kiconthemes
         ki18n
         kio
         kjobwidgets
         kservice
         kstatusnotifieritem
         kwidgetsaddons
         kwindowsystem
         kxmlgui
         libxcb
         libxcursor
         qqc2-breeze-style
         qqc2-desktop-style
         qt6-base
         qt6-declarative
         qt6-wayland
         wayland)
makedepends=(extra-cmake-modules
             plasma-wayland-protocols
             kconfig5
             ki18n5
             kiconthemes5
             kio5
             knotifications5
             kwayland5
             kwindowsystem5
             kxmlgui5
             qt5-base
             qt5-declarative
             qt5-quickcontrols2
             qt5-wayland
             qt5-x11extras)
groups=(plasma)
source=(https://download.kde.org/stable/plasma/$_dirver/$pkgname-$pkgver.tar.xz{,.sig})
sha256sums=('180bea892d6dd249e98e0c320fcad557354340bd6c0958e7fe7928c347e5597d'
            'SKIP')
              '0AAC775BB6437A8D9AF7A3ACFE0784117FBCE11D'  # Bhushan Shah <bshah@kde.org>
              'D07BD8662C56CB291B316EB2F5675605C74E02CF'  # David Edmundson <davidedmundson@kde.org>
              '1FA881591C26B276D7A5518EEAAF29B42A678C20') # Marco Martin <notmart@gmail.com>

build() {
  cmake -B build -S $pkgname-$pkgver \
    -DBUILD_TESTING=OFF \
    -DBUILD_QT5=OFF
  cmake --build build

  cmake -B build5 -S $pkgname-$pkgver \
    -DBUILD_TESTING=OFF \
    -DBUILD_QT6=OFF
  cmake --build build5
}

package_plasma-integration() {
  depends+=(noto-fonts
            ttf-hack
            xdg-desktop-portal-kde)
  DESTDIR="$pkgdir" cmake --install build
}

package_plasma5-integration() {
  pkgdesc='Qt5 Platform Theme integration plugins for the Plasma workspaces'
  depends=(gcc-libs
           glibc
           kcompletion5
           kconfig5
           kconfigwidgets5
           kcoreaddons5
           ki18n5
           kiconthemes5
           kio5
           kjobwidgets5
           knotifications5
           kservice5
           kwayland5
           kwidgetsaddons5
           kwindowsystem5
           kxmlgui5
           libxcb
           libxcursor
           qt5-base
           qt5-declarative
           qt5-quickcontrols2
           qt5-wayland
           qt5-x11extras
           wayland)
  conflicts=('plasma-integration<5.27.80')
  replaces=('plasma-integration<5.27.80')
  groups=()

  DESTDIR="$pkgdir" cmake --install build5
}
