# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
pkgname=lokalize
pkgver=24.08.0
pkgrel=0
pkgdesc="Computer-Aided Translation System"
url="https://apps.kde.org/lokalize/"
# armhf blocked by extra-cmake-modules
arch="all !armhf"
license="(GPL-2.0-only OR GPL-3.0-only) AND GFDL-1.2-only"
makedepends="
	extra-cmake-modules
	hunspell-dev
	kconfig-dev
	kcoreaddons-dev
	kcrash-dev
	kdbusaddons-dev
	kdoctools-dev
	ki18n-dev
	kio-dev
	knotifications-dev
	ktextwidgets-dev
	kxmlgui-dev
	qt6-qtbase-dev
	samurai
	sonnet-dev
	"
checkdepends="xvfb-run"
subpackages="$pkgname-doc $pkgname-lang"
_repo_url="https://invent.kde.org/sdk/lokalize.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/lokalize-$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 -E "(tmjobs|gettextheader)test"
}

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

sha512sums="
ecd2f5de46035d89c615776430068f2cff35c289dfc1d965463577d7f6fa7d8dbdfeddede3a9779432717587b33c8003b4b9e9a3d750ddc057dc35b1d6049d95  lokalize-24.08.0.tar.xz
"
