# Contributor: Luca Weiss <luca@lucaweiss.eu>
# Maintainer: Luca Weiss <luca@lucaweiss.eu>
pkgname=ayatana-indicator-bluetooth
pkgver=24.5.0
pkgrel=1
pkgdesc="Ayatana System Indicator for Bluetooth Management"
url="https://github.com/AyatanaIndicators/ayatana-indicator-bluetooth"
arch="all"
license="GPL-3.0-only"
makedepends="
	cmake
	cmake-extras
	intltool
	libayatana-common-dev
	vala
	"
subpackages="$pkgname-lang"
source="https://github.com/AyatanaIndicators/ayatana-indicator-bluetooth/archive/$pkgver/ayatana-indicator-bluetooth-$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=MinSizeRel \
		-DENABLE_TESTS=ON \
		$CMAKE_CROSSOPTS .
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

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

sha512sums="
579b5e1931c841e246a963782acf98b5b6c7183b1dedcfd1ef625199e0a8de40964d1fcf3baf5f03fbf433963e89a30580dbfbb67a036748b494c09ba2da969e  ayatana-indicator-bluetooth-24.5.0.tar.gz
"
