From 8677058a83e719eda3c5f29878e00571615c5a16 Mon Sep 17 00:00:00 2001 From: Kira Bruneau Date: Wed, 3 Aug 2022 19:20:23 -0400 Subject: mangohud: 0.6.7-1 → 0.6.8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkgs/tools/graphics/mangohud/default.nix | 30 ++++++++-------------- .../graphics/mangohud/hardcode-dependencies.patch | 22 ++-------------- .../mangohud/opengl32-nix-workaround.patch | 20 +++------------ 3 files changed, 16 insertions(+), 56 deletions(-) (limited to 'pkgs/tools/graphics/mangohud') diff --git a/pkgs/tools/graphics/mangohud/default.nix b/pkgs/tools/graphics/mangohud/default.nix index e62cfa6b8a803..26c1b99216c6e 100644 --- a/pkgs/tools/graphics/mangohud/default.nix +++ b/pkgs/tools/graphics/mangohud/default.nix @@ -1,28 +1,26 @@ { lib , stdenv , fetchFromGitHub -, fetchpatch , fetchurl , substituteAll , coreutils , curl -, gawk , glxinfo , gnugrep , gnused -, lsof , xdg-utils , dbus , hwdata , libX11 , mangohud32 , vulkan-headers +, appstream , glslang , makeWrapper +, Mako , meson , ninja , pkg-config -, python3Packages , unzip , vulkan-loader , libXNVCtrl @@ -43,24 +41,24 @@ let src = fetchFromGitHub { owner = "ocornut"; repo = "imgui"; - rev = "v${version}"; - hash = "sha256-rRkayXk3xz758v6vlMSaUu5fui6NR8Md3njhDB0gJ18="; + rev = "refs/tags/v${version}"; + sha256 = "sha256-rRkayXk3xz758v6vlMSaUu5fui6NR8Md3njhDB0gJ18="; }; patch = fetchurl { url = "https://wrapdb.mesonbuild.com/v2/imgui_${version}-1/get_patch"; - hash = "sha256-bQC0QmkLalxdj4mDEdqvvOFtNwz2T1MpTDuMXGYeQ18="; + sha256 = "sha256-bQC0QmkLalxdj4mDEdqvvOFtNwz2T1MpTDuMXGYeQ18="; }; }; in stdenv.mkDerivation rec { pname = "mangohud"; - version = "0.6.7-1"; + version = "0.6.8"; src = fetchFromGitHub { owner = "flightlessmango"; repo = "MangoHud"; - rev = "v${version}"; + rev = "refs/tags/v${version}"; fetchSubmodules = true; - sha256 = "sha256-60cZYo+d679KRggLBGbpLYM5Iu1XySEEGp+MxZs6wF0="; + sha256 = "sha256-jfmgN90kViHa7vMOjo2x4bNY2QbLk93uYEvaA4DxYvg="; }; outputs = [ "out" "doc" "man" ]; @@ -81,23 +79,15 @@ in stdenv.mkDerivation rec { path = lib.makeBinPath [ coreutils curl - gawk glxinfo gnugrep gnused - lsof xdg-utils ]; libdbus = dbus.lib; inherit hwdata libX11; }) - - (fetchpatch { - name = "allow-system-nlohmann-json.patch"; - url = "https://github.com/flightlessmango/MangoHud/commit/e1ffa0f85820abea44639438fca2152290c87ee8.patch"; - sha256 = "sha256-CaJb0RpXmNGCBidMXM39VJVLIXb6NbN5HXWkH/5Sfvo="; - }) ] ++ lib.optional (stdenv.hostPlatform.system == "x86_64-linux") [ # Support 32bit OpenGL applications by appending the mangohud32 # lib path to LD_LIBRARY_PATH. @@ -124,13 +114,13 @@ in stdenv.mkDerivation rec { ]; nativeBuildInputs = [ + appstream glslang makeWrapper + Mako meson ninja pkg-config - python3Packages.Mako - python3Packages.python unzip vulkan-loader ]; diff --git a/pkgs/tools/graphics/mangohud/hardcode-dependencies.patch b/pkgs/tools/graphics/mangohud/hardcode-dependencies.patch index 379e1dd7ba23f..0416008a99a3e 100644 --- a/pkgs/tools/graphics/mangohud/hardcode-dependencies.patch +++ b/pkgs/tools/graphics/mangohud/hardcode-dependencies.patch @@ -1,15 +1,3 @@ -From 56a191f6db6d530c2bc89d9d3395b4c9768d108f Mon Sep 17 00:00:00 2001 -From: Atemu -Date: Tue, 17 May 2022 16:58:08 +0200 -Subject: [PATCH 1/2] hardcode dependencies - ---- - src/dbus.cpp | 2 +- - src/loaders/loader_x11.cpp | 2 +- - src/logging.cpp | 7 +++++++ - src/pci_ids.cpp | 6 ++---- - 4 files changed, 11 insertions(+), 6 deletions(-) - diff --git a/src/dbus.cpp b/src/dbus.cpp index 3b3cccb..1405725 100644 --- a/src/dbus.cpp @@ -34,21 +22,18 @@ index 4db6f78..c60d08c 100644 -std::shared_ptr g_x11(new libx11_loader("libX11.so.6")); +std::shared_ptr g_x11(new libx11_loader("@libX11@/lib/libX11.so.6")); diff --git a/src/logging.cpp b/src/logging.cpp -index b27f21e..48f5e03 100644 +index 1668226..f0c8df5 100644 --- a/src/logging.cpp +++ b/src/logging.cpp -@@ -22,7 +22,14 @@ string exec(string command) { +@@ -24,7 +24,11 @@ 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); -+ + setenv("PATH", originalPath, 1); -+ if (!pipe) { return "popen failed!"; } @@ -70,6 +55,3 @@ index feec222..6baa707 100644 } std::string line; --- -2.36.0 - diff --git a/pkgs/tools/graphics/mangohud/opengl32-nix-workaround.patch b/pkgs/tools/graphics/mangohud/opengl32-nix-workaround.patch index f4f2e112d945f..03af397faee78 100644 --- a/pkgs/tools/graphics/mangohud/opengl32-nix-workaround.patch +++ b/pkgs/tools/graphics/mangohud/opengl32-nix-workaround.patch @@ -1,24 +1,12 @@ -From 1ac93cbf0eed951af6967a81f731a0f418ea0b3d Mon Sep 17 00:00:00 2001 -From: Atemu -Date: Tue, 17 May 2022 16:58:45 +0200 -Subject: [PATCH 2/2] opengl32 nix workaround - ---- - bin/mangohud.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - diff --git a/bin/mangohud.in b/bin/mangohud.in -index 8ec21de..f65304a 100755 +index e13da99..086443c 100755 --- a/bin/mangohud.in +++ b/bin/mangohud.in @@ -23,6 +23,6 @@ fi # figure out whether the 32 or 64 bit version should be used, and will search # for it in the correct directory - LD_PRELOAD="${LD_PRELOAD}:${MANGOHUD_LIB_NAME}" --LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:@ld_libdir_mangohud@" -+LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:@ld_libdir_mangohud@:@mangohud32@/lib/mangohud" + LD_PRELOAD="${LD_PRELOAD}${LD_PRELOAD:+:}${MANGOHUD_LIB_NAME}" +-LD_LIBRARY_PATH="${LD_LIBRARY_PATH}${LD_LIBRARY_PATH:+:}@ld_libdir_mangohud@" ++LD_LIBRARY_PATH="${LD_LIBRARY_PATH}${LD_LIBRARY_PATH:+:}@ld_libdir_mangohud@:@mangohud32@/lib/mangohud" exec env MANGOHUD=1 LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" LD_PRELOAD="${LD_PRELOAD}" "$@" --- -2.36.0 - -- cgit 1.4.1