# Packager = Tuxcore <dev@tuxcore.org> 
pkgbase=oxygen
pkgname=(oxygen
         oxygen5)
pkgdesc='KDE Oxygen style'
pkgver=6.1.1
_dirver=$(echo $pkgver | cut -d. -f1-3)
pkgrel=1
arch=(x86_64)
url='https://kde.org/plasma-desktop/'
license=(LGPL-2.0-or-later)
depends=(frameworkintegration
         gcc-libs
         glibc
         kcmutils
         kcolorscheme
         kcompletion
         kconfig
         kconfigwidgets
         kcoreaddons
         kdecoration
         kguiaddons
         ki18n
         kwidgetsaddons
         kwindowsystem
         libxcb
         qt6-base
         qt6-declarative)
makedepends=(extra-cmake-modules
             frameworkintegration5
             kconfigwidgets5
             kiconthemes5
             kirigami2
             kwindowsystem5
             libplasma)
optdepends=('oxygen5: Oxygen widget style for Qt5 applications')
groups=(plasma)
source=(https://download.kde.org/stable/plasma/$_dirver/$pkgname-$pkgver.tar.xz{,.sig})
sha256sums=('bf719787152c334a82f8e7c2e0b7aa1a12c4128e95011307026f147b8fdb82d0'
            '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_oxygen() {
  DESTDIR="$pkgdir" cmake --install build
}

package_oxygen5() {
  pkgdesc='Qt5 Oxygen style'
  depends=(oxygen
           gcc-libs
           glibc
           frameworkintegration5
           kcompletion5
           kconfig5
           kconfigwidgets5
           kguiaddons5
           ki18n5
           kwidgetsaddons5
           kwindowsystem5
           libxcb
           qt5-base
           qt5-declarative
           qt5-x11extras)
  conflicts=('oxygen<5.27.80')
  replaces=('oxygen<5.27.80')
  optdepends=()
  groups=()

  DESTDIR="$pkgdir" cmake --install build5
  rm -r "$pkgdir"/usr/share/kstyle
}
