# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-other
maintainer="team/kde <bribbers@disroot.org>"
pkgname=kommit
pkgver=1.7.1
pkgrel=1
pkgdesc="Git GUI client for KDE"
url="https://apps.kde.org/kommit/"
# armhf blocked by syntax-highlighting
arch="all !armhf"
license="GPL-3.0-or-later"
makedepends="
	extra-cmake-modules
	dolphin-dev
	kconfigwidgets-dev
	kcoreaddons-dev
	kcrash-dev
	kdbusaddons-dev
	kdoctools-dev
	ki18n-dev
	kio-dev
	ktexteditor-dev
	ktextwidgets-dev
	kxmlgui-dev
	libgit2-dev
	qt6-qtbase-dev
	qt6-qtcharts-dev
	samurai
	syntax-highlighting-dev
	"
checkdepends="xvfb-run"
subpackages="$pkgname-lang $pkgname-doc"
_repo_url="https://invent.kde.org/sdk/kommit.git"
source="https://download.kde.org/stable/kommit/kommit-v$pkgver.tar.xz"
builddir="$srcdir/$pkgname-v$pkgver"

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

check() {
	xvfb-run -a ctest --test-dir build -E "(tag|clone|config|remote|submodule|cache|switch|stash)test"
}

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

sha512sums="
95d042d4403390419591cdfaef402ebbb9abe42243e91f3b443e32223b38e45a031783a0a7ec552696e02e8606ddba640c3db3d15da019454ae96b4182c49ff5  kommit-v1.7.1.tar.xz
"
