summary refs log tree commit diff
path: root/pkgs/games
diff options
context:
space:
mode:
authorwchresta <34962284+wchresta@users.noreply.github.com>2017-12-30 21:06:09 +0100
committerwchresta <34962284+wchresta@users.noreply.github.com>2017-12-30 21:23:51 +0100
commit2fd1b95fad27331307bfd14bda731e5997d60908 (patch)
tree3c8a8bbef215036fa8e8c390f0b3d156a236e7ad /pkgs/games
parent5fdf1b972a945705a271948f2ca09e56412f941f (diff)
downloadnixlib-2fd1b95fad27331307bfd14bda731e5997d60908.tar
nixlib-2fd1b95fad27331307bfd14bda731e5997d60908.tar.gz
nixlib-2fd1b95fad27331307bfd14bda731e5997d60908.tar.bz2
nixlib-2fd1b95fad27331307bfd14bda731e5997d60908.tar.lz
nixlib-2fd1b95fad27331307bfd14bda731e5997d60908.tar.xz
nixlib-2fd1b95fad27331307bfd14bda731e5997d60908.tar.zst
nixlib-2fd1b95fad27331307bfd14bda731e5997d60908.zip
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
Diffstat (limited to 'pkgs/games')
-rw-r--r--pkgs/games/steam/chrootenv.nix13
1 files changed, 12 insertions, 1 deletions
diff --git a/pkgs/games/steam/chrootenv.nix b/pkgs/games/steam/chrootenv.nix
index a7392bbc34e9..019b1577e15f 100644
--- a/pkgs/games/steam/chrootenv.nix
+++ b/pkgs/games/steam/chrootenv.nix
@@ -69,6 +69,9 @@ in buildFHSUserEnv rec {
     xlibs.libX11
     xlibs.libXfixes
 
+    # Needed to properly check for libGL.so.1 in steam-wrapper.sh
+    pkgsi686Linux.glxinfo
+
     # Not formally in runtime but needed by some games
     gst_all_1.gstreamer
     gst_all_1.gst-plugins-ugly
@@ -103,7 +106,15 @@ in buildFHSUserEnv rec {
     export TZDIR=/etc/zoneinfo
   '';
 
-  runScript = "steam";
+  runScript = writeScript "steam-wrapper.sh" ''
+    #!${stdenv.shell}
+    glxinfo >/dev/null 2>&1
+    if [ ! "$?" = "0" ]; then
+      echo "*** WARNING: Test for 32-bit libGL unsuccessful."
+      echo "             This could mean you forgot to activate hardware.opengl.driSupport32Bit"
+    fi
+    steam
+  '';
 
   passthru.run = buildFHSUserEnv {
     name = "steam-run";