Skip to content

Commit

Permalink
Merge pull request NixOS#314874 from Gliczy/mangohud
Browse files Browse the repository at this point in the history
mangohud: 0.7.1 -> 0.7.2
  • Loading branch information
kira-bruneau authored May 27, 2024
2 parents e7c35fd + 4911cf5 commit 09fff7d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
14 changes: 4 additions & 10 deletions pkgs/tools/graphics/mangohud/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
, fetchFromGitHub
, fetchurl
, substituteAll
, fetchpatch
, coreutils
, curl
, glxinfo
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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" ];
Expand Down Expand Up @@ -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 = ''
Expand Down Expand Up @@ -202,6 +195,7 @@ stdenv.mkDerivation (finalAttrs: {
glew
glfw
xorg.libXrandr
libxkbcommon
];

doCheck = true;
Expand Down
7 changes: 4 additions & 3 deletions pkgs/tools/graphics/mangohud/hardcode-dependencies.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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<char, 128> buffer;
std::string result;
+
+ char* originalPath = getenv("PATH");
+ setenv("PATH", "@path@", 1);
std::unique_ptr<FILE, decltype(&pclose)> pipe(popen(command.c_str(), "r"), pclose);
auto deleter = [](FILE* ptr){ pclose(ptr); };
std::unique_ptr<FILE, decltype(deleter)> pipe(popen(command.c_str(), "r"), deleter);
+ setenv("PATH", originalPath, 1);
if (!pipe) {
return "popen failed!";
Expand Down

0 comments on commit 09fff7d

Please sign in to comment.