# Contributor: Luca Weiss <luca@lucaweiss.eu>
# Maintainer: Luca Weiss <luca@lucaweiss.eu>
pkgname=ayatana-ido
pkgver=0.10.4
pkgrel=0
pkgdesc="Ayatana Indicator Display Objects"
url="https://github.com/AyatanaIndicators/ayatana-ido"
arch="all"
license="LGPL-2.1-only AND LGPL-3.0-only AND GPL-3.0-only"
makedepends="
	cmake
	cmake-extras
	glib-dev
	gtest-dev
	gtk+3.0-dev
	samurai
	"
checkdepends="xvfb-run"
subpackages="$pkgname-dev"
source="https://github.com/AyatanaIndicators/ayatana-ido/archive/$pkgver/ayatana-ido-$pkgver.tar.gz"

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

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE xvfb-run -a ctest
}

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

sha512sums="
a36b67cb505b9340a8193e281c72831b56d6a620054e99e1032145ec0d8d26fe4768402b36ee4d7e115dbbd6fb393cc15c3d71c15d040f5eb22d3d2114f80536  ayatana-ido-0.10.4.tar.gz
"
