From 3e57c2e2ba954283f1ea0bde45e871410e42d111 Mon Sep 17 00:00:00 2001 From: Kira Bruneau Date: Thu, 7 Dec 2023 08:52:39 -0500 Subject: [PATCH 1/7] gamemode: prefer finalAttrs over rec --- pkgs/tools/games/gamemode/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/games/gamemode/default.nix b/pkgs/tools/games/gamemode/default.nix index 25acf8cebb1e..87879c2d770f 100644 --- a/pkgs/tools/games/gamemode/default.nix +++ b/pkgs/tools/games/gamemode/default.nix @@ -16,7 +16,7 @@ , procps }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "gamemode"; version = "1.7"; @@ -107,4 +107,4 @@ stdenv.mkDerivation rec { maintainers = with maintainers; [ kira-bruneau ]; platforms = platforms.linux; }; -} +}) From 56669c8f5b3ce03381c23bd6682f3ce533167a4b Mon Sep 17 00:00:00 2001 From: Kira Bruneau Date: Thu, 7 Dec 2023 08:54:12 -0500 Subject: [PATCH 2/7] gamemode: fetch src from refs/tags --- pkgs/tools/games/gamemode/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/games/gamemode/default.nix b/pkgs/tools/games/gamemode/default.nix index 87879c2d770f..4fc7d9e54f91 100644 --- a/pkgs/tools/games/gamemode/default.nix +++ b/pkgs/tools/games/gamemode/default.nix @@ -22,8 +22,8 @@ stdenv.mkDerivation (finalAttrs: { src = fetchFromGitHub { owner = "FeralInteractive"; - repo = pname; - rev = version; + repo = "gamemode"; + rev = "refs/tags/${finalAttrs.version}"; sha256 = "sha256-DIFcmWFkoZOklo1keYcCl6n2GJgzWKC8usHFcJmfarU="; }; From cd034f4711f8b164352a773d5c99589a026c290a Mon Sep 17 00:00:00 2001 From: Kira Bruneau Date: Thu, 7 Dec 2023 08:53:52 -0500 Subject: [PATCH 3/7] gamemode: add mainProgram --- pkgs/tools/games/gamemode/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/tools/games/gamemode/default.nix b/pkgs/tools/games/gamemode/default.nix index 4fc7d9e54f91..84d856c49ff5 100644 --- a/pkgs/tools/games/gamemode/default.nix +++ b/pkgs/tools/games/gamemode/default.nix @@ -106,5 +106,6 @@ stdenv.mkDerivation (finalAttrs: { license = licenses.bsd3; maintainers = with maintainers; [ kira-bruneau ]; platforms = platforms.linux; + mainProgram = "gamemoderun"; # Requires NixOS module to run }; }) From d209e9900cd8cdefd7890b8bd04aa3ced8fb2279 Mon Sep 17 00:00:00 2001 From: Kira Bruneau Date: Thu, 31 Aug 2023 14:25:02 -0400 Subject: [PATCH 4/7] gamemode: add updateScript --- pkgs/tools/games/gamemode/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/tools/games/gamemode/default.nix b/pkgs/tools/games/gamemode/default.nix index 84d856c49ff5..9d2d3f7c6a3e 100644 --- a/pkgs/tools/games/gamemode/default.nix +++ b/pkgs/tools/games/gamemode/default.nix @@ -14,6 +14,7 @@ , findutils , gawk , procps +, nix-update-script }: stdenv.mkDerivation (finalAttrs: { @@ -100,6 +101,8 @@ stdenv.mkDerivation (finalAttrs: { ]} ''; + passthru.updateScript = nix-update-script { }; + meta = with lib; { description = "Optimise Linux system performance on demand"; homepage = "https://github.com/FeralInteractive/GameMode"; From d4aa883213e2ac0f3f470820c024549f6ebde693 Mon Sep 17 00:00:00 2001 From: Kira Bruneau Date: Fri, 8 Dec 2023 11:03:20 -0500 Subject: [PATCH 5/7] gamemode: add meta.changelog --- pkgs/tools/games/gamemode/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/games/gamemode/default.nix b/pkgs/tools/games/gamemode/default.nix index 9d2d3f7c6a3e..2b9c51d86285 100644 --- a/pkgs/tools/games/gamemode/default.nix +++ b/pkgs/tools/games/gamemode/default.nix @@ -105,7 +105,8 @@ stdenv.mkDerivation (finalAttrs: { meta = with lib; { 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; maintainers = with maintainers; [ kira-bruneau ]; platforms = platforms.linux; From 30a6b77c41d30c65ec9a91e658fea8da7bdd2480 Mon Sep 17 00:00:00 2001 From: Kira Bruneau Date: Thu, 7 Dec 2023 08:53:42 -0500 Subject: [PATCH 6/7] gamemode: 1.7 -> 1.8.1 https://github.com/FeralInteractive/gamemode/blob/1.8.1/CHANGELOG.md --- pkgs/tools/games/gamemode/default.nix | 35 +++++++------------ .../no-install-systemd-sysusers.patch | 16 --------- .../gamemode/preload-nix-workaround.patch | 2 +- 3 files changed, 13 insertions(+), 40 deletions(-) delete mode 100644 pkgs/tools/games/gamemode/no-install-systemd-sysusers.patch diff --git a/pkgs/tools/games/gamemode/default.nix b/pkgs/tools/games/gamemode/default.nix index 2b9c51d86285..928b9233bccd 100644 --- a/pkgs/tools/games/gamemode/default.nix +++ b/pkgs/tools/games/gamemode/default.nix @@ -1,8 +1,8 @@ { lib , stdenv , fetchFromGitHub -, fetchpatch , libgamemode32 +, makeWrapper , meson , ninja , pkg-config @@ -10,7 +10,6 @@ , inih , systemd , appstream -, makeWrapper , findutils , gawk , procps @@ -19,28 +18,20 @@ stdenv.mkDerivation (finalAttrs: { pname = "gamemode"; - version = "1.7"; + version = "1.8.1"; src = fetchFromGitHub { owner = "FeralInteractive"; repo = "gamemode"; rev = "refs/tags/${finalAttrs.version}"; - sha256 = "sha256-DIFcmWFkoZOklo1keYcCl6n2GJgzWKC8usHFcJmfarU="; + hash = "sha256-kusb58nGxYA3U9GbZdW3hLjA3NmHc+af0VT4iGRewBw="; }; - outputs = [ "out" "dev" "lib" "man" "static" ]; + outputs = [ "out" "dev" "lib" "man" ]; patches = [ # Add @libraryPath@ template variable to fix loading the PRELOAD library ./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 = '' @@ -67,12 +58,15 @@ stdenv.mkDerivation (finalAttrs: { ]; mesonFlags = [ - # libexec is just a way to package binaries without including them - # in PATH. It doesn't make sense to install them to $lib - # (the default behaviour in the meson hook). - "--libexecdir=${placeholder "out"}/libexec" - + "-Dwith-pam-limits-dir=etc/security/limits.d" "-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; @@ -80,11 +74,6 @@ stdenv.mkDerivation (finalAttrs: { appstream ]; - # Move static libraries to $static so $lib only contains dynamic libraries. - postInstall = '' - moveToOutput lib/*.a "$static" - ''; - postFixup = '' # Add $lib/lib to gamemoded & gamemode-simulate-game's rpath since # they use dlopen to load libgamemode. Can't use makeWrapper since diff --git a/pkgs/tools/games/gamemode/no-install-systemd-sysusers.patch b/pkgs/tools/games/gamemode/no-install-systemd-sysusers.patch deleted file mode 100644 index 27aa1d4d710c..000000000000 --- a/pkgs/tools/games/gamemode/no-install-systemd-sysusers.patch +++ /dev/null @@ -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 diff --git a/pkgs/tools/games/gamemode/preload-nix-workaround.patch b/pkgs/tools/games/gamemode/preload-nix-workaround.patch index 9c8db37f5d91..06989ff984ab 100644 --- a/pkgs/tools/games/gamemode/preload-nix-workaround.patch +++ b/pkgs/tools/games/gamemode/preload-nix-workaround.patch @@ -6,7 +6,7 @@ index 573b3e4..6f2799e 100755 # ld will find the right path to load the library, including for 32-bit apps. 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}" LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" $GAMEMODERUNEXEC "$@" From 02d4aa23069d83477e1cd4fd8675199df139ace0 Mon Sep 17 00:00:00 2001 From: Kira Bruneau Date: Thu, 7 Dec 2023 08:52:08 -0500 Subject: [PATCH 7/7] nixos/gamemode: format with nixpkgs-fmt --- nixos/modules/programs/gamemode.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/programs/gamemode.nix b/nixos/modules/programs/gamemode.nix index c43e2c2296f5..344f392852e2 100644 --- a/nixos/modules/programs/gamemode.nix +++ b/nixos/modules/programs/gamemode.nix @@ -18,7 +18,7 @@ in settings = mkOption { type = settingsFormat.type; - default = {}; + default = { }; description = lib.mdDoc '' System-wide configuration for GameMode (/etc/gamemode.ini). See gamemoded(8) man page for available settings.