# Contributor: Díaz Urbaneja Diego <sodomon2@gmail.com>
# Maintainer: Díaz Urbaneja Diego <sodomon2@gmail.com>
pkgname=gamemode
pkgver=0_git20240327
_commit_ver=a2fe0108b59948ed861ccc087aa91af9273b036f
pkgrel=0
pkgdesc="Optimise Linux system performance on demand"
url="https://github.com/FeralInteractive/gamemode"
arch="all"
license="BSD-3-Clause"
makedepends="
	cmake
	dbus-dev
	elogind-dev
	inih-dev
	linux-headers
	meson
	samurai
	"
subpackages="$pkgname-dev $pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/FeralInteractive/gamemode/archive/$_commit_ver.tar.gz"
builddir="$srcdir/$pkgname-$_commit_ver"

build() {
	abuild-meson \
		-Dwith-examples=false \
		-Dwith-sd-bus-provider=elogind \
		. output
	meson compile -C output
}

check() {
	meson test --no-rebuild --print-errorlogs -C output
}

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

sha512sums="
216604d21e8ed7688909ff2cab5c907c4d36afe632c562158b62c16ed938ef92ec2aaa08198ae5a1ec9f2b4fba9a157b788b66b542a6d84233fb9c021f4bf11d  gamemode-0_git20240327.tar.gz
"
