# Packager = Tuxcore <dev@tuxcore.org> 
pkgbase=libkdcraw
pkgname=(libkdcraw
         libkdcraw5)
pkgver=24.12.0
pkgrel=1
pkgdesc='A C++ interface used to decode RAW picture'
url='https://www.kde.org/'
arch=(x86_64)
license=(GPL-2.0-or-later LGPL-2.0-or-later)
depends=(gcc-libs
         glibc
         libraw)
makedepends=(extra-cmake-modules
             qt5-base
             qt6-base)
source=(https://download.kde.org/stable/release-service/$pkgver/src/$pkgbase-$pkgver.tar.xz{,.sig})
sha256sums=('0b4b6067fd362d218f6ee088c661c42b2f55cd9e3a8bdfb82efed96bd682625c'
            'SKIP')
validpgpkeys=(CA262C6C83DE4D2FB28A332A3A6A4DB839EAA6D7  # Albert Astals Cid <aacid@kde.org>
              F23275E4BF10AFC1DF6914A6DBD2CE893E2D1C87  # Christoph Feck <cfeck@kde.org>
              D81C0CB38EB725EF6691C385BB463350D6EF31EF) # Heiko Becker <heiko.becker@kde.org>

build() {
  cmake -B build -S $pkgbase-$pkgver \
    -DBUILD_TESTING=OFF \
    -DQT_MAJOR_VERSION=6
  cmake --build build

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

package_libkdcraw() {
  depends+=(qt6-base)

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

package_libkdcraw5() {
  depends+=(qt5-base)

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