summary refs log tree commit diff
path: root/pkgs/games/opentyrian/default.nix
blob: 260b146217cca98bfa4c1f3bea49d3a3b2010fb1 (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
26
27
28
29
30
31
32
33
34
35
36
37
{stdenv, fetchhg, fetchurl, unzip, SDL, SDL_net}:

stdenv.mkDerivation rec {
  name = "opentyrian-${version}";
  version = "0.0.955";

  src = fetchhg {
    url = "https://opentyrian.googlecode.com/hg/";
    tag = "13ef8ce47362";
    md5 = "95c8f9e7ff3d4207f1c692c7cec6c9b0";
  };

  data = fetchurl {
    url = http://sites.google.com/a/camanis.net/opentyrian/tyrian/tyrian21.zip;
    md5 = "2a3b206a6de25ed4b771af073f8ca904";
  };

  buildInputs = [SDL SDL_net unzip];

  patchPhase = "
    substituteInPlace src/file.c --replace /usr/share $out/share
  ";
  buildPhase = "make release";
  installPhase = "
    ensureDir $out/bin
    cp ./opentyrian $out/bin
    ensureDir $out/share/opentyrian/data
    unzip -j $data -d $out/share/opentyrian/data
  ";

  meta = {
    description = ''OpenTyrian is an open source port of the game "Tyrian".'';
    homepage = https://opentyrian.googlecode.com/;
    # This does not account of Tyrian data.
    # license = stdenv.lib.licenses.gpl2;
  };
}