# Contributor: A. Wilcox <awilfox@adelielinux.org>
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=kimap
pkgver=20.08.1
pkgrel=0
pkgdesc="IMAP library for KDE"
url="https://kde.org/"
arch="all"
license="LGPL-2.1+"
depends=""
makedepends="qt5-qtbase-dev cmake extra-cmake-modules cyrus-sasl-dev kauth-dev
	kcodecs-dev kcoreaddons-dev ki18n-dev kio-dev kjobwidgets-dev kmime-dev
	kservice-dev solid-dev"
subpackages="$pkgname-dev $pkgname-lang"
source="https://download.kde.org/stable/release-service/$pkgver/src/kimap-$pkgver.tar.xz
	lts.patch
	"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=RelWithDebugInfo \
		-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
		-DCMAKE_C_FLAGS="$CFLAGS" \
		${CMAKE_CROSSOPTS} \
		.
	make
}

check() {
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="57d81f46d81d338eadef445828d57cf1288533312265b72aa1eac384441a9d347f3e71b4a02eb85d6770bc47d93bbc5ce37cf4ca235d54cda89b989bfcaec332  kimap-20.08.1.tar.xz
9746ee64f706fe4b5cdce73caea2d4bc334bf336d741da8bc2814ad2ae5a18226dd68a09910e032624699ed08caa48098a202cc122f540f0f04abc461cd94100  lts.patch"