about summary refs log tree commit diff
path: root/humblebundle/bastion.nix
blob: 652b80118b323406f0276858e2f25bad1dcdac40 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{ stdenv, fetchHumbleBundle, lzma, mono }:

let
  arch = if stdenv.system == "i686-linux" then "x86"
         else if stdenv.system == "x86_64-linux" then "x86_64"
         else throw "Unsupported architecture ${stdenv.system}!";
in stdenv.mkDerivation rec {
  name = "bastion-1.4";

  src = fetchHumbleBundle {
    name = "Bastion-HIB-2012-06-20.sh";
    md5 = "aa6ccaead3b4b8a5fbd156f4019e8c8b";
  };

  unpackCmd = ''
    mkdir "${name}"

    sh "$src" --tar xf ./instarchive_all -O | ${lzma}/bin/lzcat \
      | tar x -C "${name}" Bastion.exe
  '';

  installPhase = ''
    install -vD "Bastion.bin.${arch}" "$out/bin/bastion"
  '';
}