depot/third_party/nixpkgs/pkgs/tools/graphics/mangohud/preload-nix-workaround.patch
Default email 5e7c2d6cef Project import generated by Copybara.
GitOrigin-RevId: f99e5f03cc0aa231ab5950a15ed02afec45ed51a
2023-10-09 21:29:22 +02:00

26 lines
910 B
Diff

diff --git a/bin/mangohud.in b/bin/mangohud.in
index 6c3c6e8..8847cdc 100755
--- a/bin/mangohud.in
+++ b/bin/mangohud.in
@@ -8,10 +8,10 @@ if [ "$#" -eq 0 ]; then
exit 1
fi
-MANGOHUD_LIB_NAME="@ld_libdir_mangohud@libMangoHud_opengl.so"
+MANGOHUD_LIB_NAME="libMangoHud_opengl.so"
if [ "$1" = "--dlsym" ]; then
- MANGOHUD_LIB_NAME="@ld_libdir_mangohud@libMangoHud_dlsym.so:${MANGOHUD_LIB_NAME}"
+ MANGOHUD_LIB_NAME="libMangoHud_dlsym.so:${MANGOHUD_LIB_NAME}"
shift
fi
@@ -31,5 +31,7 @@ case ":${LD_PRELOAD-}:" in
LD_PRELOAD="${LD_PRELOAD:+$LD_PRELOAD:}${MANGOHUD_LIB_NAME}"
esac
+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}" "$@"