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

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
maintainer="team/kde <bribbers@disroot.org>"
pkgname=akonadi-contacts
pkgver=24.08.3
pkgrel=0
pkgdesc="Libraries and daemons to implement Contact Management in Akonadi"
# s390x, riscv64 and loongarch64 blocked by akonadi
# ppc64le, armhf blocked by qt6-qtwebengine -> akonadi
arch="all !armhf !s390x !riscv64 !ppc64le !loongarch64"
url="https://community.kde.org/KDE_PIM"
license="LGPL-2.0-or-later AND GPL-2.0-or-later AND BSD-3-Clause"
depends_dev="
	akonadi-dev
	gpgme-dev
	grantlee-dev
	grantleetheme-dev
	kcodecs-dev
	kcompletion-dev
	kconfig-dev
	kcontacts-dev
	kdbusaddons-dev
	ki18n-dev
	kiconthemes-dev
	kio-dev
	kmime-dev
	kservice-dev
	ktextaddons-dev
	ktexttemplate-dev
	ktextwidgets-dev
	kwidgetsaddons-dev
	kxmlgui-dev
	libkleo-dev
	prison-dev
	qt6-qtbase-dev
	"
makedepends="$depends_dev
	extra-cmake-modules
	samurai
	"
checkdepends="xvfb-run"
subpackages="$pkgname-dev $pkgname-lang"
_repo_url="https://invent.kde.org/pim/akonadi-contacts.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/akonadi-contacts-$pkgver.tar.xz"

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

check() {
	xvfb-run -a ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}
sha512sums="
a6a42c9219fa9bfbb5474d45b64daaca00bb6e551f5f655af6625096704458d40242d099e330d0390bac2126ed1cc54412f6222ba7d4a39f5e955de58fb6f92f  akonadi-contacts-24.08.3.tar.xz
"
