# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=libkgapi
pkgver=18.12.3
pkgrel=1
pkgdesc="LibKGAPI is a KDE-based library for accessing various Google services via their public API"
arch="all"
url="https://community.kde.org/KDE_PIM"
license="LGPL-2.1"
depends_dev="qt5-qtbase-dev qt5-qtwebengine-dev kio-dev kwindowsystem-dev kwallet-dev kcalcore-dev kcontacts-dev cyrus-sasl-dev"
makedepends="$depends_dev extra-cmake-modules qt5-qttools-dev"
source="https://download.kde.org/stable/applications/$pkgver/src/$pkgname-$pkgver.tar.xz"
subpackages="$pkgname-dev"
options="!check" # Broken

build() {
	cmake \
		-DCMAKE_BUILD_TYPE=RelWithDebugInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_QCH=ON
	make
}

check() {
	cd "$builddir"
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
}
sha512sums="f6ddc737159dd887100bbe634d0ec81ce583ed6d6411b82609db6a74401f78fe340e3a0cdab3e3715763a53e85f54de9a6d8608948923b44afe2b46733f54ae1  libkgapi-18.12.3.tar.xz"