2012-12-10 23:31:57 +01:00
|
|
|
{ stdenv, fetchurl, dpkg, makeWrapper, xz, libX11, gcc, glibc215
|
2012-12-12 18:12:13 +01:00
|
|
|
, libselinux, libXrandr, pango, freetype, fontconfig, glib, gtk
|
|
|
|
, gdk_pixbuf, cairo, libXi, alsaLib, libXrender, nss, nspr, zlib
|
|
|
|
, dbus, libpng12, libXfixes, cups, libgcrypt, openal, pulseaudio
|
2013-02-15 19:42:13 +01:00
|
|
|
, libxcb, libXau, libXdmcp
|
2012-12-27 12:01:07 +01:00
|
|
|
, SDL # World of Goo
|
|
|
|
, libvorbis # Osmos
|
2012-12-27 12:57:48 +01:00
|
|
|
, curl, mesa # Superbrothers: S&S EP
|
2012-12-12 18:12:13 +01:00
|
|
|
, patchelf }:
|
2012-12-08 11:52:54 +01:00
|
|
|
|
|
|
|
assert stdenv.system == "i686-linux";
|
|
|
|
|
2013-02-15 19:27:37 +01:00
|
|
|
let version = "1.0.0.27"; in
|
2012-12-08 11:52:54 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "steam-${version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://media.steampowered.com/client/installer/steam.deb";
|
2013-02-15 19:27:37 +01:00
|
|
|
sha256 = "1hlmqxd0yv92aag3wbykwvri54lbmq9s6krrxfnrp1rbpli9r2jx";
|
2012-12-08 11:52:54 +01:00
|
|
|
};
|
|
|
|
|
2012-12-09 10:24:50 +01:00
|
|
|
buildInputs = [ dpkg makeWrapper ];
|
2012-12-08 11:52:54 +01:00
|
|
|
|
|
|
|
phases = "installPhase";
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
|
|
|
dpkg-deb -x $src $out
|
|
|
|
mv $out/usr/* $out/
|
|
|
|
rmdir $out/usr
|
|
|
|
substituteInPlace "$out/bin/steam" --replace "/bin/bash" "/bin/sh"
|
|
|
|
substituteInPlace "$out/bin/steam" --replace "/usr/" "$out/"
|
2013-02-15 19:27:37 +01:00
|
|
|
sed -i 's,STEAMPACKAGE=.*,STEAMPACKAGE=steam,' $out/bin/steam
|
|
|
|
sed -i '/STEAMSCRIPT/d' $out/bin/steam
|
2012-12-09 10:24:50 +01:00
|
|
|
|
2012-12-27 12:01:07 +01:00
|
|
|
mv $out/bin/steam $out/bin/.steam-wrapped
|
|
|
|
cat > $out/bin/steam << EOF
|
2012-12-09 10:24:50 +01:00
|
|
|
#!${stdenv.shell}
|
|
|
|
|
2013-02-15 19:42:13 +01:00
|
|
|
export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:${libX11}/lib:${gcc.gcc}/lib:${glibc215}/lib:${libselinux}/lib:${libXrandr}/lib:${pango}/lib:${freetype}/lib:${fontconfig}/lib:${glib}/lib:${gtk}/lib:${gdk_pixbuf}/lib:${cairo}/lib:${libXi}/lib:${alsaLib}/lib:${libXrender}/lib:${nss}/lib:${nspr}/lib:${zlib}/lib:${dbus}/lib:${libpng12}/lib:${libXfixes}/lib:${cups}/lib:${libgcrypt}/lib:${openal}/lib:${pulseaudio}/lib:${libxcb}/lib:${libXau}/lib:${libXdmcp}/lib:${SDL}/lib:${libvorbis}/lib:${curl}/lib
|
2012-12-27 12:01:07 +01:00
|
|
|
STEAMBOOTSTRAP=\$HOME/.steam/steam/steam.sh
|
|
|
|
if [ -f \$STEAMBOOTSTRAP ]; then
|
|
|
|
STEAMCONFIG=~/.steam
|
|
|
|
STEAMROOT="\$STEAMCONFIG/steam"
|
|
|
|
STEAMBINDIR="\$STEAMROOT/ubuntu12_32"
|
|
|
|
PIDFILE="\$STEAMCONFIG/steam.pid"
|
|
|
|
STEAMRUNCMD="\$STEAMCONFIG/runcmd"
|
|
|
|
STEAMBIN32LINK="\$STEAMCONFIG/bin32"
|
|
|
|
STEAMBIN64LINK="\$STEAMCONFIG/bin64"
|
|
|
|
STEAMROOTLINK="\$STEAMCONFIG/root"
|
|
|
|
STEAMSTARTING="\$STEAMCONFIG/starting"
|
2012-12-27 12:57:48 +01:00
|
|
|
export LD_LIBRARY_PATH="\$STEAMBINDIR:\$LD_LIBRARY_PATH:${mesa}/lib"
|
2012-12-27 12:01:07 +01:00
|
|
|
export SDL_VIDEO_X11_DGAMOUSE=0
|
|
|
|
cd "\$STEAMROOT"
|
2013-01-16 23:53:45 +01:00
|
|
|
LDSO="\$STEAMBINDIR/ld.so"
|
2012-12-27 12:53:02 +01:00
|
|
|
cp ${glibc215}/lib/ld-linux.so.2 "\$LDSO"
|
|
|
|
chmod u+w "\$LDSO"
|
2012-12-27 12:01:07 +01:00
|
|
|
echo \$\$ > "\$PIDFILE" # pid of the shell will become pid of steam
|
2012-12-27 12:53:02 +01:00
|
|
|
exec "\$LDSO" "\$STEAMBINDIR/steam"
|
2012-12-27 12:01:07 +01:00
|
|
|
else
|
2012-12-27 12:10:28 +01:00
|
|
|
export PATH=${xz}/bin:\$PATH
|
2012-12-27 12:01:07 +01:00
|
|
|
exec $out/bin/.steam-wrapped
|
|
|
|
fi
|
2012-12-09 10:24:50 +01:00
|
|
|
EOF
|
|
|
|
|
2012-12-27 12:01:07 +01:00
|
|
|
chmod +x $out/bin/steam
|
2012-12-08 11:52:54 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "A digital distribution platform";
|
|
|
|
homepage = http://store.steampowered.com/;
|
|
|
|
license = "unfree";
|
|
|
|
};
|
|
|
|
}
|