From 83c65fd633ae13ac74a0d2a95e567ca369ee42ae Mon Sep 17 00:00:00 2001 From: Kira Bruneau Date: Thu, 13 Apr 2023 22:16:10 -0400 Subject: [PATCH 1/7] mangohud: prefer finalAttrs over rec --- pkgs/tools/graphics/mangohud/default.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/graphics/mangohud/default.nix b/pkgs/tools/graphics/mangohud/default.nix index d4aaa79a7c76..d0c4c088ddd3 100644 --- a/pkgs/tools/graphics/mangohud/default.nix +++ b/pkgs/tools/graphics/mangohud/default.nix @@ -82,14 +82,15 @@ let hash = "sha256-hgNYz15z9FjNHoj4w4EW0SOrQh1c4uQSnsOOrt2CDhc="; }; }; -in stdenv.mkDerivation rec { +in +stdenv.mkDerivation (finalAttrs: { pname = "mangohud"; version = "0.6.8"; src = fetchFromGitHub { owner = "flightlessmango"; repo = "MangoHud"; - rev = "refs/tags/v${version}"; + rev = "refs/tags/v${finalAttrs.version}"; fetchSubmodules = true; sha256 = "sha256-jfmgN90kViHa7vMOjo2x4bNY2QbLk93uYEvaA4DxYvg="; }; @@ -204,4 +205,4 @@ in stdenv.mkDerivation rec { license = licenses.mit; maintainers = with maintainers; [ kira-bruneau zeratax ]; }; -} +}) From eefb3eb9a4cb639d8598535fc2fb44c392dd60a0 Mon Sep 17 00:00:00 2001 From: Kira Bruneau Date: Thu, 13 Apr 2023 22:18:11 -0400 Subject: [PATCH 2/7] mangohud: switch back to using system spdlog The issue that required us to use the static subproject version has been fixed: https://github.com/ValveSoftware/steam-runtime/issues/511 --- pkgs/tools/graphics/mangohud/default.nix | 26 +++--------------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/pkgs/tools/graphics/mangohud/default.nix b/pkgs/tools/graphics/mangohud/default.nix index d0c4c088ddd3..b82cf971482c 100644 --- a/pkgs/tools/graphics/mangohud/default.nix +++ b/pkgs/tools/graphics/mangohud/default.nix @@ -22,6 +22,7 @@ , pkg-config , unzip , libXNVCtrl +, spdlog , wayland , glew , glfw @@ -47,27 +48,6 @@ let }; }; - # Derived from subprojects/spdlog.wrap - # - # NOTE: We only statically link spdlog due to a bug in pressure-vessel: - # https://github.com/ValveSoftware/steam-runtime/issues/511 - # - # Once this fix is released upstream, we should switch back to using - # the system provided spdlog - spdlog = rec { - version = "1.8.5"; - src = fetchFromGitHub { - owner = "gabime"; - repo = "spdlog"; - rev = "refs/tags/v${version}"; - sha256 = "sha256-D29jvDZQhPscaOHlrzGN1s7/mXlcsovjbqYpXd7OM50="; - }; - patch = fetchurl { - url = "https://wrapdb.mesonbuild.com/v2/spdlog_${version}-1/get_patch"; - sha256 = "sha256-PDjyddV5KxKGORECWUMp6YsXc3kks0T5gxKrCZKbdL4="; - }; - }; - # Derived from subprojects/vulkan-headers.wrap vulkan-headers = rec { version = "1.2.158"; @@ -101,7 +81,6 @@ stdenv.mkDerivation (finalAttrs: { postUnpack = ''( cd "$sourceRoot/subprojects" cp -R --no-preserve=mode,ownership ${imgui.src} imgui-${imgui.version} - cp -R --no-preserve=mode,ownership ${spdlog.src} spdlog-${spdlog.version} cp -R --no-preserve=mode,ownership ${vulkan-headers.src} Vulkan-Headers-${vulkan-headers.version} )''; @@ -142,12 +121,12 @@ stdenv.mkDerivation (finalAttrs: { postPatch = ''( cd subprojects unzip ${imgui.patch} - unzip ${spdlog.patch} unzip ${vulkan-headers.patch} )''; mesonFlags = [ "-Dwith_wayland=enabled" + "-Duse_system_spdlog=enabled" ] ++ lib.optionals gamescopeSupport [ "-Dmangoapp_layer=true" "-Dmangoapp=true" @@ -169,6 +148,7 @@ stdenv.mkDerivation (finalAttrs: { dbus libX11 libXNVCtrl + spdlog wayland ] ++ lib.optionals gamescopeSupport [ glew From d9cb109138cb32c7441794072e6fc122e8b08473 Mon Sep 17 00:00:00 2001 From: Kira Bruneau Date: Fri, 14 Apr 2023 07:55:56 -0400 Subject: [PATCH 3/7] mangohud: move loader header deps to nativeBuildInputs --- pkgs/tools/graphics/mangohud/default.nix | 15 +++++++++------ .../graphics/mangohud/hardcode-dependencies.patch | 10 ---------- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/pkgs/tools/graphics/mangohud/default.nix b/pkgs/tools/graphics/mangohud/default.nix index b82cf971482c..891f8806fab4 100644 --- a/pkgs/tools/graphics/mangohud/default.nix +++ b/pkgs/tools/graphics/mangohud/default.nix @@ -11,7 +11,6 @@ , xdg-utils , dbus , hwdata -, libX11 , mangohud32 , appstream , glslang @@ -22,8 +21,9 @@ , pkg-config , unzip , libXNVCtrl -, spdlog , wayland +, libX11 +, spdlog , glew , glfw , nlohmann_json @@ -102,7 +102,7 @@ stdenv.mkDerivation (finalAttrs: { ]; libdbus = dbus.lib; - inherit hwdata libX11; + inherit hwdata; }) ] ++ lib.optionals (stdenv.hostPlatform.system == "x86_64-linux") [ # Support 32bit OpenGL applications by appending the mangohud32 @@ -142,14 +142,17 @@ stdenv.mkDerivation (finalAttrs: { ninja pkg-config unzip + + # Only the headers are used from these packages + # The corresponding libraries are loaded at runtime from the app's runpath + libXNVCtrl + wayland + libX11 ]; buildInputs = [ dbus - libX11 - libXNVCtrl spdlog - wayland ] ++ lib.optionals gamescopeSupport [ glew glfw diff --git a/pkgs/tools/graphics/mangohud/hardcode-dependencies.patch b/pkgs/tools/graphics/mangohud/hardcode-dependencies.patch index 0416008a99a3..debd33d10784 100644 --- a/pkgs/tools/graphics/mangohud/hardcode-dependencies.patch +++ b/pkgs/tools/graphics/mangohud/hardcode-dependencies.patch @@ -11,16 +11,6 @@ index 3b3cccb..1405725 100644 SPDLOG_ERROR("Could not load libdbus-1.so.3"); return false; } -diff --git a/src/loaders/loader_x11.cpp b/src/loaders/loader_x11.cpp -index 4db6f78..c60d08c 100644 ---- a/src/loaders/loader_x11.cpp -+++ b/src/loaders/loader_x11.cpp -@@ -89,4 +89,4 @@ void libx11_loader::CleanUp(bool unload) { - - } - --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 1668226..f0c8df5 100644 --- a/src/logging.cpp From 62bad427ffb0104cf5c577ca45557f7d3bce7faf Mon Sep 17 00:00:00 2001 From: Kira Bruneau Date: Thu, 13 Apr 2023 23:20:12 -0400 Subject: [PATCH 4/7] mangohud: suport nvidia cards when directly using vulkan layer Before this change, NVIDIA GPUs were only supported when using the mangohud & mangoapp binaries. This extends support to direct use of the Vulkan layer (enabled through `MANGOHUD=1`). --- pkgs/tools/graphics/mangohud/default.nix | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pkgs/tools/graphics/mangohud/default.nix b/pkgs/tools/graphics/mangohud/default.nix index 891f8806fab4..82f2c65009a2 100644 --- a/pkgs/tools/graphics/mangohud/default.nix +++ b/pkgs/tools/graphics/mangohud/default.nix @@ -12,6 +12,7 @@ , dbus , hwdata , mangohud32 +, addOpenGLRunpath , appstream , glslang , makeWrapper @@ -28,7 +29,6 @@ , glfw , nlohmann_json , xorg -, addOpenGLRunpath , gamescopeSupport ? true # build mangoapp and mangohudctl }: @@ -134,6 +134,7 @@ stdenv.mkDerivation (finalAttrs: { ]; nativeBuildInputs = [ + addOpenGLRunpath appstream glslang makeWrapper @@ -167,18 +168,17 @@ stdenv.mkDerivation (finalAttrs: { "$out/share/vulkan/implicit_layer.d/MangoHud.x86.json" ''; - # Support Nvidia cards by adding OpenGL path and support overlaying - # Vulkan applications without requiring MangoHud to be installed postFixup = '' + # Add OpenGL driver path to RUNPATH to support NVIDIA cards + addOpenGLRunpath "$out/lib/mangohud/libMangoHud.so" + ${lib.optionalString gamescopeSupport '' + addOpenGLRunpath "$out/bin/mangoapp" + ''} + + # Prefix XDG_DATA_DIRS to support overlaying Vulkan apps without + # requiring MangoHud to be installed wrapProgram "$out/bin/mangohud" \ - --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ addOpenGLRunpath.driverLink ]} \ --prefix XDG_DATA_DIRS : "$out/share" - '' + lib.optionalString (gamescopeSupport) '' - if [[ -e "$out/bin/mangoapp" ]]; then - wrapProgram "$out/bin/mangoapp" \ - --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ addOpenGLRunpath.driverLink ]} \ - --prefix XDG_DATA_DIRS : "$out/share" - fi ''; meta = with lib; { From 69ac4b600b63f72c01244ee8e9635673d63f04de Mon Sep 17 00:00:00 2001 From: Kira Bruneau Date: Fri, 14 Apr 2023 11:16:07 -0400 Subject: [PATCH 5/7] mangohud: support 32bit mango app vulkan layer --- pkgs/tools/graphics/mangohud/default.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/graphics/mangohud/default.nix b/pkgs/tools/graphics/mangohud/default.nix index 82f2c65009a2..665118808c19 100644 --- a/pkgs/tools/graphics/mangohud/default.nix +++ b/pkgs/tools/graphics/mangohud/default.nix @@ -161,11 +161,16 @@ stdenv.mkDerivation (finalAttrs: { xorg.libXrandr ]; - # Support 32bit Vulkan applications by linking in 32bit Vulkan layer + # Support 32bit Vulkan applications by linking in 32bit Vulkan layers # This is needed for the same reason the 32bit OpenGL workaround is needed. postInstall = lib.optionalString (stdenv.hostPlatform.system == "x86_64-linux") '' ln -s ${mangohud32}/share/vulkan/implicit_layer.d/MangoHud.json \ "$out/share/vulkan/implicit_layer.d/MangoHud.x86.json" + + ${lib.optionalString gamescopeSupport '' + ln -s ${mangohud32}/share/vulkan/implicit_layer.d/libMangoApp.json \ + "$out/share/vulkan/implicit_layer.d/libMangoApp.x86.json" + ''} ''; postFixup = '' From a98e3adeeb186033883d5d737b07af34ebafd622 Mon Sep 17 00:00:00 2001 From: Kira Bruneau Date: Thu, 13 Apr 2023 22:28:05 -0400 Subject: [PATCH 6/7] mangohud: add update script --- pkgs/tools/graphics/mangohud/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/tools/graphics/mangohud/default.nix b/pkgs/tools/graphics/mangohud/default.nix index 665118808c19..734f504caad3 100644 --- a/pkgs/tools/graphics/mangohud/default.nix +++ b/pkgs/tools/graphics/mangohud/default.nix @@ -30,6 +30,7 @@ , nlohmann_json , xorg , gamescopeSupport ? true # build mangoapp and mangohudctl +, nix-update-script }: let @@ -186,6 +187,8 @@ stdenv.mkDerivation (finalAttrs: { --prefix XDG_DATA_DIRS : "$out/share" ''; + passthru.updateScript = nix-update-script { }; + meta = with lib; { description = "A Vulkan and OpenGL overlay for monitoring FPS, temperatures, CPU/GPU load and more"; homepage = "https://github.com/flightlessmango/MangoHud"; From 332d775c5337005b669327f7fe90438f2d9b4af2 Mon Sep 17 00:00:00 2001 From: Kira Bruneau Date: Thu, 13 Apr 2023 22:07:03 +0000 Subject: [PATCH 7/7] mangohud: 0.6.8 -> 0.6.9 --- pkgs/tools/graphics/mangohud/default.nix | 75 +++++++++---------- .../mangohud/hardcode-dependencies.patch | 10 +-- .../mangohud/opengl32-nix-workaround.patch | 12 --- .../mangohud/preload-nix-workaround.patch | 26 +++++++ 4 files changed, 65 insertions(+), 58 deletions(-) delete mode 100644 pkgs/tools/graphics/mangohud/opengl32-nix-workaround.patch create mode 100644 pkgs/tools/graphics/mangohud/preload-nix-workaround.patch diff --git a/pkgs/tools/graphics/mangohud/default.nix b/pkgs/tools/graphics/mangohud/default.nix index 734f504caad3..c3710c1c6efb 100644 --- a/pkgs/tools/graphics/mangohud/default.nix +++ b/pkgs/tools/graphics/mangohud/default.nix @@ -13,9 +13,7 @@ , hwdata , mangohud32 , addOpenGLRunpath -, appstream , glslang -, makeWrapper , mako , meson , ninja @@ -24,10 +22,10 @@ , libXNVCtrl , wayland , libX11 +, nlohmann_json , spdlog , glew , glfw -, nlohmann_json , xorg , gamescopeSupport ? true # build mangoapp and mangohudctl , nix-update-script @@ -41,11 +39,11 @@ let owner = "ocornut"; repo = "imgui"; rev = "refs/tags/v${version}"; - sha256 = "sha256-rRkayXk3xz758v6vlMSaUu5fui6NR8Md3njhDB0gJ18="; + hash = "sha256-rRkayXk3xz758v6vlMSaUu5fui6NR8Md3njhDB0gJ18="; }; patch = fetchurl { url = "https://wrapdb.mesonbuild.com/v2/imgui_${version}-1/get_patch"; - sha256 = "sha256-bQC0QmkLalxdj4mDEdqvvOFtNwz2T1MpTDuMXGYeQ18="; + hash = "sha256-bQC0QmkLalxdj4mDEdqvvOFtNwz2T1MpTDuMXGYeQ18="; }; }; @@ -66,14 +64,14 @@ let in stdenv.mkDerivation (finalAttrs: { pname = "mangohud"; - version = "0.6.8"; + version = "0.6.9"; src = fetchFromGitHub { owner = "flightlessmango"; repo = "MangoHud"; rev = "refs/tags/v${finalAttrs.version}"; fetchSubmodules = true; - sha256 = "sha256-jfmgN90kViHa7vMOjo2x4bNY2QbLk93uYEvaA4DxYvg="; + hash = "sha256-wvidO9LAZwVUZhYYWnelSiP0Q1WTPoCg6pMXsoJBPPg="; }; outputs = [ "out" "doc" "man" ]; @@ -85,9 +83,12 @@ stdenv.mkDerivation (finalAttrs: { cp -R --no-preserve=mode,ownership ${vulkan-headers.src} Vulkan-Headers-${vulkan-headers.version} )''; - env.NIX_CFLAGS_COMPILE = "-I${vulkan-headers.src}/include"; - patches = [ + # Add @libraryPath@ template variable to fix loading the preload + # library and @dataPath@ to support overlaying Vulkan apps without + # requiring MangoHud to be installed + ./preload-nix-workaround.patch + # Hard code dependencies. Can't use makeWrapper since the Vulkan # layer can be used without the mangohud executable by setting MANGOHUD=1. (substituteAll { @@ -105,40 +106,37 @@ stdenv.mkDerivation (finalAttrs: { libdbus = dbus.lib; inherit hwdata; }) - ] ++ lib.optionals (stdenv.hostPlatform.system == "x86_64-linux") [ - # Support 32bit OpenGL applications by appending the mangohud32 - # lib path to LD_LIBRARY_PATH. - # - # This workaround is necessary since on Nix's build of ld.so, $LIB - # always expands to lib even when running an 32bit application. - # - # See https://github.com/NixOS/nixpkgs/issues/101597. - (substituteAll { - src = ./opengl32-nix-workaround.patch; - inherit mangohud32; - }) ]; - postPatch = ''( - cd subprojects - unzip ${imgui.patch} - unzip ${vulkan-headers.patch} - )''; + postPatch = '' + substituteInPlace bin/mangohud.in \ + --subst-var-by libraryPath ${lib.makeSearchPath "lib/mangohud" ([ + (placeholder "out") + ] ++ lib.optionals (stdenv.hostPlatform.system == "x86_64-linux") [ + mangohud32 + ])} \ + --subst-var-by dataDir ${placeholder "out"}/share + + ( + cd subprojects + unzip ${imgui.patch} + unzip ${vulkan-headers.patch} + ) + ''; mesonFlags = [ "-Dwith_wayland=enabled" "-Duse_system_spdlog=enabled" + "-Dtests=disabled" # Tests require AMD GPU ] ++ lib.optionals gamescopeSupport [ - "-Dmangoapp_layer=true" "-Dmangoapp=true" + "-Dmangoapp_layer=true" "-Dmangohudctl=true" ]; nativeBuildInputs = [ addOpenGLRunpath - appstream glslang - makeWrapper mako meson ninja @@ -154,37 +152,32 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ dbus + nlohmann_json spdlog ] ++ lib.optionals gamescopeSupport [ glew glfw - nlohmann_json xorg.libXrandr ]; # Support 32bit Vulkan applications by linking in 32bit Vulkan layers - # This is needed for the same reason the 32bit OpenGL workaround is needed. + # This is needed for the same reason the 32bit preload workaround is needed. postInstall = lib.optionalString (stdenv.hostPlatform.system == "x86_64-linux") '' - ln -s ${mangohud32}/share/vulkan/implicit_layer.d/MangoHud.json \ - "$out/share/vulkan/implicit_layer.d/MangoHud.x86.json" + ln -s ${mangohud32}/share/vulkan/implicit_layer.d/MangoHud.x86.json \ + "$out/share/vulkan/implicit_layer.d" ${lib.optionalString gamescopeSupport '' - ln -s ${mangohud32}/share/vulkan/implicit_layer.d/libMangoApp.json \ - "$out/share/vulkan/implicit_layer.d/libMangoApp.x86.json" + ln -s ${mangohud32}/share/vulkan/implicit_layer.d/libMangoApp.x86.json \ + "$out/share/vulkan/implicit_layer.d" ''} ''; + # Add OpenGL driver path to RUNPATH to support NVIDIA cards postFixup = '' - # Add OpenGL driver path to RUNPATH to support NVIDIA cards addOpenGLRunpath "$out/lib/mangohud/libMangoHud.so" ${lib.optionalString gamescopeSupport '' addOpenGLRunpath "$out/bin/mangoapp" ''} - - # Prefix XDG_DATA_DIRS to support overlaying Vulkan apps without - # requiring MangoHud to be installed - wrapProgram "$out/bin/mangohud" \ - --prefix XDG_DATA_DIRS : "$out/share" ''; passthru.updateScript = nix-update-script { }; diff --git a/pkgs/tools/graphics/mangohud/hardcode-dependencies.patch b/pkgs/tools/graphics/mangohud/hardcode-dependencies.patch index debd33d10784..d2b11673d77f 100644 --- a/pkgs/tools/graphics/mangohud/hardcode-dependencies.patch +++ b/pkgs/tools/graphics/mangohud/hardcode-dependencies.patch @@ -1,5 +1,5 @@ diff --git a/src/dbus.cpp b/src/dbus.cpp -index 3b3cccb..1405725 100644 +index 7379af1..4eef3fe 100644 --- a/src/dbus.cpp +++ b/src/dbus.cpp @@ -152,7 +152,7 @@ bool dbus_manager::get_media_player_metadata(metadata& meta, std::string name) { @@ -12,10 +12,10 @@ index 3b3cccb..1405725 100644 return false; } diff --git a/src/logging.cpp b/src/logging.cpp -index 1668226..f0c8df5 100644 +index 046c847..42782be 100644 --- a/src/logging.cpp +++ b/src/logging.cpp -@@ -24,7 +24,11 @@ string exec(string command) { +@@ -26,7 +26,11 @@ string exec(string command) { #endif std::array buffer; std::string result; @@ -28,10 +28,10 @@ index 1668226..f0c8df5 100644 return "popen failed!"; } diff --git a/src/pci_ids.cpp b/src/pci_ids.cpp -index feec222..6baa707 100644 +index 002a843..5a6262b 100644 --- a/src/pci_ids.cpp +++ b/src/pci_ids.cpp -@@ -24,11 +24,9 @@ std::istream& get_uncommented_line(std::istream& is, std::string &line) +@@ -24,11 +24,9 @@ static std::istream& get_uncommented_line(std::istream& is, std::string &line) void parse_pciids() { std::ifstream file; diff --git a/pkgs/tools/graphics/mangohud/opengl32-nix-workaround.patch b/pkgs/tools/graphics/mangohud/opengl32-nix-workaround.patch deleted file mode 100644 index 03af397faee7..000000000000 --- a/pkgs/tools/graphics/mangohud/opengl32-nix-workaround.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/bin/mangohud.in b/bin/mangohud.in -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}${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}" "$@" diff --git a/pkgs/tools/graphics/mangohud/preload-nix-workaround.patch b/pkgs/tools/graphics/mangohud/preload-nix-workaround.patch new file mode 100644 index 000000000000..e360d8c1876a --- /dev/null +++ b/pkgs/tools/graphics/mangohud/preload-nix-workaround.patch @@ -0,0 +1,26 @@ +diff --git a/bin/mangohud.in b/bin/mangohud.in +index f975224..24936eb 100755 +--- a/bin/mangohud.in ++++ b/bin/mangohud.in +@@ -8,16 +8,18 @@ if [ "$#" -eq 0 ]; then + exit 1 + fi + +-MANGOHUD_LIB_NAME="@ld_libdir_mangohud@libMangoHud.so" ++MANGOHUD_LIB_NAME="libMangoHud.so" + + if [ "$1" = "--dlsym" ]; then + MANGOHUD_DLSYM=1 +- MANGOHUD_LIB_NAME="@ld_libdir_mangohud@libMangoHud_dlsym.so:${MANGOHUD_LIB_NAME}" ++ MANGOHUD_LIB_NAME="libMangoHud_dlsym.so:${MANGOHUD_LIB_NAME}" + shift + fi + + # Preload using the plain filenames of the libs, the dynamic linker will + # figure out whether the 32 or 64 bit version should be used + LD_PRELOAD="${LD_PRELOAD:+$LD_PRELOAD:}${MANGOHUD_LIB_NAME}" ++LD_LIBRARY_PATH="@libraryPath@${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" ++XDG_DATA_DIRS="@dataDir@${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}" + +-exec env MANGOHUD=1 LD_PRELOAD="${LD_PRELOAD}" "$@" ++exec env MANGOHUD=1 LD_PRELOAD="${LD_PRELOAD}" LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" XDG_DATA_DIRS="${XDG_DATA_DIRS}" "$@"