# Contributor: Luca Weiss <luca@lucaweiss.eu>
# Maintainer: Luca Weiss <luca@lucaweiss.eu>
pkgname=libayatana-common
pkgver=0.9.11
pkgrel=0
pkgdesc="Shared Library for common functions required by the Ayatana System Indicators"
url="https://github.com/AyatanaIndicators/libayatana-common"
arch="all"
license="GPL-3.0-only"
makedepends="
	cmake
	cmake-extras
	glib-dev
	gobject-introspection-dev
	gtest-dev
	intltool
	samurai
	vala
	"
subpackages="$pkgname-dev $pkgname-lang"
source="https://github.com/AyatanaIndicators/libayatana-common/archive/$pkgver/libayatana-common-$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
}

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

sha512sums="
c46d109f68b1a4342fb21cc0a55f063d0c7de229c1d4c6163312bda61e4fa0a3b3a0617e56607b6e4e3b906b67eec0882c04eaf4a24219dca30f11c9b2c5b066  libayatana-common-0.9.11.tar.gz
"
