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

View file

@ -37,6 +37,20 @@ let
++ lib.optional withPrimus primus
++ 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 {
name = "steam";
@ -74,6 +88,7 @@ in buildFHSUserEnv rec {
${lib.optionalString (steam-runtime-wrapped-i686 != null) ''
ln -s ../lib32/steam-runtime steamrt/${steam-runtime-wrapped-i686.arch}
''}
ln -s ${runSh} steamrt/run.sh
'';
extraInstallCommands = ''
@ -96,10 +111,7 @@ in buildFHSUserEnv rec {
targetPkgs = commonTargetPkgs;
inherit multiPkgs extraBuildCommands;
runScript =
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" ''
runScript = writeScript "steam-run" ''
#!${stdenv.shell}
run="$1"
if [ "$run" = "" ]; then