# 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=kimap
pkgver=24.08.1
pkgrel=0
pkgdesc="Job-based API for interacting with IMAP servers"
# armhf blocked by extra-cmake-modules
arch="all !armhf"
url="https://community.kde.org/KDE_PIM"
license="LGPL-2.0-or-later"
depends_dev="
	cyrus-sasl-dev
	kcoreaddons-dev
	ki18n-dev
	kio-dev
	kmime-dev
	qt6-qtbase-dev
	"
makedepends="$depends_dev
	extra-cmake-modules
	samurai
	"
subpackages="$pkgname-dev"
_repo_url="https://invent.kde.org/pim/kimap.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/kimap-$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() {
	# loginjobtest is broken
	ctest --test-dir build --output-on-failure -E "loginjobtest" -j1
}

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

sha512sums="
d0436ee1e8f92fa1ead0aafb2c7164cb927dc556174d675450cd5327591d6b029031c26213fa6f2716c0e6f0579d5637f4f41d29e06447bc4ec33dffbe7993d1  kimap-24.08.1.tar.xz
"
