summary refs log tree commit diff
path: root/pkgs/games/steam/default.nix
diff options
context:
space:
mode:
authorCarles Pagès <page@cubata.homelinux.net>2012-12-09 10:24:50 +0100
committerEvgeny Egorochkin <phreedom@yandex.ru>2013-08-10 06:08:15 +0300
commit12a0d83855bdc7129163d6926da245141c4d9866 (patch)
tree377a9efe988c0ebe5d26b856076b4f737ac13e92 /pkgs/games/steam/default.nix
parent3cd37b550b80adee64e68065c835743651407ecb (diff)
downloadnixlib-12a0d83855bdc7129163d6926da245141c4d9866.tar
nixlib-12a0d83855bdc7129163d6926da245141c4d9866.tar.gz
nixlib-12a0d83855bdc7129163d6926da245141c4d9866.tar.bz2
nixlib-12a0d83855bdc7129163d6926da245141c4d9866.tar.lz
nixlib-12a0d83855bdc7129163d6926da245141c4d9866.tar.xz
nixlib-12a0d83855bdc7129163d6926da245141c4d9866.tar.zst
nixlib-12a0d83855bdc7129163d6926da245141c4d9866.zip
Steam: add patch for user stuff and lib paths to wrapProgram.
The binaries that get copied to $HOME need patchelf to run, and after that I
need all the runtime libs in the library path. Still not working as I need
glibc2.15.
Diffstat (limited to 'pkgs/games/steam/default.nix')
-rw-r--r--pkgs/games/steam/default.nix23
1 files changed, 19 insertions, 4 deletions
diff --git a/pkgs/games/steam/default.nix b/pkgs/games/steam/default.nix
index 3dbeed83885b..08bd9a14896d 100644
--- a/pkgs/games/steam/default.nix
+++ b/pkgs/games/steam/default.nix
@@ -1,4 +1,5 @@
-{ stdenv, fetchurl, dpkg, makeWrapper, xz }:
+{ stdenv, fetchurl, dpkg, makeWrapper, xz, libX11, gcc
+,patchelf }:
 
 assert stdenv.system == "i686-linux";
 
@@ -12,7 +13,7 @@ stdenv.mkDerivation rec {
     sha256 = "0mx92f9hjjpg3blgmgp8sz0f3jg7m9hssdscipwybks258k8926m";
   };
 
-  buildInputs = [ dpkg makeWrapper xz ];
+  buildInputs = [ dpkg makeWrapper ];
 
   phases = "installPhase";
 
@@ -25,8 +26,22 @@ stdenv.mkDerivation rec {
     substituteInPlace "$out/bin/steam" --replace "/usr/" "$out/"
     substituteInPlace "$out/bin/steam" --replace "\`basename \$0\`" "steam"
     sed -i '/jockey-common/d' $out/bin/steam
-    wrapProgram "$out/bin/steam" --prefix PATH ":" \
-      "${xz}/bin"
+    wrapProgram "$out/bin/steam" \
+      --prefix PATH ":" "${xz}/bin" \
+      --prefix LD_LIBRARY_PATH : ${libX11}/lib:${gcc.gcc}/lib
+
+    mkdir -p $out/patches
+    cat > $out/patches/post-install.sh << EOF
+    #!${stdenv.shell}
+
+    # post-install script to patch stuff at \$HOME
+    PATH=\$PATH:${patchelf}/bin
+    sed -i 's/bash/sh/' \$HOME/.local/share/Steam/steam.sh
+    patchelf --set-interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
+        \$HOME/.local/share/Steam/ubuntu12_32/steam
+    EOF
+
+    chmod +x $out/patches/post-install.sh
   '';
 
   meta = {