2020-07-31 04:13:41 +00:00
|
|
|
let version = "1.5.1";
|
2020-07-31 04:17:28 +00:00
|
|
|
in
|
|
|
|
{ stdenv
|
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, polkit
|
|
|
|
, pkgconfig
|
|
|
|
, systemd
|
|
|
|
, dbus
|
|
|
|
, libinih
|
|
|
|
, fetchFromGitHub
|
|
|
|
, ...
|
|
|
|
}:
|
2020-06-18 02:14:37 +00:00
|
|
|
|
2020-07-31 04:13:41 +00:00
|
|
|
stdenv.mkDerivation {
|
2020-06-18 02:14:37 +00:00
|
|
|
pname = "gamemode";
|
2020-07-31 04:13:41 +00:00
|
|
|
inherit version;
|
2020-06-18 02:14:37 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "FeralInteractive";
|
|
|
|
repo = "gamemode";
|
|
|
|
rev = "${version}";
|
|
|
|
hash = "sha256-x3VM7HJL4+zLDBdCm0ekc0UX33lrRWlOieJjihhA5L4=";
|
|
|
|
};
|
|
|
|
|
|
|
|
prePatch = ''
|
|
|
|
substituteInPlace daemon/gamemode-tests.c --replace "/usr/bin/gamemoderun" $out/bin/gamemoderun
|
|
|
|
substituteInPlace daemon/gamemode-gpu.c --replace "/usr/bin/pkexec" ${polkit}/bin/pkexec
|
|
|
|
substituteInPlace daemon/gamemode-context.c --replace "/usr/bin/pkexec" ${polkit}/bin/pkexec
|
|
|
|
substituteInPlace lib/gamemode_client.h --replace 'dlopen("' 'dlopen("${
|
|
|
|
placeholder "out"
|
|
|
|
}/lib/'
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildInputs = [ meson ninja pkgconfig systemd dbus libinih ];
|
|
|
|
|
|
|
|
mesonFlags = ''
|
|
|
|
-Dwith-util=false
|
|
|
|
-Dwith-examples=false
|
|
|
|
-Dwith-systemd-user-unit-dir=${placeholder "out"}/lib/systemd/user
|
|
|
|
'';
|
|
|
|
|
2020-06-19 20:55:30 +00:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Optimise Linux system performance on demand";
|
|
|
|
homepage = "https://github.com/FeralInteractive/gamemode";
|
|
|
|
maintainers = [ maintainers.nrdxp ];
|
|
|
|
license = licenses.bsd3;
|
|
|
|
inherit version;
|
|
|
|
};
|
2020-06-18 02:14:37 +00:00
|
|
|
}
|