lock: 1.3.0 -> 1.3.4 (#364295)
[NixPkgs.git] / pkgs / tools / graphics / mangohud / preload-nix-workaround.patch
blob5aa538b4c4c7a5289ab6702d6278b26c960baa62
1 diff --git a/bin/mangohud.in b/bin/mangohud.in
2 index 53c72ef..18240ea 100755
3 --- a/bin/mangohud.in
4 +++ b/bin/mangohud.in
5 @@ -13,13 +13,15 @@ fi
6 DISABLE_LD_PRELOAD="cs2.sh
7 some_other_exe"
9 -MANGOHUD_LIB_NAME="@ld_libdir_mangohud@libMangoHud_opengl.so"
10 +LD_LIBRARY_PATH="@libraryPath@${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
11 +XDG_DATA_DIRS="@dataDir@${XDG_DATA_DIRS:+:$XDG_DATA_DIRS}"
12 +MANGOHUD_LIB_NAME="libMangoHud_opengl.so"
14 if [ "$1" = "--dlsym" ]; then
15 - MANGOHUD_LIB_NAME="@ld_libdir_mangohud@libMangoHud_dlsym.so:${MANGOHUD_LIB_NAME}"
16 + MANGOHUD_LIB_NAME="libMangoHud_dlsym.so:${MANGOHUD_LIB_NAME}"
17 shift # shift will only be executed if $1 is "--dlsym"
18 elif [ "$MANGOHUD_DLSYM" = "1" ]; then
19 - MANGOHUD_LIB_NAME="@ld_libdir_mangohud@libMangoHud_dlsym.so:${MANGOHUD_LIB_NAME}"
20 + MANGOHUD_LIB_NAME="libMangoHud_dlsym.so:${MANGOHUD_LIB_NAME}"
23 if [ "$1" = "--version" ]; then
24 @@ -41,7 +43,7 @@ for exe in $DISABLE_LD_PRELOAD; do
25 done
27 if [ "$disable_preload" = true ]; then
28 - exec env MANGOHUD=1 "$@"
29 + exec env MANGOHUD=1 LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" XDG_DATA_DIRS="${XDG_DATA_DIRS}" "$@"
30 else
31 # Make sure we don't append mangohud lib multiple times
32 # otherwise, this could cause issues with the steam runtime
33 @@ -54,5 +56,5 @@ else
34 LD_PRELOAD="${LD_PRELOAD:+$LD_PRELOAD:}${MANGOHUD_LIB_NAME}"
35 esac
37 - exec env MANGOHUD=1 LD_PRELOAD="${LD_PRELOAD}" "$@"
38 + exec env MANGOHUD=1 LD_PRELOAD="${LD_PRELOAD}" LD_LIBRARY_PATH="${LD_LIBRARY_PATH}" XDG_DATA_DIRS="${XDG_DATA_DIRS}" "$@"