# 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-other
pkgname=kgraphviewer
pkgver=2.5.0
pkgrel=0
pkgdesc="GraphViz dot graph viewer"
# armhf blocked by extra-cmake-modules
arch="all !armhf"
url="https://apps.kde.org/kgraphviewer/"
license="GPL-2.0-only"
makedepends="
	boost-dev
	extra-cmake-modules
	graphviz-dev
	kcoreaddons-dev
	kdoctools-dev
	ki18n-dev
	kparts-dev
	kwidgetsaddons-dev
	qt6-qt5compat-dev
	qt6-qtbase-dev
	qt6-qtsvg-dev
	samurai
	"
checkdepends="xvfb-run"
subpackages="$pkgname-dev $pkgname-lang"
source="https://download.kde.org/stable/kgraphviewer/$pkgver/kgraphviewer-$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
}

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

sha512sums="
80056703cd42b709925b771fe4bafe17771954705a607d6c352a0818c726bc7b48d299fffd7f3d2f75ac498059f79923d4de468db20f8538554c4d6b8baffedb  kgraphviewer-2.5.0.tar.xz
"
