steam: add wrapper testing for libGL

NixOS: Failing to set hardware.opengl.driSupport32Bit will lead to a
confusing error message about missing libGL.so.1. We include a wrapper
around the steam bin to test for working 32bit opengl with glxinfo. When
failing, we display a proper warning hinting towards the option.

Fixes: #19518

wchresta 2fd1b95f 5fdf1b97

+12 -1
+12 -1
pkgs/games/steam/chrootenv.nix
··· 69 69 xlibs.libX11 70 70 xlibs.libXfixes 71 71 72 + # Needed to properly check for libGL.so.1 in steam-wrapper.sh 73 + pkgsi686Linux.glxinfo 74 + 72 75 # Not formally in runtime but needed by some games 73 76 gst_all_1.gstreamer 74 77 gst_all_1.gst-plugins-ugly ··· 103 106 export TZDIR=/etc/zoneinfo 104 107 ''; 105 108 106 - runScript = "steam"; 109 + runScript = writeScript "steam-wrapper.sh" '' 110 + #!${stdenv.shell} 111 + glxinfo >/dev/null 2>&1 112 + if [ ! "$?" = "0" ]; then 113 + echo "*** WARNING: Test for 32-bit libGL unsuccessful." 114 + echo " This could mean you forgot to activate hardware.opengl.driSupport32Bit" 115 + fi 116 + steam 117 + ''; 107 118 108 119 passthru.run = buildFHSUserEnv { 109 120 name = "steam-run";