# Contributor: Luca Weiss <luca@lucaweiss.eu>
# Maintainer: Luca Weiss <luca@lucaweiss.eu>
pkgname=qmenumodel
pkgver=0.9.2
pkgrel=1
pkgdesc="Qt5 renderer for Ayatana Indicators"
url="https://github.com/AyatanaIndicators/qmenumodel"
arch="all"
license="LGPL-3.0-only"
depends_dev="qt5-qtdeclarative-dev"
makedepends="$depends_dev cmake cmake-extras"
checkdepends="dbus-test-runner py3-dbus py3-gobject3"
subpackages="$pkgname-dev"
source="https://github.com/AyatanaIndicators/qmenumodel/archive/$pkgver/qmenumodel-$pkgver.tar.gz"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=None \
		$CMAKE_CROSSOPTS .
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

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

sha512sums="
703f1783b39b13f1e280ace1c9bb1561ced4e220edc5b274b78b38611566faa13821ca2fc775b2d8c87c30348aee3670e5f2a2710377f95da73d29ceaa9ff81a  qmenumodel-0.9.2.tar.gz
"
