# Maintainer: Luca Weiss <luca@lucaweiss.eu>
# Contributor: Brandon Boese <brandonboese@protonmail.com>
pkgname=u1db-qt
pkgver=0.1.8
pkgrel=0
pkgdesc="Simple Qt5 binding and QtQuick2 plugin for U1DB"
url="https://gitlab.com/ubports/development/core/u1db-qt"
arch="all"
license="GPL-3.0-only"
makedepends="
	cmake
	samurai
	qt5-qtdeclarative-dev
	"
checkdepends="
	dbus-test-runner
	"
source="https://gitlab.com/ubports/development/core/u1db-qt/-/archive/$pkgver/u1db-qt-$pkgver.tar.gz
	0001-point-qmlplugindump-to-qmlplugindump-qt5.patch
	0002-point-qmltestrunner-to-qmltestrunner-qt5.patch
	"
options="!check" # requires a display

build() {
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=ON \
		-DCMAKE_BUILD_TYPE=None
	cmake --build build
}

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

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

sha512sums="
928d97394cf3ab5641798469a0b38b8f8eacd83657f3c8a6ad062fa8fbbaae0ef4728902a6378f729f01043d60c1ca320d87f3cb279c93509d478a49592602e5  u1db-qt-0.1.8.tar.gz
69ae5a296e43d5429a4e32deaa777015d2ec2c8ca8a4946d6da36dd4aa934345f41e2449d16360a3f8ac061acf2e9f9b91c8ee777e849f399ec4818c10e39f17  0001-point-qmlplugindump-to-qmlplugindump-qt5.patch
f57ec76224aab9600c2d0bbcd596231c1fe92f24475eba295b0bbbcc301df9f57695d9f2e3ed65f678f1e888081a782fa8789a5f721a1cb3d6cbe7f894ba86da  0002-point-qmltestrunner-to-qmltestrunner-qt5.patch
"
