From 8b218b7143f139e01f6b3b60b84649c60ca69650 Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Tue, 28 Jul 2015 13:42:11 +0300 Subject: steam: cut dependencies when using Runtime, migrate from config to boolean arguments --- pkgs/games/steam/chrootenv.nix | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) (limited to 'pkgs/games/steam') diff --git a/pkgs/games/steam/chrootenv.nix b/pkgs/games/steam/chrootenv.nix index 583e731113da..a7cdfa9e7c1d 100644 --- a/pkgs/games/steam/chrootenv.nix +++ b/pkgs/games/steam/chrootenv.nix @@ -1,4 +1,8 @@ -{ lib, buildFHSUserEnv, config }: +{ lib, buildFHSUserEnv +, withRuntime ? false +, withJava ? false +, withPrimus ? false +}: buildFHSUserEnv { name = "steam"; @@ -12,12 +16,12 @@ buildFHSUserEnv { pkgs.xlibs.xrandr pkgs.which ] - ++ lib.optional (config.steam.java or false) pkgs.jdk - ++ lib.optional (config.steam.primus or false) pkgs.primus + ++ lib.optional withJava pkgs.jdk + ++ lib.optional withPrimus pkgs.primus ; - multiPkgs = pkgs: - [ # These are required by steam with proper errors + multiPkgs = pkgs: [ + # These are required by steam with proper errors pkgs.xlibs.libXcomposite pkgs.xlibs.libXtst pkgs.xlibs.libXrandr @@ -32,6 +36,10 @@ buildFHSUserEnv { pkgs.libpulseaudio pkgs.gdk_pixbuf + # Not formally in runtime but needed by some games + pkgs.gst_all_1.gstreamer + pkgs.gst_all_1.gst-plugins-ugly + ] ++ lib.optionals withRuntime [ # Without these it silently fails pkgs.xlibs.libXinerama pkgs.xlibs.libXdamage @@ -97,10 +105,6 @@ buildFHSUserEnv { pkgs.SDL2_mixer pkgs.gstreamer pkgs.gst_plugins_base - - # Not formally in runtime but needed by some games - pkgs.gst_all_1.gstreamer - pkgs.gst_all_1.gst-plugins-ugly ]; extraBuildCommandsMulti = '' @@ -111,8 +115,13 @@ buildFHSUserEnv { ln -s libcurl.so.4 libcurl-gnutls.so.4 ''; - profile = '' - ${if config.steam.enableRuntime or false then "" else "export STEAM_RUNTIME=0"} + profile = if withRuntime then '' + export STEAM_RUNTIME=0 + '' else '' + # Ugly workaround for https://github.com/ValveSoftware/steam-for-linux/issues/3504 + export LD_PRELOAD=/lib32/libpulse.so:/lib64/libpulse.so:/lib32/libasound.so:/lib64/libasound.so:$LD_PRELOAD + # Another one for https://github.com/ValveSoftware/steam-for-linux/issues/3801 + export LD_PRELOAD=/lib32/libstdc++.so:/lib64/libstdc++.so:$LD_PRELOAD ''; runScript = "steam"; -- cgit 1.4.1