# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=ktp-common-internals
pkgver=19.08.2
pkgrel=0
pkgdesc="Library for KTp"
url="https://github.com/kde/ktp-common-internals"
arch="all"
license="LGPL-2.1-only AND GPL-2.0-only"
depends_dev="qt5-qtbase-dev qt5-qtdeclarative-dev kcoreaddons-dev knotifications-dev kio-dev kwidgetsaddons-dev kcmutils-dev knotifyconfig-dev ktexteditor-dev kwallet-dev kconfig-dev kwindowsystem-dev kemoticons-dev kiconthemes-dev kpeople-dev telepathy-qt-dev telepathy-logger-qt-dev"
makedepends="$depends_dev extra-cmake-modules doxygen"
source="https://download.kde.org/stable/applications/$pkgver/src/ktp-common-internals-$pkgver.tar.xz
	fix-build.patch"
subpackages="$pkgname-dev $pkgname-lang"
options="!check" # No tests

prepare() {
	default_prepare

	mkdir "$builddir"/build
}

build() {
	cd "$builddir"/build
	cmake "$builddir" \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	make
}

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

package() {
	cd "$builddir"/build
	DESTDIR="$pkgdir" make install
}

sha512sums="dda4b54497fe85067e0bf6f14b892cb0a718e4eb6a997628a07f6d26c3062d2b413766c70a014372bd5708c7b0d6c75da4749b694bcd8062aed01a43bf3b2b3b  ktp-common-internals-19.08.2.tar.xz
4a2b1fce5ae3f7c39709c4970d56008eede04dce5d5dc6dc7c185c67697893b205408e9501ddba52e15693f99d533c035a8c28de12ec24611e9422ab37143849  fix-build.patch"
