From 64d803029fed15d042f48922c10b488dbedf9fc8 Mon Sep 17 00:00:00 2001 From: Morgan Helton Date: Sat, 13 Jul 2024 12:17:50 -0500 Subject: [PATCH] gamescope: patch gamescopereaper path --- pkgs/by-name/ga/gamescope/gamescopereaper.patch | 13 +++++++++++++ pkgs/by-name/ga/gamescope/package.nix | 4 ++++ 2 files changed, 17 insertions(+) create mode 100644 pkgs/by-name/ga/gamescope/gamescopereaper.patch diff --git a/pkgs/by-name/ga/gamescope/gamescopereaper.patch b/pkgs/by-name/ga/gamescope/gamescopereaper.patch new file mode 100644 index 000000000000..8fabad10d3f0 --- /dev/null +++ b/pkgs/by-name/ga/gamescope/gamescopereaper.patch @@ -0,0 +1,13 @@ +diff --git a/src/Utils/Process.cpp b/src/Utils/Process.cpp +index 5688fb1..6cea8d8 100644 +--- a/src/Utils/Process.cpp ++++ b/src/Utils/Process.cpp +@@ -392,7 +392,7 @@ namespace gamescope::Process + pid_t SpawnProcessInWatchdog( char **argv, bool bRespawn, std::function fnPreambleInChild ) + { + std::vector args; +- args.push_back( (char *)"gamescopereaper" ); ++ args.push_back( (char *)"@gamescopereaper@" ); + if ( bRespawn ) + args.push_back( (char *)"--respawn" ); + args.push_back( (char *)"--" ); diff --git a/pkgs/by-name/ga/gamescope/package.nix b/pkgs/by-name/ga/gamescope/package.nix index 42fb7694c0f5..b1f93b041704 100644 --- a/pkgs/by-name/ga/gamescope/package.nix +++ b/pkgs/by-name/ga/gamescope/package.nix @@ -57,6 +57,8 @@ stdenv.mkDerivation (finalAttrs: { patches = [ # Make it look for shaders in the right place ./shaders-path.patch + # patch relative gamescopereaper path with absolute + ./gamescopereaper.patch ]; # We can't substitute the patch itself because substituteAll is itself a derivation, @@ -65,6 +67,8 @@ stdenv.mkDerivation (finalAttrs: { substituteInPlace src/reshade_effect_manager.cpp --replace "@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" ''; mesonFlags = [