# Maintainer: Luca Weiss <luca@lucaweiss.eu>
# Contributor: Brandon Boese <brandonboese@protonmail.com>
pkgname=lomiri-history-service
pkgver=0.6
pkgrel=1
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
	"
builddir="$srcdir/lomiri-history-service-$pkgver"
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
db31a981bcdaf3f4aa1c14215f6df3a38e2c80b7342ba4a52a6ce1cda6a70fff6f912daea76d32c095dfd25c34224db83bef8f00df73bf0e0af7dc92d971103d  0003-remove-daemon-directory.patch
"
