steam: improvements for native runtime

* Update dependencies using steam-native-runtime from Arch Linux as a
reference.
* Remove native-only Steam Runtime, just use installed libraries
instead.
* Mark native-only Steam as broken (due to segfault inside D-Bus). Seems it was
already broken for a long time. Doesn't apply to steam-run.
* Some cleanups for chrootenv.

+106 -100
+99 -13
pkgs/games/steam/chrootenv.nix
··· 1 - { stdenv, lib, writeScript, buildFHSUserEnv, steam 1 + { stdenv, lib, writeScript, buildFHSUserEnv, steam, glxinfo-i686 2 2 , steam-runtime-wrapped, steam-runtime-wrapped-i686 ? null 3 3 , withJava ? false 4 4 , withPrimus ? false ··· 58 58 xorg.libX11 59 59 xorg.libXfixes 60 60 61 - # Needed to properly check for libGL.so.1 in steam-wrapper.sh 62 - pkgsi686Linux.glxinfo 63 - 64 61 # Not formally in runtime but needed by some games 65 62 gst_all_1.gstreamer 66 63 gst_all_1.gst-plugins-ugly ··· 68 65 mono 69 66 xorg.xkeyboardconfig 70 67 xorg.libpciaccess 71 - 68 + ] ++ (if (!nativeOnly) then [ 72 69 (steamPackages.steam-runtime-wrapped.override { 73 - inherit nativeOnly runtimeOnly; 70 + inherit runtimeOnly; 74 71 }) 75 - ]; 72 + ] else [ 73 + # Required 74 + glib 75 + gtk2 76 + bzip2 77 + zlib 78 + gdk_pixbuf 76 79 77 - extraBuildCommands = '' 80 + # Without these it silently fails 81 + xorg.libXinerama 82 + xorg.libXdamage 83 + xorg.libXcursor 84 + xorg.libXrender 85 + xorg.libXScrnSaver 86 + xorg.libXxf86vm 87 + xorg.libXi 88 + xorg.libSM 89 + xorg.libICE 90 + gnome2.GConf 91 + freetype 92 + (curl.override { gnutlsSupport = true; sslSupport = false; }) 93 + nspr 94 + nss 95 + fontconfig 96 + cairo 97 + pango 98 + expat 99 + dbus 100 + cups 101 + libcap 102 + SDL2 103 + libusb1 104 + dbus-glib 105 + libav 106 + atk 107 + # Only libraries are needed from those two 108 + libudev0-shim 109 + networkmanager098 110 + 111 + # Verified games requirements 112 + xorg.libXmu 113 + xorg.libxcb 114 + libGLU 115 + libuuid 116 + libogg 117 + libvorbis 118 + SDL 119 + SDL2_image 120 + glew110 121 + openssl 122 + libidn 123 + tbb 124 + 125 + # Other things from runtime 126 + flac 127 + freeglut 128 + libjpeg 129 + libpng12 130 + libsamplerate 131 + libmikmod 132 + libtheora 133 + libtiff 134 + pixman 135 + speex 136 + SDL_image 137 + SDL_ttf 138 + SDL_mixer 139 + SDL2_ttf 140 + SDL2_mixer 141 + gstreamer 142 + gst-plugins-base 143 + libGLU 144 + libappindicator-gtk2 145 + libcaca 146 + libcanberra 147 + libgcrypt 148 + libvpx 149 + librsvg 150 + xorg.libXft 151 + libvdpau 152 + ] ++ steamPackages.steam-runtime-wrapped.overridePkgs); 153 + 154 + extraBuildCommands = if (!nativeOnly) then '' 78 155 mkdir -p steamrt 79 156 ln -s ../lib/steam-runtime steamrt/${steam-runtime-wrapped.arch} 80 157 ${lib.optionalString (steam-runtime-wrapped-i686 != null) '' 81 158 ln -s ../lib32/steam-runtime steamrt/${steam-runtime-wrapped-i686.arch} 82 159 ''} 83 160 ln -s ${runSh} steamrt/run.sh 161 + '' else '' 162 + ln -s /usr/lib/libbz2.so usr/lib/libbz2.so.1.0 163 + ${lib.optionalString (steam-runtime-wrapped-i686 != null) '' 164 + ln -s /usr/lib32/libbz2.so usr/lib32/libbz2.so.1.0 165 + ''} 84 166 ''; 85 167 86 168 extraInstallCommands = '' ··· 91 173 ''; 92 174 93 175 profile = '' 94 - export STEAM_RUNTIME=/steamrt 176 + export STEAM_RUNTIME=${if nativeOnly then "0" else "/steamrt"} 95 177 ''; 96 178 97 179 runScript = writeScript "steam-wrapper.sh" '' 98 180 #!${stdenv.shell} 99 181 if [ -f /host/etc/NIXOS ]; then # Check only useful on NixOS 100 - glxinfo >/dev/null 2>&1 182 + ${glxinfo-i686}/bin/glxinfo >/dev/null 2>&1 101 183 # If there was an error running glxinfo, we know something is wrong with the configuration 102 184 if [ $? -ne 0 ]; then 103 185 cat <<EOF > /dev/stderr ··· 112 194 EOF 113 195 fi 114 196 fi 115 - steam 197 + exec steam "$@" 116 198 ''; 117 199 200 + meta = steam.meta // { 201 + broken = nativeOnly; 202 + }; 203 + 118 204 passthru.run = buildFHSUserEnv { 119 205 name = "steam-run"; 120 206 ··· 129 215 exit 1 130 216 fi 131 217 shift 132 - export LD_LIBRARY_PATH=${lib.concatStringsSep ":" ldPath}:$LD_LIBRARY_PATH 133 - exec "$run" "$@" 218 + ${lib.optionalString (!nativeOnly) "export LD_LIBRARY_PATH=${lib.concatStringsSep ":" ldPath}:$LD_LIBRARY_PATH"} 219 + exec -- "$run" "$@" 134 220 ''; 135 221 }; 136 222 }
+1
pkgs/games/steam/default.nix
··· 13 13 steam = callPackage ./steam.nix { }; 14 14 steam-fonts = callPackage ./fonts.nix { }; 15 15 steam-chrootenv = callPackage ./chrootenv.nix { 16 + glxinfo-i686 = pkgs.pkgsi686Linux.glxinfo; 16 17 steam-runtime-wrapped-i686 = 17 18 if steamArch == "amd64" 18 19 then pkgs.pkgsi686Linux.steamPackages.steam-runtime-wrapped
+6 -87
pkgs/games/steam/runtime-wrapped.nix
··· 1 1 { stdenv, steamArch, lib, perl, pkgs, steam-runtime 2 - , nativeOnly ? false 3 2 , runtimeOnly ? false 4 3 }: 5 - 6 - assert !(nativeOnly && runtimeOnly); 7 4 8 5 let 9 - runtimePkgs = with pkgs; [ 10 - # Required 11 - glib 12 - gtk2 13 - bzip2 14 - zlib 15 - gdk_pixbuf 16 - 17 - # Without these it silently fails 18 - xorg.libXinerama 19 - xorg.libXdamage 20 - xorg.libXcursor 21 - xorg.libXrender 22 - xorg.libXScrnSaver 23 - xorg.libXxf86vm 24 - xorg.libXi 25 - xorg.libSM 26 - xorg.libICE 27 - gnome2.GConf 28 - freetype 29 - (curl.override { gnutlsSupport = true; sslSupport = false; }) 30 - nspr 31 - nss 32 - fontconfig 33 - cairo 34 - pango 35 - expat 36 - dbus 37 - cups 38 - libcap 39 - SDL2 40 - libusb1 41 - dbus-glib 42 - libav 43 - atk 44 - # Only libraries are needed from those two 45 - libudev0-shim 46 - networkmanager098 47 - 48 - # Verified games requirements 49 - xorg.libXmu 50 - xorg.libxcb 51 - libGLU 52 - libuuid 53 - libogg 54 - libvorbis 55 - SDL 56 - SDL2_image 57 - glew110 58 - openssl 59 - libidn 60 - tbb 61 - 62 - # Other things from runtime 63 - xorg.libXinerama 64 - flac 65 - freeglut 66 - libjpeg 67 - libpng12 68 - libsamplerate 69 - libmikmod 70 - libtheora 71 - pixman 72 - speex 73 - SDL_image 74 - SDL_ttf 75 - SDL_mixer 76 - SDL2_net 77 - SDL2_ttf 78 - SDL2_mixer 79 - gstreamer 80 - gst-plugins-base 81 - ]; 82 - 83 - overridePkgs = with pkgs; [ 6 + overridePkgs = lib.optionals (!runtimeOnly) (with pkgs; [ 84 7 libgpgerror 85 8 libpulseaudio 86 9 alsaLib 87 10 openalSoft 88 - libva 11 + libva1-full 12 + libvdpau 89 13 vulkan-loader 90 14 gcc.cc 91 15 nss 92 16 nspr 93 - ]; 17 + ]); 94 18 95 - ourRuntime = if runtimeOnly then [] 96 - else if nativeOnly then runtimePkgs ++ overridePkgs 97 - else overridePkgs; 98 - steamRuntime = lib.optional (!nativeOnly) steam-runtime; 99 - 100 - allPkgs = ourRuntime ++ steamRuntime; 19 + allPkgs = overridePkgs ++ [ steam-runtime ]; 101 20 102 21 gnuArch = if steamArch == "amd64" then "x86_64-linux-gnu" 103 22 else if steamArch == "i386" then "i386-linux-gnu" ··· 114 33 builder = ./build-wrapped.sh; 115 34 116 35 passthru = { 117 - inherit gnuArch libs bins; 36 + inherit gnuArch libs bins overridePkgs; 118 37 arch = steamArch; 119 38 }; 120 39