# Maintainer: Luca Weiss <luca@lucaweiss.eu>
# Contributor: Aster Boese <asterboese@mailbox.org>
pkgname=lomiri-history-service
pkgver=0.6
pkgrel=6
pkgdesc="Service that provides call log and conversation history"
url="https://gitlab.com/ubports/development/core/lomiri-history-service"
arch="all"
license="GPL-3.0-only"
depends="
	qt5-qtbase-sqlite
	telepathy-mission-control
	"
makedepends="
	cmake
	cmake-extras
	dconf
	libphonenumber-dev
	libqtdbustest
	qt5-qtbase-dev
	qt5-qtdeclarative-dev
	qt5-qtpim-dev
	samurai
	sqlite-dev
	telepathy-qt-dev
	"
checkdepends="
	dbus-test-runner
	xvfb-run
	"
subpackages="$pkgname-dev"
source="https://gitlab.com/ubports/development/core/lomiri-history-service/-/archive/$pkgver/lomiri-history-service-$pkgver.tar.gz
	0003-remove-daemon-directory.patch
	"
options="!check" # several tests timing out

build() {
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCMAKE_INSTALL_SYSCONFDIR=/etc \
		-DCMAKE_INSTALL_LOCALSTATEDIR=/var \
		-DUSE_SYSTEMD=OFF \
		-DENABLE_WERROR=OFF
	cmake --build build
}

check() {
	ctest --test-dir build
}

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

sha512sums="
b6ef89d9b9b90a8a89f1b3c273cf92239868f3d7ca2a18cef1d625ec601a0cde0d6a8f124351fc49554b6f5b508cc845ca14786792b580b7c78b1e5154d7771d  lomiri-history-service-0.6.tar.gz
342e432410335a06796dde8f1a90c221b40d288844581c4eef4e5e16aec8696512b706a33afc1a1e2399749bfce21170ac01e17f17809b2497ec9f056e740888  0003-remove-daemon-directory.patch
"
