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

pkgname=qt6-speech
_qtver=6.6.2
pkgver=${_qtver/-/}
pkgrel=1
arch=(x86_64 powerpc64le powerpc64 powerpc riscv64)
url='https://www.qt.io'
license=(GPL3 LGPL3 FDL custom)
pkgdesc='Qt Speech support'
depends=(gcc-libs
         glibc
         qt6-base
         qt6-multimedia)
makedepends=(cmake
             flite
             ninja
             qt6-declarative
             speech-dispatcher)
optdepends=('flite: flite TTS backend'
            'speech-dispatcher: speech-dispatcher TTS backend'
            'qt6-declarative: QML bindings')
groups=(qt6)
_pkgfn=${pkgname/6-/}-everywhere-src-$_qtver
source=(https://download.qt.io/official_releases/qt/${pkgver%.*}/$_qtver/submodules/$_pkgfn.tar.xz)
sha256sums=('c023bb12403270dbc22aa8fb721b60132bc55504f8a306087785dd70c51d6ee3')

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
}
