Skip to content

Commit

Permalink
antichamber: init at 1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
layus committed Jul 24, 2017
1 parent b44d56e commit 78eb977
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
56 changes: 56 additions & 0 deletions pkgs/games/humblebundle/antichamber.nix
Original file line number Diff line number Diff line change
@@ -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
'';
}
1 change: 1 addition & 0 deletions pkgs/games/humblebundle/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 {};
Expand Down

0 comments on commit 78eb977

Please sign in to comment.