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

# 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=kunifiedpush
pkgver=1.0.0
pkgrel=0
arch="all"
url="https://invent.kde.org/libraries/kunifiedpush"
pkgdesc="UnifiedPush client library and distributor daemon"
license="BSD-2-Clause AND BSD-3-Clause AND LGPL-2.0-or-later"
depends_dev="
	kcmutils-dev
	kcoreaddons-dev
	kdeclarative-dev
	kpackage-dev
	kservice-dev
	qt6-qtbase-dev
	qt6-qtwebsockets-dev
	"
makedepends="$depends_dev
	extra-cmake-modules
	qt6-qttools-dev
	samurai
	"
checkdepends="dbus"
subpackages="$pkgname-dev"
_repo_url="https://invent.kde.org/libraries/kunifiedpush.git"
source="https://download.kde.org/stable/kunifiedpush/kunifiedpush-$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() {
	dbus-run-session -- ctest --test-dir build --output-on-failure -E "connectortest"
}

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

sha512sums="
daeb94d768637277c1f632541c13dc93c49e238c8a8db6d88c8f454f248c18c0ce39e19322188ae83530da467535b908b5c2daf5a6a9a15133db8ae608568454  kunifiedpush-1.0.0.tar.xz
"
