# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=qt6-virtualkeyboard
_pkgver=6.10.0
pkgver=${_pkgver/-/}
pkgrel=1
arch=(x86_64 aarch64)
url='https://www.qt.io'
license=(GPL-3.0-only
         LGPL-3.0-only
         LicenseRef-Qt-Commercial
         Qt-GPL-exception-1.0)
pkgdesc='Virtual keyboard framework'
depends=(gcc-libs
         glibc
         hunspell
         qt6-base
         qt6-declarative
         qt6-multimedia
         qt6-svg)
makedepends=(cmake
             git
             ninja)
groups=(qt6)
_pkgfn=${pkgname/6-/}
source=(git+https://github.com/qt/$_pkgfn#tag=v$_pkgver)
sha256sums=('cdcfa0cc12111fa6d8afba38db3ac45f39e27c41d3feabca28e63667f8d467d7')

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
}
