# 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=kmail-account-wizard
pkgver=24.08.0
pkgrel=0
# armhf blocked by extra-cmake-modules
# ppc64le, s390x, riscv64 and armv7 blocked by qt6-qtwebengine -> kmailtransport
# loongarch64 blocked by pimcommon
arch="all !armhf !ppc64le !s390x !riscv64 !armv7 !loongarch64"
url="https://kontact.kde.org/"
pkgdesc="KMail account wizard"
license="GPL-2.0-or-later AND LGPL-2.0-or-later AND GFDL-1.2-only"
makedepends="
	akonadi-dev
	akonadi-mime-dev
	extra-cmake-modules
	gpgme-dev
	kcmutils-dev
	kcodecs-dev
	kconfig-dev
	kcrash-dev
	kdbusaddons-dev
	kdoctools-dev
	kidentitymanagement-dev
	kimap-dev
	kldap-dev
	kmailtransport-dev
	knewstuff-dev
	knotifications-dev
	knotifyconfig-dev
	kservice-dev
	ktexteditor-dev
	kwallet-dev
	libkdepim-dev
	libkleo-dev
	pimcommon-dev
	qt6-qtbase-dev
	samurai
	shared-mime-info
	"
checkdepends="
	dbus
	xvfb-run
	"
subpackages="$pkgname-lang"
_repo_url="https://invent.kde.org/pim/kmail-account-wizard.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/kmail-account-wizard-$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 -- xvfb-run ctest --test-dir build --output-on-failure -E "akonadi-(mysql|sqlite)-accountconfigurationtest"
}

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

sha512sums="
e9dff3a63e37e9e57f7f0dfda0632ca4600a54a795996c0aba9d9c2bc1eb466dc18f4504be074db2f58ba921ceb4d0e0b85c237764fe5d7f8e49d338da8345b3  kmail-account-wizard-24.08.0.tar.xz
"
