Files
nixpkgs/pkgs/tools/graphics/mangohud/preload-nix-workaround.patch
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

32 lines
1.1 KiB
Diff

diff --git a/bin/mangohud.in b/bin/mangohud.in
index 4cffeed..c19b635 100755
--- a/bin/mangohud.in
+++ b/bin/mangohud.in
@@ -13,7 +13,9 @@ fi
DISABLE_LD_PRELOAD="cs2.sh
"
-MANGOHUD_LIB_NAME="@ld_libdir_mangohud@libMangoHud_shim.so"
+LD_LIBRARY_PATH="@libraryPath@${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
+XDG_DATA_DIRS="@dataDir@${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}"
+MANGOHUD_LIB_NAME="libMangoHud_shim.so"
if [ "$1" = "--version" ]; then
echo @version@
@@ -39,7 +41,7 @@ for exe in $DISABLE_LD_PRELOAD; do
done
if [ "$disable_preload" = true ]; then
- exec env MANGOHUD=1 "$@"
+ exec env MANGOHUD=1 LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" XDG_DATA_DIRS="${XDG_DATA_DIRS}" "$@"
else
# Make sure we don't append mangohud lib multiple times
# otherwise, this could cause issues with the steam runtime
@@ -52,5 +54,5 @@ else
LD_PRELOAD="${LD_PRELOAD:+$LD_PRELOAD:}${MANGOHUD_LIB_NAME}"
esac
- 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}" "$@"
fi