# Packager = Tuxcore <dev@tuxcore.org> 
pkgname=qt6-speech
pkgver=6.7.2
pkgrel=1
arch=(x86_64)
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
             git
             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-/}
source=(git+https://code.qt.io/qt/$_pkgfn#tag=v$pkgver)
sha256sums=('8f77bfa2f9640c8ef2df8ddaf26042deeb587e30bbd4a8dc510f5cf291976d32')

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
}
