mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-14 06:00:33 +03:00
Merge pull request #272943 from kira-bruneau/gamemode
gamemode: 1.7 -> 1.8.1
This commit is contained in:
commit
017bc47e74
4 changed files with 24 additions and 46 deletions
|
@ -18,7 +18,7 @@ in
|
||||||
|
|
||||||
settings = mkOption {
|
settings = mkOption {
|
||||||
type = settingsFormat.type;
|
type = settingsFormat.type;
|
||||||
default = {};
|
default = { };
|
||||||
description = lib.mdDoc ''
|
description = lib.mdDoc ''
|
||||||
System-wide configuration for GameMode (/etc/gamemode.ini).
|
System-wide configuration for GameMode (/etc/gamemode.ini).
|
||||||
See gamemoded(8) man page for available settings.
|
See gamemoded(8) man page for available settings.
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
{ lib
|
{ lib
|
||||||
, stdenv
|
, stdenv
|
||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
, fetchpatch
|
|
||||||
, libgamemode32
|
, libgamemode32
|
||||||
|
, makeWrapper
|
||||||
, meson
|
, meson
|
||||||
, ninja
|
, ninja
|
||||||
, pkg-config
|
, pkg-config
|
||||||
|
@ -10,36 +10,28 @@
|
||||||
, inih
|
, inih
|
||||||
, systemd
|
, systemd
|
||||||
, appstream
|
, appstream
|
||||||
, makeWrapper
|
|
||||||
, findutils
|
, findutils
|
||||||
, gawk
|
, gawk
|
||||||
, procps
|
, procps
|
||||||
|
, nix-update-script
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation (finalAttrs: {
|
||||||
pname = "gamemode";
|
pname = "gamemode";
|
||||||
version = "1.7";
|
version = "1.8.1";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "FeralInteractive";
|
owner = "FeralInteractive";
|
||||||
repo = pname;
|
repo = "gamemode";
|
||||||
rev = version;
|
rev = "refs/tags/${finalAttrs.version}";
|
||||||
sha256 = "sha256-DIFcmWFkoZOklo1keYcCl6n2GJgzWKC8usHFcJmfarU=";
|
hash = "sha256-kusb58nGxYA3U9GbZdW3hLjA3NmHc+af0VT4iGRewBw=";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = [ "out" "dev" "lib" "man" "static" ];
|
outputs = [ "out" "dev" "lib" "man" ];
|
||||||
|
|
||||||
patches = [
|
patches = [
|
||||||
# Add @libraryPath@ template variable to fix loading the PRELOAD library
|
# Add @libraryPath@ template variable to fix loading the PRELOAD library
|
||||||
./preload-nix-workaround.patch
|
./preload-nix-workaround.patch
|
||||||
# Do not install systemd sysusers configuration
|
|
||||||
./no-install-systemd-sysusers.patch
|
|
||||||
|
|
||||||
# fix build with glibc >=2.36 (declaration of pidfd_open)
|
|
||||||
(fetchpatch {
|
|
||||||
url = "https://github.com/FeralInteractive/gamemode/commit/4934191b1928ef695c3e8af21e75781f8591745f.patch";
|
|
||||||
sha256 = "sha256-pWf2NGbd3gEJFwVP/EIJRbTD29V7keTQHy388enktsY=";
|
|
||||||
})
|
|
||||||
];
|
];
|
||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
|
@ -66,12 +58,15 @@ stdenv.mkDerivation rec {
|
||||||
];
|
];
|
||||||
|
|
||||||
mesonFlags = [
|
mesonFlags = [
|
||||||
# libexec is just a way to package binaries without including them
|
"-Dwith-pam-limits-dir=etc/security/limits.d"
|
||||||
# in PATH. It doesn't make sense to install them to $lib
|
|
||||||
# (the default behaviour in the meson hook).
|
|
||||||
"--libexecdir=${placeholder "out"}/libexec"
|
|
||||||
|
|
||||||
"-Dwith-systemd-user-unit-dir=lib/systemd/user"
|
"-Dwith-systemd-user-unit-dir=lib/systemd/user"
|
||||||
|
"-Dwith-systemd-group-dir=lib/sysusers.d"
|
||||||
|
|
||||||
|
# The meson builder installs internal executables to $lib/lib by
|
||||||
|
# default, but they should be installed to "$out". It's also more
|
||||||
|
# appropriate to install these executables under a libexec
|
||||||
|
# directory instead of lib.
|
||||||
|
"--libexecdir=libexec"
|
||||||
];
|
];
|
||||||
|
|
||||||
doCheck = true;
|
doCheck = true;
|
||||||
|
@ -79,11 +74,6 @@ stdenv.mkDerivation rec {
|
||||||
appstream
|
appstream
|
||||||
];
|
];
|
||||||
|
|
||||||
# Move static libraries to $static so $lib only contains dynamic libraries.
|
|
||||||
postInstall = ''
|
|
||||||
moveToOutput lib/*.a "$static"
|
|
||||||
'';
|
|
||||||
|
|
||||||
postFixup = ''
|
postFixup = ''
|
||||||
# Add $lib/lib to gamemoded & gamemode-simulate-game's rpath since
|
# Add $lib/lib to gamemoded & gamemode-simulate-game's rpath since
|
||||||
# they use dlopen to load libgamemode. Can't use makeWrapper since
|
# they use dlopen to load libgamemode. Can't use makeWrapper since
|
||||||
|
@ -100,11 +90,15 @@ stdenv.mkDerivation rec {
|
||||||
]}
|
]}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
passthru.updateScript = nix-update-script { };
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "Optimise Linux system performance on demand";
|
description = "Optimise Linux system performance on demand";
|
||||||
homepage = "https://github.com/FeralInteractive/GameMode";
|
homepage = "https://github.com/FeralInteractive/gamemode";
|
||||||
|
changelog = "https://github.com/FeralInteractive/gamemode/blob/${finalAttrs.version}/CHANGELOG.md";
|
||||||
license = licenses.bsd3;
|
license = licenses.bsd3;
|
||||||
maintainers = with maintainers; [ kira-bruneau ];
|
maintainers = with maintainers; [ kira-bruneau ];
|
||||||
platforms = platforms.linux;
|
platforms = platforms.linux;
|
||||||
|
mainProgram = "gamemoderun"; # Requires NixOS module to run
|
||||||
};
|
};
|
||||||
}
|
})
|
||||||
|
|
|
@ -1,16 +0,0 @@
|
||||||
diff --git i/data/meson.build w/data/meson.build
|
|
||||||
index 6fb82d8..2e9e170 100644
|
|
||||||
--- i/data/meson.build
|
|
||||||
+++ w/data/meson.build
|
|
||||||
@@ -21,11 +21,6 @@ if sd_bus_provider == 'systemd'
|
|
||||||
configuration: data_conf,
|
|
||||||
install_dir: path_systemd_unit_dir,
|
|
||||||
)
|
|
||||||
- # Install the sysusers.d file
|
|
||||||
- install_data(
|
|
||||||
- files('gamemode.conf'),
|
|
||||||
- install_dir: path_systemd_sysusers_dir,
|
|
||||||
- )
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Install the D-BUS service file
|
|
|
@ -6,7 +6,7 @@ index 573b3e4..6f2799e 100755
|
||||||
|
|
||||||
# ld will find the right path to load the library, including for 32-bit apps.
|
# ld will find the right path to load the library, including for 32-bit apps.
|
||||||
LD_PRELOAD="${GAMEMODEAUTO_NAME}${LD_PRELOAD:+:$LD_PRELOAD}"
|
LD_PRELOAD="${GAMEMODEAUTO_NAME}${LD_PRELOAD:+:$LD_PRELOAD}"
|
||||||
+LD_LIBRARY_PATH="@libraryPath@${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
|
+LD_LIBRARY_PATH="@libraryPath@${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
|
||||||
|
|
||||||
-exec env LD_PRELOAD="${LD_PRELOAD}" $GAMEMODERUNEXEC "$@"
|
-exec env LD_PRELOAD="${LD_PRELOAD}" $GAMEMODERUNEXEC "$@"
|
||||||
+exec env LD_PRELOAD="${LD_PRELOAD}" LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" $GAMEMODERUNEXEC "$@"
|
+exec env LD_PRELOAD="${LD_PRELOAD}" LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" $GAMEMODERUNEXEC "$@"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue