# Contributor: Bart Ribbers <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
maintainer="team/kde <bribbers@disroot.org>"
pkgname=parley
pkgver=24.08.3
pkgrel=0
# armhf blocked by extra-cmake-modules
# armv7, ppc64le, s390x, riscv64 and loongarch64 blocked by qt6-qtwebengine
arch="all !armhf !armv7 !ppc64le !s390x !riscv64 !loongarch64"
url="https://kde.org/applications/education/org.kde.parley"
pkgdesc="Vocabulary Trainer"
license="GPL-2.0-or-later AND GFDL-1.2-only"
makedepends="
	extra-cmake-modules
	kcmutils-dev
	kconfig-dev
	kcoreaddons-dev
	kcrash-dev
	kdoctools-dev
	ki18n-dev
	kio-dev
	knewstuff-dev
	knotifications-dev
	kxmlgui-dev
	libkeduvocdocument-dev
	libxml2-dev
	libxslt-dev
	qt6-qtbase-dev
	qt6-qtmultimedia-dev
	qt6-qtsvg-dev
	qt6-qtwebengine-dev
	samurai
	sonnet-dev
	"
checkdepends="xvfb-run"
subpackages="$pkgname-doc $pkgname-lang"
_repo_url="https://invent.kde.org/education/parley.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/parley-$pkgver.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	xvfb-run ctest --test-dir build --output-on-failure
}

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

sha512sums="
a97247a81aeab5a6f141a3cc433faf24035891e386908c9a6525837d0e33eda749360bbcd1f2f471d4ea197388d6f72ea5811949f5c1ec0ed6fa17ef122186f4  parley-24.08.3.tar.xz
"
