Skip to content

Commit 7a18043

Browse files
author
Jonathan Ringer
committed
steam: chroot: export STEAM_LD_LIBRARY_PATH
1 parent 08ba31a commit 7a18043

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

pkgs/games/steam/chrootenv.nix

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ let
4242
ldPath = map (x: "/steamrt/${steam-runtime-wrapped.arch}/" + x) steam-runtime-wrapped.libs
4343
++ lib.optionals (steam-runtime-wrapped-i686 != null) (map (x: "/steamrt/${steam-runtime-wrapped-i686.arch}/" + x) steam-runtime-wrapped-i686.libs);
4444

45+
# Zachtronics and a few other studios expect STEAM_LD_LIBRARY_PATH to be present
46+
exportLDPath = ''
47+
export LD_LIBRARY_PATH=/lib32:/lib64:${lib.concatStringsSep ":" ldPath}\''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH
48+
export STEAM_LD_LIBRARY_PATH="$STEAM_LD_LIBRARY_PATH''${STEAM_LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
49+
'';
50+
4551
setupSh = writeScript "setup.sh" ''
4652
#!${runtimeShell}
4753
'';
@@ -54,6 +60,7 @@ let
5460
exit 0
5561
fi
5662
export LD_LIBRARY_PATH="$runtime_paths''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
63+
export STEAM_LD_LIBRARY_PATH="$STEAM_LD_LIBRARY_PATH''${STEAM_LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
5764
exec "$@"
5865
'';
5966

@@ -251,6 +258,7 @@ in buildFHSUserEnv rec {
251258
EOF
252259
fi
253260
fi
261+
${lib.optionalString (!nativeOnly) exportLDPath}
254262
exec steam "$@"
255263
'';
256264

@@ -272,7 +280,7 @@ in buildFHSUserEnv rec {
272280
exit 1
273281
fi
274282
shift
275-
${lib.optionalString (!nativeOnly) "export LD_LIBRARY_PATH=/lib32:/lib64:${lib.concatStringsSep ":" ldPath}\${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"}
283+
${lib.optionalString (!nativeOnly) exportLDPath}
276284
exec -- "$run" "$@"
277285
'';
278286
};

0 commit comments

Comments
 (0)