about summary refs log tree commit diff
path: root/pkgs/games/tworld2/default.nix
blob: 1db1dcf5f06524351e0d2bee4f773fe09a0d52a0 (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
38
39
40
41
42
43
44
45
{ stdenv
, lib
, fetchurl
, qt4
, SDL
}:

stdenv.mkDerivation rec {
  pname = "tworld2";
  version = "2.2.0";

  src = fetchurl {
    url = "https://tw2.bitbusters.club/downloads/tworld-${version}-src.tar.gz";
    sha256 = "sha256:1y55v2shk2xxcds7bdwdjaq9lka31sgdp2469zqnvldchwbvcb2i";
  };

  buildInputs = [ qt4 SDL ];
  enableParallelBuilding = true;

  postConfigure = ''
    echo "#define COMPILE_TIME \"$(date -ud "@$SOURCE_DATE_EPOCH" '+%Y %b %e %T %Z')\"" >comptime.h
  '';

  makeFlags = [
    "bindir=${placeholder "out"}/bin"
    "sharedir=${placeholder "out"}/share"
    "mandir=${placeholder "out"}/share/man/en"
  ];

  postInstall = ''
    mkdir -p $out/share/doc/${pname}
    cp COPYING README docs/tworld2.html $out/share/doc/${pname}

    mkdir $out/share/icons
    cp tworld.ico tworld2.ico $out/share/icons
  '';

  meta = with lib; {
    description = "Tile World 2: Tile World is a reimplementation of the game Chip's Challenge";
    homepage = "https://tw2.bitbusters.club/";
    license = licenses.gpl2Plus;
    platforms = platforms.linux;
    maintainers = with maintainers; [ drperceptron ];
  };
}