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

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-frameworks
maintainer="team/kde <bribbers@disroot.org>"
pkgname=kcrash
pkgver=6.8.0
pkgrel=0
pkgdesc="Support for application crash analysis and bug report from apps"
arch="all"
url="https://community.kde.org/Frameworks"
license="LGPL-2.1-or-later"
depends_dev="
	kcoreaddons-dev
	kwindowsystem-dev
	"
makedepends="$depends_dev
	doxygen
	extra-cmake-modules
	qt6-qttools-dev
	samurai
	"
checkdepends="xvfb-run"
subpackages="$pkgname-dev $pkgname-doc"
_repo_url="https://invent.kde.org/frameworks/kcrash.git"
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/kcrash-$pkgver.tar.xz"

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

check() {
	# kcrashtest is broken
	xvfb-run ctest --test-dir build --output-on-failure -E "kcrashtest"
}

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

sha512sums="
b87e54c37e4d00798f2bbfe293ea16d893dec646c318fff1c07a71cc0483c189a1830691d8cb2e1001d56f42f7169c8e72187af3588f46a6c61cbe41d8795d2f  kcrash-6.8.0.tar.xz
"
