# Maintainer: Luca Weiss <luca@lucaweiss.eu>
pkgname=lomiri-trust-store
pkgver=2.0.2
pkgrel=6
pkgdesc="API for creating, reading, updating and deleting trust requests answered by users"
url="https://gitlab.com/ubports/development/core/trust-store"
arch="all"
license="LGPL-3.0-only"
depends_dev="
	boost-dev
	dbus-cpp-dev
	libapparmor-dev
	mir-dev
	process-cpp-dev
	properties-cpp-dev
	qt5-qtdeclarative-dev
	"
makedepends="
	$depends_dev
	cmake
	cmake-extras
	glog-dev
	gmock
	gtest-dev
	libapparmor
	samurai
	"
checkdepends="
	coreutils
	dbus
	"
source="https://gitlab.com/ubports/development/core/trust-store/-/archive/$pkgver/trust-store-$pkgver.tar.gz
	10-boost_1.84.patch
	glog.patch
	"
subpackages="$pkgname-dev $pkgname-lang"
builddir="$srcdir/trust-store-$pkgver"
options="!check" # some tests fail

build() {
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCMAKE_BUILD_TYPE=None \
		-DTRUST_STORE_MIR_AGENT_ENABLED=OFF \
		-DENABLE_WERROR=OFF
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

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

sha512sums="
3dab27f752ad12845a41af04c3a749d89043a2d36cdd81f4705399144b7747f1f37142df8e30e70003ab42d75171e01e99bc6678d39e277f94eb0a8267c856b7  trust-store-2.0.2.tar.gz
269b93bb39711f9e3a36d8fcc6d0505e07a42808ee4ba7b1cd15692e06f8fd333fcc6c6641b76d93a5e270e82b26dbbc4e477c2cc7e25f8715b19fe3986e8ae6  10-boost_1.84.patch
1888be5142dc4f9c708901b5a5fc6d589115dee99133093d3fa2c9b88e5b7e1164f90cee9b552792c69daec7de5b78363a3c710619a328cd781157f55fdf5767  glog.patch
"
