# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Andrea Scarpino <andrea@archlinux.org>

pkgname=qt6-5compat
pkgver=6.7.2
pkgrel=1
arch=(x86_64 powerpc64le powerpc64 powerpc riscv64)
url='https://www.qt.io'
license=(GPL3 LGPL3 FDL custom)
pkgdesc='Module that contains unsupported Qt 5 APIs'
depends=(gcc-libs
         glibc
         icu
         qt6-base
         qt6-shadertools)
makedepends=(cmake
             git
             ninja
             qt6-declarative
             qt6-shadertools)
optdepends=('qt6-declarative: for QtGraphicalEffects')
groups=(qt6)
_pkgfn=${pkgname/6-/}
source=(git+https://code.qt.io/qt/$_pkgfn#tag=v$pkgver)
sha256sums=('fc4c671583b9cab77684bec27800d2a5e4cfb3f3175c055e7b84133df2843f85')

build() {
  cmake -B build -S $_pkgfn -G Ninja \
    -DCMAKE_MESSAGE_LOG_LEVEL=STATUS
  cmake --build build
}

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

  install -d "$pkgdir"/usr/share/licenses
  ln -s /usr/share/licenses/qt6-base "$pkgdir"/usr/share/licenses/$pkgname
}
