2013-09-13 21:58:59 +00:00
|
|
|
/*{ stdenv, fetchurl, dpkg, makeWrapper, xz, libX11, gcc, glibc
|
2012-12-12 17:12:13 +00: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-08-10 02:46:34 +00:00
|
|
|
, libxcb, libXau, libXdmcp, flashplayer, libSM, libICE, libXext
|
|
|
|
, dbus_glib, libusb1, networkmanager
|
2012-12-27 11:01:07 +00:00
|
|
|
, SDL # World of Goo
|
|
|
|
, libvorbis # Osmos
|
2012-12-27 11:57:48 +00:00
|
|
|
, curl, mesa # Superbrothers: S&S EP
|
2012-12-12 17:12:13 +00:00
|
|
|
, patchelf }:
|
2012-12-08 10:52:54 +00:00
|
|
|
|
2013-08-10 02:46:34 +00:00
|
|
|
assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux";
|
2012-12-08 10:52:54 +00:00
|
|
|
|
2013-08-10 02:46:34 +00:00
|
|
|
let version = "1.0.0.39"; in
|
2012-12-08 10:52:54 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "steam-${version}";
|
|
|
|
|
2013-08-10 02:46:34 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "http://repo.steampowered.com/steam/archive/precise/steam-launcher_${version}_all.deb";
|
|
|
|
sha256 = "1z1cnlr2qw2ndnqsfwjck9617m2p0f3p9q9409vczj909h2a9wyk";
|
|
|
|
};
|
2012-12-08 10:52:54 +00:00
|
|
|
|
2012-12-09 09:24:50 +00:00
|
|
|
buildInputs = [ dpkg makeWrapper ];
|
2012-12-08 10:52:54 +00:00
|
|
|
|
|
|
|
phases = "installPhase";
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
|
|
|
dpkg-deb -x $src $out
|
2013-08-10 02:46:34 +00:00
|
|
|
cp -r $out/usr/* $out/
|
|
|
|
rm -rf $out/usr
|
|
|
|
substituteInPlace "$out/bin/steam" --replace "/usr/bin/env bash" "/bin/sh"
|
2012-12-08 10:52:54 +00:00
|
|
|
substituteInPlace "$out/bin/steam" --replace "/usr/" "$out/"
|
2013-02-15 18:27:37 +00:00
|
|
|
sed -i 's,STEAMPACKAGE=.*,STEAMPACKAGE=steam,' $out/bin/steam
|
|
|
|
sed -i '/STEAMSCRIPT/d' $out/bin/steam
|
2012-12-09 09:24:50 +00:00
|
|
|
|
2012-12-27 11:01:07 +00:00
|
|
|
mv $out/bin/steam $out/bin/.steam-wrapped
|
|
|
|
cat > $out/bin/steam << EOF
|
2012-12-09 09:24:50 +00:00
|
|
|
|
2013-08-10 02:46:34 +00:00
|
|
|
export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:${libX11}/lib:${gcc.gcc}/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:${libSM}/lib:${libICE}/lib:${dbus_glib}/lib:${networkmanager}/lib:${libXext}/lib:${libusb1}/lib
|
2013-02-18 22:46:00 +00:00
|
|
|
STEAMBOOTSTRAP=~/.steam/steam/steam.sh
|
2012-12-27 11:01:07 +00:00
|
|
|
if [ -f \$STEAMBOOTSTRAP ]; then
|
2013-02-15 22:16:01 +00:00
|
|
|
PLATFORM32=ubuntu12_32
|
2012-12-27 11:01:07 +00:00
|
|
|
STEAMCONFIG=~/.steam
|
2013-02-15 22:16:01 +00:00
|
|
|
STEAMROOT=~/.local/share/Steam
|
|
|
|
STEAMDATA="\$STEAMROOT"
|
2012-12-27 11:01:07 +00:00
|
|
|
PIDFILE="\$STEAMCONFIG/steam.pid"
|
|
|
|
STEAMBIN32LINK="\$STEAMCONFIG/bin32"
|
|
|
|
STEAMBIN64LINK="\$STEAMCONFIG/bin64"
|
2013-02-15 22:16:01 +00:00
|
|
|
STEAMSDK32LINK="\$STEAMCONFIG/sdk32"
|
|
|
|
STEAMSDK64LINK="\$STEAMCONFIG/sdk64"
|
2012-12-27 11:01:07 +00:00
|
|
|
STEAMROOTLINK="\$STEAMCONFIG/root"
|
2013-02-15 22:16:01 +00:00
|
|
|
STEAMDATALINK="\$STEAMCONFIG/steam"
|
2012-12-27 11:01:07 +00:00
|
|
|
STEAMSTARTING="\$STEAMCONFIG/starting"
|
2013-02-15 22:16:01 +00:00
|
|
|
# Create symbolic links for the Steam API
|
|
|
|
if [ ! -e "\$STEAMCONFIG" ]; then
|
|
|
|
mkdir "\$STEAMCONFIG"
|
|
|
|
fi
|
2013-02-18 22:46:00 +00:00
|
|
|
if [ "\$STEAMROOT" != "\$STEAMROOTLINK" -a "\$STEAMROOT" != "\$STEAMDATALINK" ]; then
|
2013-02-15 22:16:01 +00:00
|
|
|
rm -f "\$STEAMBIN32LINK" && ln -s "\$STEAMROOT/\$PLATFORM32" "\$STEAMBIN32LINK"
|
|
|
|
rm -f "\$STEAMBIN64LINK" && ln -s "\$STEAMROOT/\$PLATFORM64" "\$STEAMBIN64LINK"
|
|
|
|
rm -f "\$STEAMSDK32LINK" && ln -s "\$STEAMROOT/linux32" "\$STEAMSDK32LINK"
|
|
|
|
rm -f "\$STEAMSDK64LINK" && ln -s "\$STEAMROOT/linux64" "\$STEAMSDK64LINK"
|
|
|
|
rm -f "\$STEAMROOTLINK" && ln -s "\$STEAMROOT" "\$STEAMROOTLINK"
|
|
|
|
if [ "\$STEAMDATALINK" ]; then
|
|
|
|
rm -f "\$STEAMDATALINK" && ln -s "\$STEAMDATA" "\$STEAMDATALINK"
|
|
|
|
fi
|
2013-02-18 22:46:00 +00:00
|
|
|
fi
|
|
|
|
# Temporary bandaid until everyone has the new libsteam_api.so
|
|
|
|
rm -f ~/.steampath && ln -s "\$STEAMCONFIG/bin32/steam" ~/.steampath
|
|
|
|
rm -f ~/.steampid && ln -s "\$PIDFILE" ~/.steampid
|
|
|
|
rm -f ~/.steam/bin && ln -s "\$STEAMBIN32LINK" ~/.steam/bin
|
2013-02-15 22:16:01 +00:00
|
|
|
export LD_LIBRARY_PATH="\$STEAMBIN32LINK:\$LD_LIBRARY_PATH:${mesa}/lib"
|
2012-12-27 11:01:07 +00:00
|
|
|
export SDL_VIDEO_X11_DGAMOUSE=0
|
|
|
|
cd "\$STEAMROOT"
|
2013-02-20 18:30:31 +00:00
|
|
|
FLASHLINK="\$STEAMCONFIG/bin32/plugins"
|
|
|
|
rm -f "\$FLASHLINK" && ln -s "${flashplayer}/lib/mozilla/plugins" "\$FLASHLINK"
|
2013-02-15 22:16:01 +00:00
|
|
|
LDSO="\$STEAMBIN32LINK/ld.so"
|
2013-08-10 02:46:34 +00:00
|
|
|
cp ${glibc}/lib/ld-linux.so.2 "\$LDSO"
|
2012-12-27 11:53:02 +00:00
|
|
|
chmod u+w "\$LDSO"
|
2012-12-27 11:01:07 +00:00
|
|
|
echo \$\$ > "\$PIDFILE" # pid of the shell will become pid of steam
|
2013-08-10 02:46:34 +00:00
|
|
|
export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:${glibc}/lib
|
2013-02-15 22:16:01 +00:00
|
|
|
exec "\$LDSO" "\$STEAMBIN32LINK/steam"
|
2012-12-27 11:01:07 +00:00
|
|
|
else
|
2012-12-27 11:10:28 +00:00
|
|
|
export PATH=${xz}/bin:\$PATH
|
2012-12-27 11:01:07 +00:00
|
|
|
exec $out/bin/.steam-wrapped
|
|
|
|
fi
|
2012-12-09 09:24:50 +00:00
|
|
|
EOF
|
|
|
|
|
2012-12-27 11:01:07 +00:00
|
|
|
chmod +x $out/bin/steam
|
2012-12-08 10:52:54 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "A digital distribution platform";
|
|
|
|
homepage = http://store.steampowered.com/;
|
|
|
|
license = "unfree";
|
|
|
|
};
|
|
|
|
}
|
2013-09-13 21:58:59 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
{stdenv, fetchurl, dpkg}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "steam-1.0.0.42";
|
|
|
|
src = fetchurl {
|
|
|
|
url = http://repo.steampowered.com/steam/archive/precise/steam-launcher_1.0.0.42_all.deb;
|
|
|
|
sha256 = "1jyvk0h1z78sdpvl4hs1kdvr6z2kwamf09vjgjx1f6j04kgqrfbw";
|
|
|
|
};
|
|
|
|
buildInputs = [ dpkg ];
|
|
|
|
unpackPhase = "true";
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
|
|
|
dpkg -x $src $out
|
|
|
|
cp -av $out/usr/* $out
|
|
|
|
rm -Rf $out/usr
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "A digital distribution platform";
|
|
|
|
homepage = http://store.steampowered.com/;
|
|
|
|
license = "unfree";
|
|
|
|
};
|
|
|
|
}
|