# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=kasync
pkgver=0.3.0
pkgrel=2
pkgdesc="C++ library for controlling asynchronous tasks"
arch="all !armhf" # qtdeclarative
url="https://community.kde.org/KDE_PIM"
license="LGPL-2.0-or-later AND GPL-2.0-or-later"
depends_dev="qt5-qtbase-dev"
makedepends="$depends_dev extra-cmake-modules samurai"
source="https://download.kde.org/unstable/kasync/$pkgver/src/kasync-$pkgver.tar.xz
	fix-qt-macro-usage.patch
	"
subpackages="$pkgname-dev"

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

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

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

sha512sums="
a521862bafdff2931a3f01ef4393c6ae8f3c4655bb58dc2ddb4fde5f443d67b1a23d0c21491b2099ad6dae53d8894588b49299c45d334956b36ccedf94b17f9d  kasync-0.3.0.tar.xz
b6813f54515080a2633af536f655a7b68b62f2cdc5879a8ec201a8430da126083749a86727527774ed175c2ab2b1cb4d57938f4f4363cc10ab85121adbdeffec  fix-qt-macro-usage.patch
"
