# 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-frameworks-old
pkgname=purpose5
pkgver=5.116.0
pkgrel=0
pkgdesc="Framework for providing abstractions to get the developer's purposes fulfilled"
# armhf blocked by extra-cmake-modules
# ppc64le, s390x, riscv64 and loongarch64 blocked by qt5-qtwebengine -> kaccounts-integration
arch="all !armhf !ppc64le !s390x !riscv64 !loongarch64"
url="https://community.kde.org/Frameworks"
license="LGPL-2.1-or-later"
depends_dev="
	kaccounts-integration-dev
	kconfig5-dev
	kcoreaddons5-dev
	ki18n5-dev
	kio5-dev
	kirigami2-dev
	qt5-qtbase-dev
	qt5-qtdeclarative-dev
	"
makedepends="$depends_dev
	extra-cmake-modules
	samurai
	"
checkdepends="xvfb-run"
_repo_url="https://invent.kde.org/frameworks/purpose.git"
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/purpose-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-lang"
options="!check" # fails on builders
builddir="$srcdir/purpose-$pkgver"

replaces="purpose<=5.110.0-r0"

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

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

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

sha512sums="
3447135ad33c725e0512c6b20a9be81082737146fa0c5a32b0c7d50a21cb5697b2b4796d1cbffc8661dd845ee3ef51bc57af0c94cce0ed14cc1542df822139d5  purpose-5.116.0.tar.xz
"
