about summary refs log tree commit diff
path: root/pkgs/games/humblebundle
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2017-07-28 20:51:35 +0200
committeraszlig <aszlig@redmoonstudios.org>2017-07-28 20:51:46 +0200
commitcc4fd8b8639a808d3bff47d7b01240bedd9bd7df (patch)
tree47d393c1237dbe07a2e490384fe2503a730f5f37 /pkgs/games/humblebundle
parentfb43ad0db601e579be47ec32f8ed5590ed285498 (diff)
parent78eb9771b7ddb8ad531340c6704bb7fd8f2b302f (diff)
Merge pull request #14 (add Antichamber)
Pull request is from @layus and I haven't tested the game, because I
don't own it myself, but apparently @Profpatsch seems to got it working
to the point of having a black screen, but that could be a rendering
issue.

So I'm merging this anyway, because even if only one person (@layus) is
going to play it, it won't hurt and if multiple people using the
expressions we probably get bug reports :-)
Diffstat (limited to 'pkgs/games/humblebundle')
-rw-r--r--pkgs/games/humblebundle/antichamber.nix56
-rw-r--r--pkgs/games/humblebundle/default.nix1
2 files changed, 57 insertions, 0 deletions
diff --git a/pkgs/games/humblebundle/antichamber.nix b/pkgs/games/humblebundle/antichamber.nix
new file mode 100644
index 00000000..c671c4ef
--- /dev/null
+++ b/pkgs/games/humblebundle/antichamber.nix
@@ -0,0 +1,56 @@
+{ stdenv, lib, fetchHumbleBundle, unzip
+, xorg, libpulseaudio, libvorbis, libogg, mesa }:
+
+stdenv.mkDerivation rec {
+  name = "antichamber-1.1";
+
+  src = fetchHumbleBundle {
+    name = "antichamber_1.01_linux_1392664980.sh";
+    machineName = "antichamber_linux";
+    md5 = "37bca01c411d813c8729259b7db2dba0";
+  };
+
+  dontStrip = true;
+  phases = ["installPhase"];
+
+  installPhase = let
+    rpath = lib.makeLibraryPath [
+      "$dest/Binaries/Linux"
+      xorg.libX11
+      xorg.libXi
+      stdenv.cc.cc.lib
+      libpulseaudio
+      libvorbis
+      libogg
+      mesa
+    ];
+   in ''
+    dest="$out/share/antichamber"
+
+    # Unpack binaries and data into $dest
+    mkdir -p "$dest"
+    ${unzip}/bin/unzip $src "data/*" -d $dest && [ $? -le 2 ]
+    mv $dest/data/*/* $dest
+    rm -r $dest/data
+
+    # Patch heavily :-)
+    patchelf \
+      --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
+      --set-rpath "${rpath}" "$dest/Binaries/Linux/UDKGame-Linux"
+    for exe in $dest/Binaries/Linux/lib/*.so{,.*} ; do
+      patchelf --set-rpath "${rpath}" "$exe"
+    done
+
+    # Fixup permissions, just to be sure.
+    find "$dest" -type f -exec chmod 644 "{}" +
+    find "$dest/Binaries" -type f -exec chmod 755 "{}" +
+
+    mkdir -p "$out/bin"
+    cat > $out/bin/antichamber <<EOF
+    #!${stdenv.shell}
+    cd $dest/Binaries/Linux/
+    exec ./UDKGame-Linux "$@"
+    EOF
+    chmod 755 $out/bin/antichamber
+  '';
+}
diff --git a/pkgs/games/humblebundle/default.nix b/pkgs/games/humblebundle/default.nix
index c7d760ac..c3ed1494 100644
--- a/pkgs/games/humblebundle/default.nix
+++ b/pkgs/games/humblebundle/default.nix
@@ -11,6 +11,7 @@ let
       inherit (config.humblebundle) email password;
     };
 
+    antichamber = callPackage_i686 ./antichamber.nix { };
     bastion = callPackage ./bastion.nix {};
     brigador = callPackage ./brigador.nix {};
     cavestoryplus = callPackage ./cavestoryplus.nix {};