# 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-applications
pkgname=incidenceeditor
pkgver=24.08.1
pkgrel=0
pkgdesc="KDE PIM incidence editor"
# armhf blocked by extra-cmake-modules
# ppc64le, s390x, riscv64 and armv7 blocked by qt6-qtwebengine -> akonadi
# loongarch64 blocked by calendarsupport
arch="all !armhf !ppc64le !s390x !riscv64 !armv7 !loongarch64"
url="https://kontact.kde.org/"
license="LGPL-2.0-or-later AND GPL-2.0-or-later"
depends_dev="
	akonadi-dev
	akonadi-mime-dev
	calendarsupport-dev
	eventviews-dev
	kcalendarcore-dev
	kcalutils-dev
	kcodecs-dev
	kdiagram-dev
	ki18n-dev
	kiconthemes-dev
	kio-dev
	kldap-dev
	kmailtransport-dev
	ktextwidgets-dev
	kmime-dev
	libkdepim-dev
	qt6-qtbase-dev
	"
makedepends="$depends_dev
	doxygen
	extra-cmake-modules
	graphviz
	samurai
	"
checkdepends="xvfb-run"
subpackages="$pkgname-dev $pkgname-lang"
_repo_url="https://invent.kde.org/pim/incidenceeditor.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/incidenceeditor-$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() {
	# akonadi-sqlite-incidencedatetimetest and akonadi-mysql-incidencedatetimetest require running DBus
	# ktimezonecomboboxtest is broken
	xvfb-run ctest --test-dir build --output-on-failure -E "(akonadi-(sqlite|mysql)-incidencedatetime|ktimezonecombobox)test"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}
sha512sums="
0f5f8720e4459b67995335f5f02e059c110f98e1f4f668b3fa84cb9c8e72336cce092e04ba72c80d79803b374c94a53131cc17fb84d334d1f86e79f7d45b4f0d  incidenceeditor-24.08.1.tar.xz
"
