37
37
++ lib . optional withPrimus primus
38
38
++ extraPkgs pkgs ;
39
39
40
+ ldPath = map ( x : "/steamrt/${ steam-runtime-wrapped . arch } /" + x ) steam-runtime-wrapped . libs
41
+ ++ lib . optionals ( steam-runtime-wrapped-i686 != null ) ( map ( x : "/steamrt/${ steam-runtime-wrapped-i686 . arch } /" + x ) steam-runtime-wrapped-i686 . libs ) ;
42
+
43
+ runSh = writeScript "run.sh" ''
44
+ #!${ stdenv . shell }
45
+ runtime_paths="${ lib . concatStringsSep ":" ldPath } "
46
+ if [ "$1" == "--print-steam-runtime-library-paths" ]; then
47
+ echo "$runtime_paths"
48
+ exit 0
49
+ fi
50
+ export LD_LIBRARY_PATH="$runtime_paths:$LD_LIBRARY_PATH"
51
+ exec "$@"
52
+ '' ;
53
+
40
54
in buildFHSUserEnv rec {
41
55
name = "steam" ;
42
56
@@ -74,6 +88,7 @@ in buildFHSUserEnv rec {
74
88
${ lib . optionalString ( steam-runtime-wrapped-i686 != null ) ''
75
89
ln -s ../lib32/steam-runtime steamrt/${ steam-runtime-wrapped-i686 . arch }
76
90
'' }
91
+ ln -s ${ runSh } steamrt/run.sh
77
92
'' ;
78
93
79
94
extraInstallCommands = ''
@@ -96,19 +111,16 @@ in buildFHSUserEnv rec {
96
111
targetPkgs = commonTargetPkgs ;
97
112
inherit multiPkgs extraBuildCommands ;
98
113
99
- runScript =
100
- let ldPath = map ( x : "/steamrt/${ steam-runtime-wrapped . arch } /" + x ) steam-runtime-wrapped . libs
101
- ++ lib . optionals ( steam-runtime-wrapped-i686 != null ) ( map ( x : "/steamrt/${ steam-runtime-wrapped-i686 . arch } /" + x ) steam-runtime-wrapped-i686 . libs ) ;
102
- in writeScript "steam-run" ''
103
- #!${ stdenv . shell }
104
- run="$1"
105
- if [ "$run" = "" ]; then
106
- echo "Usage: steam-run command-to-run args..." >&2
107
- exit 1
108
- fi
109
- shift
110
- export LD_LIBRARY_PATH=${ lib . concatStringsSep ":" ldPath } :$LD_LIBRARY_PATH
111
- exec "$run" "$@"
112
- '' ;
114
+ runScript = writeScript "steam-run" ''
115
+ #!${ stdenv . shell }
116
+ run="$1"
117
+ if [ "$run" = "" ]; then
118
+ echo "Usage: steam-run command-to-run args..." >&2
119
+ exit 1
120
+ fi
121
+ shift
122
+ export LD_LIBRARY_PATH=${ lib . concatStringsSep ":" ldPath } :$LD_LIBRARY_PATH
123
+ exec "$run" "$@"
124
+ '' ;
113
125
} ;
114
126
}
0 commit comments