From 5e597210be4a7d55f945217ec113a3c81e165831 Mon Sep 17 00:00:00 2001 From: K900 Date: Fri, 21 Feb 2025 14:09:06 +0300 Subject: [PATCH] gamescope: also patch script paths This is important for integrated display settings on steamdeckses. --- pkgs/by-name/ga/gamescope/package.nix | 6 +++++- pkgs/by-name/ga/gamescope/scripts-path.patch | 13 +++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 pkgs/by-name/ga/gamescope/scripts-path.patch diff --git a/pkgs/by-name/ga/gamescope/package.nix b/pkgs/by-name/ga/gamescope/package.nix index 5a37da55a92f..1462e6e8a4ed 100644 --- a/pkgs/by-name/ga/gamescope/package.nix +++ b/pkgs/by-name/ga/gamescope/package.nix @@ -59,7 +59,8 @@ stdenv.mkDerivation (finalAttrs: { }; patches = [ - # Make it look for shaders in the right place + # Make it look for data in the right place + ./scripts-path.patch ./shaders-path.patch # patch relative gamescopereaper path with absolute ./gamescopereaper.patch @@ -69,8 +70,11 @@ stdenv.mkDerivation (finalAttrs: { # so `placeholder "out"` ends up pointing to the wrong place postPatch = '' substituteInPlace src/reshade_effect_manager.cpp --replace-fail "@out@" "$out" + substituteInPlace src/Script/Script.cpp --replace-fail "@out@" "$out" + # Patching shebangs in the main `libdisplay-info` build patchShebangs subprojects/libdisplay-info/tool/gen-search-table.py + # Replace gamescopereeaper with absolute path substituteInPlace src/Utils/Process.cpp --subst-var-by "gamescopereaper" "$out/bin/gamescopereaper" patchShebangs default_scripts_install.sh diff --git a/pkgs/by-name/ga/gamescope/scripts-path.patch b/pkgs/by-name/ga/gamescope/scripts-path.patch new file mode 100644 index 000000000000..331ede9e537f --- /dev/null +++ b/pkgs/by-name/ga/gamescope/scripts-path.patch @@ -0,0 +1,13 @@ +diff --git a/src/Script/Script.cpp b/src/Script/Script.cpp +index a104ee9..f7cfc8b 100644 +--- a/src/Script/Script.cpp ++++ b/src/Script/Script.cpp +@@ -130,7 +130,7 @@ namespace gamescope + } + else + { +- RunFolder( "/usr/share/gamescope/scripts", true ); ++ RunFolder( "@out@/share/gamescope/scripts", true ); + RunFolder( "/etc/gamescope/scripts", true ); + } +