# Packager = Tuxcore <dev@tuxcore.org> 
pkgbase=libkexiv2
pkgname=(libkexiv2
         libkexiv2-qt5)
pkgver=24.05.1
pkgrel=1
pkgdesc='A library to manipulate pictures metadata'
url='https://www.kde.org/'
arch=(x86_64)
license=(GPL-2.0-or-later LGPL-2.0-or-later)
depends=(gcc-libs
         glibc
         exiv2)
makedepends=(extra-cmake-modules
             qt5-base
             qt6-base)
source=(https://download.kde.org/stable/release-service/$pkgver/src/$pkgname-$pkgver.tar.xz{,.sig})
sha256sums=('a366706642e95f78ebba0f14ddf3ba343c854da003de2428f107751a9fa2aa3f'
            'SKIP')
              F23275E4BF10AFC1DF6914A6DBD2CE893E2D1C87  # Christoph Feck <cfeck@kde.org>
              D81C0CB38EB725EF6691C385BB463350D6EF31EF) # Heiko Becker <heiko.becker@kde.org>

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

  cmake -B build -S $pkgname-$pkgver \
    -DBUILD_TESTING=OFF \
    -DQT_MAJOR_VERSION=6
  cmake --build build
}

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

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

package_libkexiv2-qt5() {
  depends+=(qt5-base)
  conflicts=('libkexiv2<24')

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