about summary refs log tree commit diff
path: root/pkgs/games/airstrike/default.nix
blob: 63b2686e97c9570d255e38abaf06cd2a01a1d2d1 (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
{ lib, stdenv, fetchurl, makeWrapper, SDL, SDL_image }:

stdenv.mkDerivation rec {
  pname = "airstrike-pre";
  version = "6a";

  src = fetchurl {
    url = "https://icculus.org/airstrike/airstrike-pre${version}-src.tar.gz";
    sha256 = "1h6rv2zcp84ycmd0kv1pbpqjgwx57dw42x7878d2c2vnpi5jn8qi";
  };

  nativeBuildInputs = [ makeWrapper ];
  buildInputs = [ SDL SDL_image ];

  NIX_LDFLAGS = "-lm";

  installPhase = ''
    ls -l
    mkdir -p $out/bin
    cp airstrike $out/bin

    mkdir -p $out/share
    cp -r data airstrikerc $out/share

    wrapProgram $out/bin/airstrike \
      --chdir "$out/share"
  '';

  meta = with lib; {
    description = "A 2d dogfighting game";
    mainProgram = "airstrike";
    homepage = "https://icculus.org/airstrike/";
    license = licenses.gpl2;
    maintainers = with maintainers; [ pSub ];
    platforms = platforms.linux;
  };
}