# Maintainer: Maxime Gauduin <alucryd@archlinux.org>
# Contributor: Ysblokje <ysblokje@gmail.com>
# Contributor: Mark Wagie <mark.wagie@tutanota.com>

pkgname=gamemode
pkgver=1.8.2
pkgrel=3
pkgdesc='A daemon/lib combo that allows games to request a set of optimisations be temporarily applied to the host OS'
arch=(x86_64 aarch64)
url=https://github.com/FeralInteractive/gamemode
license=(BSD-3-Clause)
depends=(
  bash
  dbus
  glibc
  libgcc
  libinih
  polkit
  systemd-libs
)
makedepends=(
  git
  meson
)
checkdepends=(appstream)
provides=(
  libgamemode.so
  libgamemodeauto.so
)
source=(git+https://github.com/FeralInteractive/gamemode.git#tag=${pkgver})
b2sums=('4be672cdc658341d5911e45289883fd8466648752ba7c30ba9428a214319383d4058e282614be8d82d2af310fc99b276950e31bc1d26b60da74bc7af3774cc93')

build() {
  arch-meson gamemode build \
    --libexecdir /usr/lib/gamemode \
    -Dwith-examples=false
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

package() {
  meson install -C build --destdir "${pkgdir}"
  install -Dm 644 gamemode/LICENSE.txt -t "${pkgdir}"/usr/share/licenses/gamemode/
}
