File PKGBUILD of Package subtitlecomposer-git

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

_name=subtitlecomposer
pkgname=${_name}-git
pkgver=0
pkgrel=1
pkgdesc="A KDE subtitle editor (git version)"
arch=('i686' 'x86_64')
url="https://invent.kde.org/multimedia/${_name}"
license=('GPL')
depends=('kcoreaddons' 'ktextwidgets' 'kio' 'sonnet' 'kcodecs' 'kxmlgui' 'ki18n' 'ffmpeg' 'openal')
makedepends=('extra-cmake-modules' 'jack' 'blas')
makedepends+=('qt6-multimedia-ffmpeg')
checkdepends=('xorg-server-xvfb')

# Comment/uncomment the following dependency to disable/enable
# building the speech recognition plugin
makedepends+=('pocketsphinx')

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" \
    -DQT_MAJOR_VERSION=6 \
    -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