File PKGBUILD of Package subtitlecomposer

# Maintainer: Mladen Milinkovic <maxrd2@smoothware.net>
# Contributor: Martchus <martchus@gmx.net>

_name=subtitlecomposer
pkgname=${_name}
pkgver=0
pkgrel=1
pkgdesc="A KDE subtitle editor"
arch=('i686' 'x86_64')
url="https://invent.kde.org/multimedia/${_name}"
license=('GPL')
depends=('kcoreaddons5' 'ktextwidgets5' 'kio5' 'sonnet5' 'kcodecs5' 'kxmlgui5' 'ki18n5' 'ffmpeg' 'openal')
makedepends=('extra-cmake-modules' 'jack' 'blas' 'pocketsphinx-git' 'xorg-server-xvfb')

optdepends=('pocketsphinx: Pocketsphinx speech recognition backend')

conflicts=(${_name})
provides=(${_name})

_tar=${pkgname}-${pkgver}
source=("${_tar}.tar.xz")
sha256sums=('SKIP')

build() {
  cmake -S "${srcdir}/${_tar}" -B "${srcdir}/build" \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DKDE_INSTALL_LIBDIR=lib \
    -DKDE_INSTALL_USE_QT_SYS_PATHS=ON
  cmake --build "${srcdir}/build"
}

check() {
  export DISPLAY=:99
  Xvfb :99 >& /dev/null &
  trap "kill $! || true" EXIT
  cmake --build "${srcdir}/build" --target test
}

package() {
  DESTDIR="${pkgdir}" cmake --install "${srcdir}/build"
}
openSUSE Build Service is sponsored by