# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=monado
pkgver=24.0.0
pkgrel=1
pkgdesc="The open source OpenXR runtime"
url="https://monado.freedesktop.org"
# ppc64le, s390x, riscv64, loongarch64 blocked by opencv -> vtk -> netcdf
arch="all !ppc64le !s390x !riscv64 !loongarch64"
license="BSL-1.0"
depends="xr-hardware"
makedepends="
	cmake
	cmd:glslangValidator
	cmd:wayland-scanner
	doxygen
	eigen-dev
	eudev-dev
	graphviz
	libbsd-dev
	libjpeg-turbo-dev
	libsurvive-dev
	libxrandr-dev
	mesa-dev
	opencv-dev
	openhmd-dev
	samurai
	sdl2-dev
	v4l-utils-dev
	vulkan-loader-dev
	wayland-dev
	wayland-protocols
	zlib-dev
	"
source="https://gitlab.freedesktop.org/monado/monado/-/archive/v$pkgver/monado-v$pkgver.tar.gz"
builddir="$srcdir/$pkgname-v$pkgver"

build() {
	# Steam is not available on Alpine and probably never will be
	# It can be ran in a Flatpak on Alpine but Monado installed on the host
	# can never work with it, so there is no need for us to build it
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

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

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

sha512sums="
aea642235ac5c8dea56c08dd8a780b23939efbdfcd6beb6b85dbdc6c78cb535e29c2600c850f615ddf915a273adc050ee06c474742e04a5c45dbbff2c6293b60  monado-v24.0.0.tar.gz
"
