# Maintainer: Tri Vo Khac

pkgname=qtpotato
pkgver=0.1.0
pkgrel=1
pkgdesc='KDE video player built on mpv that translates subtitles with an LLM'
arch=('x86_64')
url='https://git.trivk.dev/tri/QtPotato'
license=('GPL-3.0-or-later')
depends=('qt6-base' 'qt6-declarative' 'kirigami' 'ki18n' 'kcoreaddons' 'kcrash' 'kconfig'
         'mpvqt' 'qcoro' 'qtkeychain-qt6' 'ffmpeg' 'hicolor-icon-theme')
makedepends=('cmake' 'ninja' 'extra-cmake-modules')
optdepends=('qqc2-desktop-style: Plasma look for the interface'
            'plasma-integration: Plasma file dialogs, colours and icons')
source=("$url/releases/download/v$pkgver/$pkgname-$pkgver.tar.gz")
# Filled in by update-pkgbuild.sh from the release's SHA256SUMS.
sha256sums=('SKIP')

build() {
  cmake -B build -S "$pkgname-$pkgver" -G Ninja \
    -DCMAKE_BUILD_TYPE=None \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DBUILD_TESTING=ON
  cmake --build build
}

check() {
  QT_QPA_PLATFORM=offscreen ctest --test-dir build --output-on-failure
}

package() {
  DESTDIR="$pkgdir" cmake --install build
}
