steam: add /steamrt/run.sh

This is needed for Steam Beta which expects run.sh to print runtime library
paths.

Fixes #31384.
This commit is contained in:
Nikolay Amiantov 2017-11-11 15:51:12 +03:00
parent cbfb586151
commit 459e4b78db
1 changed files with 26 additions and 14 deletions

View File

@ -37,6 +37,20 @@ let
++ lib.optional withPrimus primus ++ lib.optional withPrimus primus
++ extraPkgs pkgs; ++ extraPkgs pkgs;
ldPath = map (x: "/steamrt/${steam-runtime-wrapped.arch}/" + x) steam-runtime-wrapped.libs
++ lib.optionals (steam-runtime-wrapped-i686 != null) (map (x: "/steamrt/${steam-runtime-wrapped-i686.arch}/" + x) steam-runtime-wrapped-i686.libs);
runSh = writeScript "run.sh" ''
#!${stdenv.shell}
runtime_paths="${lib.concatStringsSep ":" ldPath}"
if [ "$1" == "--print-steam-runtime-library-paths" ]; then
echo "$runtime_paths"
exit 0
fi
export LD_LIBRARY_PATH="$runtime_paths:$LD_LIBRARY_PATH"
exec "$@"
'';
in buildFHSUserEnv rec { in buildFHSUserEnv rec {
name = "steam"; name = "steam";
@ -74,6 +88,7 @@ in buildFHSUserEnv rec {
${lib.optionalString (steam-runtime-wrapped-i686 != null) '' ${lib.optionalString (steam-runtime-wrapped-i686 != null) ''
ln -s ../lib32/steam-runtime steamrt/${steam-runtime-wrapped-i686.arch} ln -s ../lib32/steam-runtime steamrt/${steam-runtime-wrapped-i686.arch}
''} ''}
ln -s ${runSh} steamrt/run.sh
''; '';
extraInstallCommands = '' extraInstallCommands = ''
@ -96,10 +111,7 @@ in buildFHSUserEnv rec {
targetPkgs = commonTargetPkgs; targetPkgs = commonTargetPkgs;
inherit multiPkgs extraBuildCommands; inherit multiPkgs extraBuildCommands;
runScript = runScript = writeScript "steam-run" ''
let ldPath = map (x: "/steamrt/${steam-runtime-wrapped.arch}/" + x) steam-runtime-wrapped.libs
++ lib.optionals (steam-runtime-wrapped-i686 != null) (map (x: "/steamrt/${steam-runtime-wrapped-i686.arch}/" + x) steam-runtime-wrapped-i686.libs);
in writeScript "steam-run" ''
#!${stdenv.shell} #!${stdenv.shell}
run="$1" run="$1"
if [ "$run" = "" ]; then if [ "$run" = "" ]; then