Merge pull request #185072 from kira-bruneau/mangohud-update

authored by Sandro and committed by GitHub 0438eb1b 74f63828

+17 -56
+10 -20
pkgs/tools/graphics/mangohud/default.nix
··· 1 1 { lib 2 2 , stdenv 3 3 , fetchFromGitHub 4 - , fetchpatch 5 4 , fetchurl 6 5 , substituteAll 7 6 , coreutils 8 7 , curl 9 - , gawk 10 8 , glxinfo 11 9 , gnugrep 12 10 , gnused 13 - , lsof 14 11 , xdg-utils 15 12 , dbus 16 13 , hwdata 17 14 , libX11 18 15 , mangohud32 19 16 , vulkan-headers 17 + , appstream 20 18 , glslang 21 19 , makeWrapper 20 + , Mako 22 21 , meson 23 22 , ninja 24 23 , pkg-config 25 - , python3Packages 26 24 , unzip 27 25 , vulkan-loader 28 26 , libXNVCtrl ··· 43 41 src = fetchFromGitHub { 44 42 owner = "ocornut"; 45 43 repo = "imgui"; 46 - rev = "v${version}"; 47 - hash = "sha256-rRkayXk3xz758v6vlMSaUu5fui6NR8Md3njhDB0gJ18="; 44 + rev = "refs/tags/v${version}"; 45 + sha256 = "sha256-rRkayXk3xz758v6vlMSaUu5fui6NR8Md3njhDB0gJ18="; 48 46 }; 49 47 patch = fetchurl { 50 48 url = "https://wrapdb.mesonbuild.com/v2/imgui_${version}-1/get_patch"; 51 - hash = "sha256-bQC0QmkLalxdj4mDEdqvvOFtNwz2T1MpTDuMXGYeQ18="; 49 + sha256 = "sha256-bQC0QmkLalxdj4mDEdqvvOFtNwz2T1MpTDuMXGYeQ18="; 52 50 }; 53 51 }; 54 52 in stdenv.mkDerivation rec { 55 53 pname = "mangohud"; 56 - version = "0.6.7-1"; 54 + version = "0.6.8"; 57 55 58 56 src = fetchFromGitHub { 59 57 owner = "flightlessmango"; 60 58 repo = "MangoHud"; 61 - rev = "v${version}"; 59 + rev = "refs/tags/v${version}"; 62 60 fetchSubmodules = true; 63 - sha256 = "sha256-60cZYo+d679KRggLBGbpLYM5Iu1XySEEGp+MxZs6wF0="; 61 + sha256 = "sha256-jfmgN90kViHa7vMOjo2x4bNY2QbLk93uYEvaA4DxYvg="; 64 62 }; 65 63 66 64 outputs = [ "out" "doc" "man" ]; ··· 81 79 path = lib.makeBinPath [ 82 80 coreutils 83 81 curl 84 - gawk 85 82 glxinfo 86 83 gnugrep 87 84 gnused 88 - lsof 89 85 xdg-utils 90 86 ]; 91 87 92 88 libdbus = dbus.lib; 93 89 inherit hwdata libX11; 94 90 }) 95 - 96 - (fetchpatch { 97 - name = "allow-system-nlohmann-json.patch"; 98 - url = "https://github.com/flightlessmango/MangoHud/commit/e1ffa0f85820abea44639438fca2152290c87ee8.patch"; 99 - sha256 = "sha256-CaJb0RpXmNGCBidMXM39VJVLIXb6NbN5HXWkH/5Sfvo="; 100 - }) 101 91 ] ++ lib.optional (stdenv.hostPlatform.system == "x86_64-linux") [ 102 92 # Support 32bit OpenGL applications by appending the mangohud32 103 93 # lib path to LD_LIBRARY_PATH. ··· 124 114 ]; 125 115 126 116 nativeBuildInputs = [ 117 + appstream 127 118 glslang 128 119 makeWrapper 120 + Mako 129 121 meson 130 122 ninja 131 123 pkg-config 132 - python3Packages.Mako 133 - python3Packages.python 134 124 unzip 135 125 vulkan-loader 136 126 ];
+2 -20
pkgs/tools/graphics/mangohud/hardcode-dependencies.patch
··· 1 - From 56a191f6db6d530c2bc89d9d3395b4c9768d108f Mon Sep 17 00:00:00 2001 2 - From: Atemu <atemu.main@gmail.com> 3 - Date: Tue, 17 May 2022 16:58:08 +0200 4 - Subject: [PATCH 1/2] hardcode dependencies 5 - 6 - --- 7 - src/dbus.cpp | 2 +- 8 - src/loaders/loader_x11.cpp | 2 +- 9 - src/logging.cpp | 7 +++++++ 10 - src/pci_ids.cpp | 6 ++---- 11 - 4 files changed, 11 insertions(+), 6 deletions(-) 12 - 13 1 diff --git a/src/dbus.cpp b/src/dbus.cpp 14 2 index 3b3cccb..1405725 100644 15 3 --- a/src/dbus.cpp ··· 34 22 -std::shared_ptr<libx11_loader> g_x11(new libx11_loader("libX11.so.6")); 35 23 +std::shared_ptr<libx11_loader> g_x11(new libx11_loader("@libX11@/lib/libX11.so.6")); 36 24 diff --git a/src/logging.cpp b/src/logging.cpp 37 - index b27f21e..48f5e03 100644 25 + index 1668226..f0c8df5 100644 38 26 --- a/src/logging.cpp 39 27 +++ b/src/logging.cpp 40 - @@ -22,7 +22,14 @@ string exec(string command) { 28 + @@ -24,7 +24,11 @@ string exec(string command) { 41 29 #endif 42 30 std::array<char, 128> buffer; 43 31 std::string result; 44 32 + 45 33 + char* originalPath = getenv("PATH"); 46 34 + setenv("PATH", "@path@", 1); 47 - + 48 35 std::unique_ptr<FILE, decltype(&pclose)> pipe(popen(command.c_str(), "r"), pclose); 49 - + 50 36 + setenv("PATH", originalPath, 1); 51 - + 52 37 if (!pipe) { 53 38 return "popen failed!"; 54 39 } ··· 70 55 } 71 56 72 57 std::string line; 73 - -- 74 - 2.36.0 75 -
+4 -16
pkgs/tools/graphics/mangohud/opengl32-nix-workaround.patch
··· 1 - From 1ac93cbf0eed951af6967a81f731a0f418ea0b3d Mon Sep 17 00:00:00 2001 2 - From: Atemu <atemu.main@gmail.com> 3 - Date: Tue, 17 May 2022 16:58:45 +0200 4 - Subject: [PATCH 2/2] opengl32 nix workaround 5 - 6 - --- 7 - bin/mangohud.in | 2 +- 8 - 1 file changed, 1 insertion(+), 1 deletion(-) 9 - 10 1 diff --git a/bin/mangohud.in b/bin/mangohud.in 11 - index 8ec21de..f65304a 100755 2 + index e13da99..086443c 100755 12 3 --- a/bin/mangohud.in 13 4 +++ b/bin/mangohud.in 14 5 @@ -23,6 +23,6 @@ fi 15 6 # figure out whether the 32 or 64 bit version should be used, and will search 16 7 # for it in the correct directory 17 - LD_PRELOAD="${LD_PRELOAD}:${MANGOHUD_LIB_NAME}" 18 - -LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:@ld_libdir_mangohud@" 19 - +LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:@ld_libdir_mangohud@:@mangohud32@/lib/mangohud" 8 + LD_PRELOAD="${LD_PRELOAD}${LD_PRELOAD:+:}${MANGOHUD_LIB_NAME}" 9 + -LD_LIBRARY_PATH="${LD_LIBRARY_PATH}${LD_LIBRARY_PATH:+:}@ld_libdir_mangohud@" 10 + +LD_LIBRARY_PATH="${LD_LIBRARY_PATH}${LD_LIBRARY_PATH:+:}@ld_libdir_mangohud@:@mangohud32@/lib/mangohud" 20 11 21 12 exec env MANGOHUD=1 LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" LD_PRELOAD="${LD_PRELOAD}" "$@" 22 - -- 23 - 2.36.0 24 -
+1
pkgs/top-level/all-packages.nix
··· 8576 8576 mangohud = callPackage ../tools/graphics/mangohud { 8577 8577 libXNVCtrl = linuxPackages.nvidia_x11.settings.libXNVCtrl; 8578 8578 mangohud32 = pkgsi686Linux.mangohud; 8579 + inherit (python3Packages) Mako; 8579 8580 }; 8580 8581 8581 8582 manix = callPackage ../tools/nix/manix {