2015-08-06 19:21:43 +01:00
|
|
|
{ lib, buildFHSUserEnv, steam-runtime
|
2015-07-28 11:42:11 +01:00
|
|
|
, withRuntime ? false
|
2015-08-06 19:21:43 +01:00
|
|
|
, withJava ? false
|
|
|
|
, withPrimus ? false
|
2015-07-28 11:42:11 +01:00
|
|
|
}:
|
2013-09-13 22:58:59 +01:00
|
|
|
|
2015-02-05 15:16:02 +00:00
|
|
|
buildFHSUserEnv {
|
2013-09-13 22:58:59 +01:00
|
|
|
name = "steam";
|
2014-04-23 00:03:14 +01:00
|
|
|
|
2015-08-06 19:21:43 +01:00
|
|
|
targetPkgs = pkgs: with pkgs; [
|
|
|
|
steam-original
|
2015-06-12 00:01:23 +01:00
|
|
|
# Errors in output without those
|
2015-08-06 19:21:43 +01:00
|
|
|
pciutils
|
|
|
|
python2
|
2015-06-12 00:01:23 +01:00
|
|
|
# Games' dependencies
|
2015-08-06 19:21:43 +01:00
|
|
|
xlibs.xrandr
|
|
|
|
which
|
|
|
|
# needed by gdialog, including in the steam-runtime
|
|
|
|
perl
|
2014-06-15 14:34:27 +01:00
|
|
|
]
|
2015-08-06 19:21:43 +01:00
|
|
|
++ lib.optional withJava jdk
|
|
|
|
++ lib.optional withPrimus primus
|
2014-06-15 14:34:27 +01:00
|
|
|
;
|
2014-04-23 00:03:14 +01:00
|
|
|
|
2015-08-06 19:21:43 +01:00
|
|
|
multiPkgs = pkgs: with pkgs; [
|
2015-07-28 11:42:11 +01:00
|
|
|
# These are required by steam with proper errors
|
2015-08-06 19:21:43 +01:00
|
|
|
xlibs.libXcomposite
|
|
|
|
xlibs.libXtst
|
|
|
|
xlibs.libXrandr
|
|
|
|
xlibs.libXext
|
|
|
|
xlibs.libX11
|
|
|
|
xlibs.libXfixes
|
|
|
|
|
|
|
|
glib
|
|
|
|
gtk2
|
|
|
|
bzip2
|
|
|
|
zlib
|
|
|
|
libpulseaudio
|
|
|
|
gdk_pixbuf
|
2014-04-23 00:03:14 +01:00
|
|
|
|
2015-07-28 11:42:11 +01:00
|
|
|
# Not formally in runtime but needed by some games
|
2015-08-06 19:21:43 +01:00
|
|
|
gst_all_1.gstreamer
|
|
|
|
gst_all_1.gst-plugins-ugly
|
2015-07-28 11:42:11 +01:00
|
|
|
] ++ lib.optionals withRuntime [
|
2015-06-12 00:01:23 +01:00
|
|
|
# Without these it silently fails
|
2015-08-06 19:21:43 +01:00
|
|
|
xlibs.libXinerama
|
|
|
|
xlibs.libXdamage
|
|
|
|
xlibs.libXcursor
|
|
|
|
xlibs.libXrender
|
|
|
|
xlibs.libXScrnSaver
|
|
|
|
xlibs.libXi
|
|
|
|
xlibs.libSM
|
|
|
|
xlibs.libICE
|
|
|
|
gnome2.GConf
|
|
|
|
freetype
|
|
|
|
openalSoft
|
|
|
|
curl
|
|
|
|
nspr
|
|
|
|
nss
|
|
|
|
fontconfig
|
|
|
|
cairo
|
|
|
|
pango
|
|
|
|
alsaLib
|
|
|
|
expat
|
|
|
|
dbus
|
|
|
|
cups
|
|
|
|
libcap
|
|
|
|
SDL2
|
|
|
|
libusb1
|
|
|
|
dbus_glib
|
|
|
|
libav
|
|
|
|
atk
|
2015-06-12 00:01:23 +01:00
|
|
|
# Only libraries are needed from those two
|
2015-08-06 19:21:43 +01:00
|
|
|
udev182
|
|
|
|
networkmanager098
|
2014-04-23 00:03:14 +01:00
|
|
|
|
2015-06-12 00:01:23 +01:00
|
|
|
# Verified games requirements
|
2015-08-06 19:21:43 +01:00
|
|
|
xlibs.libXmu
|
|
|
|
xlibs.libxcb
|
|
|
|
xlibs.libpciaccess
|
|
|
|
mesa_glu
|
|
|
|
libuuid
|
|
|
|
libogg
|
|
|
|
libvorbis
|
|
|
|
SDL
|
|
|
|
SDL2_image
|
|
|
|
glew110
|
|
|
|
openssl
|
|
|
|
libidn
|
2014-04-23 00:03:14 +01:00
|
|
|
|
2015-06-12 00:01:23 +01:00
|
|
|
# Other things from runtime
|
2015-08-06 19:21:43 +01:00
|
|
|
xlibs.libXinerama
|
|
|
|
flac
|
|
|
|
freeglut
|
|
|
|
libjpeg
|
|
|
|
libpng12
|
|
|
|
libsamplerate
|
|
|
|
libmikmod
|
|
|
|
libtheora
|
|
|
|
pixman
|
|
|
|
speex
|
|
|
|
SDL_image
|
|
|
|
SDL_ttf
|
|
|
|
SDL_mixer
|
|
|
|
SDL2_net
|
|
|
|
SDL2_ttf
|
|
|
|
SDL2_mixer
|
|
|
|
gstreamer
|
|
|
|
gst_plugins_base
|
2014-07-10 09:25:19 +01:00
|
|
|
];
|
2014-04-23 00:03:14 +01:00
|
|
|
|
2015-07-28 11:55:47 +01:00
|
|
|
extraBuildCommands = ''
|
|
|
|
[ -d lib64 ] && mv lib64/steam lib
|
2015-06-12 00:01:23 +01:00
|
|
|
|
|
|
|
# FIXME: maybe we should replace this with proper libcurl-gnutls
|
2015-08-06 19:21:43 +01:00
|
|
|
ln -s libcurl.so.4 lib/libcurl-gnutls.so.4
|
|
|
|
[ -d lib64 ] && ln -s libcurl.so.4 lib64/libcurl-gnutls.so.4
|
|
|
|
'' + lib.optionals withRuntime ''
|
|
|
|
mkdir -p steamrt/usr
|
|
|
|
ln -s lib32 steamrt/lib
|
|
|
|
|
|
|
|
if [ -d lib64 ]; then
|
|
|
|
ln -s ${steam-runtime}/i386/usr/bin steamrt/bin
|
|
|
|
else
|
|
|
|
ln -s ${steam-runtime}/amd64/usr/bin steamrt/bin
|
|
|
|
fi
|
|
|
|
|
|
|
|
ln -s ${steam-runtime}/i386/etc steamrt/etc
|
|
|
|
ln -s ${steam-runtime}/i386/usr/include steamrt/usr/include
|
|
|
|
|
|
|
|
cp -rsf --no-preserve mode ${steam-runtime}/i386/usr/lib steamrt/lib32
|
|
|
|
cp -rsf ${steam-runtime}/i386/lib/* steamrt/lib32
|
|
|
|
|
|
|
|
cp -rsf --no-preserve mode ${steam-runtime}/amd64/usr/lib steamrt/lib64
|
|
|
|
cp -rsf ${steam-runtime}/amd64/lib/* steamrt/lib64
|
|
|
|
|
|
|
|
libs=$(ls -dm --quoting-style=escape steamrt/lib{32,64}/{,*/})
|
|
|
|
|
|
|
|
echo 'export STEAM_RUNTIME=0' > steamrt/profile
|
|
|
|
echo 'export PATH=$PATH:/steamrt/bin' >> steamrt/profile
|
|
|
|
echo -n 'export LD_LIBRARY_PATH=/' >> steamrt/profile
|
|
|
|
echo -n $libs | sed 's/\/, /:\//g' | sed 's/\/$//g' >> steamrt/profile
|
|
|
|
echo ':$LD_LIBRARY_PATH' >> steamrt/profile
|
2014-04-23 00:03:14 +01:00
|
|
|
'';
|
|
|
|
|
2015-07-28 11:42:11 +01:00
|
|
|
profile = if withRuntime then ''
|
2015-08-06 19:21:43 +01:00
|
|
|
source /steamrt/profile
|
2015-07-28 11:42:11 +01:00
|
|
|
'' 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
|
2013-09-13 22:58:59 +01:00
|
|
|
'';
|
2015-02-05 15:16:02 +00:00
|
|
|
|
2015-04-22 14:52:57 +01:00
|
|
|
runScript = "steam";
|
2013-09-13 22:58:59 +01:00
|
|
|
}
|