# Maintainer: Marian Buschsieweke <marian.buschsieweke@posteo.net>
pkgname=mangohud
pkgver=0.7.1
_pkgver=$pkgver-1
pkgrel=1
pkgdesc="Vulkan and OpenGL overlay for monitoring FPS, temperatures, CPU/GPU load and more"
url="https://github.com/flightlessmango/MangoHud"
# s390x: See https://github.com/flightlessmango/MangoHud/issues/1330
arch="all !s390x"
license="MIT"
subpackages="$pkgname-doc"
makedepends="
	appstream
	dbus-dev
	glew-dev
	glfw-dev
	glslang-dev
	libx11-dev
	libxrandr-dev
	mesa-dev
	meson
	ninja
	nlohmann-json
	py3-mako
	sdl2-dev
	spdlog-dev
	vulkan-headers
	vulkan-loader-dev
	wayland-dev
	"
checkdepends="
	cmocka-dev
	"
source="
	$pkgname-$pkgver.tar.xz::https://github.com/flightlessmango/MangoHud/releases/download/v$pkgver/MangoHud-v$_pkgver-Source.tar.xz
	"
builddir="$srcdir/MangoHud-v$pkgver"

build() {
	abuild-meson \
		-Dappend_libdir_mangohud=false \
		-Dimgui:glfw=enabled \
		-Dimgui:opengl=enabled \
		-Dimgui:sdl2=enabled \
		-Dimgui:vulkan=enabled \
		-Dmangoapp=true \
		-Dmangoapp_layer=true \
		-Dmangohudctl=true \
		-Dtests=enabled \
		-Dwith_dbus=enabled \
		-Dwith_wayland=enabled \
		-Dwith_xnvctrl=disabled \
		. output
	meson compile -C output
}

check() {
	meson test -v -C output
}

package() {
	DESTDIR="$pkgdir" meson install --no-rebuild -C output
}

sha512sums="
79ac17a199035c410b98b5c4315641efde39636659c2b78b4cd6dc71024a7230044522a6c20bf82f2ca2f6c771e879274655561e8f8071914c30e2a61d99af80  mangohud-0.7.1.tar.xz
"
