diff --git a/pkgs/tools/graphics/mangohud/default.nix b/pkgs/tools/graphics/mangohud/default.nix index fc0fc9930d78..bb14ef0f3702 100644 --- a/pkgs/tools/graphics/mangohud/default.nix +++ b/pkgs/tools/graphics/mangohud/default.nix @@ -4,7 +4,6 @@ , fetchFromGitHub , fetchurl , substituteAll -, fetchpatch , coreutils , curl , glxinfo @@ -34,6 +33,7 @@ , gamescopeSupport ? true # build mangoapp and mangohudctl , lowerBitnessSupport ? stdenv.hostPlatform.isx86_64 # Support 32 bit on 64bit , nix-update-script +, libxkbcommon }: let @@ -94,14 +94,14 @@ let in stdenv.mkDerivation (finalAttrs: { pname = "mangohud"; - version = "0.7.1"; + version = "0.7.2"; src = fetchFromGitHub { owner = "flightlessmango"; repo = "MangoHud"; rev = "refs/tags/v${finalAttrs.version}"; fetchSubmodules = true; - hash = "sha256-Gnq+1j+PFbeipAfXGnTq7wZdVQeG9R9vLAKZnZj7Bvs="; + hash = "sha256-cj/F/DWUDm2AHTJvHgkKa+KdIrfxPWLzI570Dp4VFhs="; }; outputs = [ "out" "doc" "man" ]; @@ -140,13 +140,6 @@ stdenv.mkDerivation (finalAttrs: { libdbus = dbus.lib; inherit hwdata; }) - - # Add dep_vulkan to mangoapp and test_amdgpu to fix build failure - # TODO: Remove in next release - (fetchpatch { - url = "https://github.com/flightlessmango/MangoHud/commit/cba217ffaf93aea6acb4e59e3e46bf912f740ccf.patch"; - hash = "sha256-1My4/EuSMpe3AFhhFOJr8rz/wnywp+BW+F4dSgxToe0="; - }) ]; postPatch = '' @@ -202,6 +195,7 @@ stdenv.mkDerivation (finalAttrs: { glew glfw xorg.libXrandr + libxkbcommon ]; doCheck = true; diff --git a/pkgs/tools/graphics/mangohud/hardcode-dependencies.patch b/pkgs/tools/graphics/mangohud/hardcode-dependencies.patch index 1c0f3a497fe6..4b7954a3ee5e 100644 --- a/pkgs/tools/graphics/mangohud/hardcode-dependencies.patch +++ b/pkgs/tools/graphics/mangohud/hardcode-dependencies.patch @@ -12,17 +12,18 @@ index 7379af1..4eef3fe 100644 return false; } diff --git a/src/logging.cpp b/src/logging.cpp -index ca33ee3..90d3638 100644 +index 7d4cb98..256128c 100644 --- a/src/logging.cpp +++ b/src/logging.cpp -@@ -26,7 +26,11 @@ string exec(string command) { +@@ -27,8 +27,12 @@ string exec(string command) { #endif std::array buffer; std::string result; + + char* originalPath = getenv("PATH"); + setenv("PATH", "@path@", 1); - std::unique_ptr pipe(popen(command.c_str(), "r"), pclose); + auto deleter = [](FILE* ptr){ pclose(ptr); }; + std::unique_ptr pipe(popen(command.c_str(), "r"), deleter); + setenv("PATH", originalPath, 1); if (!pipe) { return "popen failed!";