# 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=2
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
  glibc
  libdbus-1.so
  libgcc
  libinih
  libsystemd.so
  polkit
)
makedepends=(
  git
  meson
)
checkdepends=(appstream)
provides=(
  libgamemode.so
  libgamemodeauto.so
)
_tag=c54d6d4243b0dd0afcb49f2c9836d432da171a2b
source=(git+https://github.com/FeralInteractive/gamemode.git#tag=${_tag})
b2sums=('4be672cdc658341d5911e45289883fd8466648752ba7c30ba9428a214319383d4058e282614be8d82d2af310fc99b276950e31bc1d26b60da74bc7af3774cc93')

pkgver() {
  cd gamemode
  git describe --tags
}

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/
}

# vim: ts=2 sw=2 et:
