summary refs log tree commit diff
path: root/pkgs/games/astromenace/default.nix
blob: 556b276e210ed9e01647c81a6f30d58ff198df78 (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
{ fetchurl, lib, stdenv, cmake, xlibsWrapper, libGLU, libGL, SDL, openal, freealut, libogg, libvorbis, runtimeShell }:

stdenv.mkDerivation rec {
  pname = "astromenace";
  version = "1.4.1";

  src = fetchurl {
    url = "mirror://sourceforge/openastromenace/astromenace-src-${version}.tar.bz2";
    sha256 = "1rkz6lwjcd5mwv72kf07ghvx6z46kf3xs250mjbmnmjpn7r5sxwv";
  };

  nativeBuildInputs = [ cmake ];
  buildInputs = [ xlibsWrapper libGLU libGL SDL openal freealut libogg libvorbis ];

  postBuild = ''
    ./AstroMenace --pack --rawdata=../RAW_VFS_DATA
  '';

  installPhase = ''
    mkdir -p $out/bin

    cp AstroMenace $out
    cp gamedata.vfs $out

    cat > $out/bin/AstroMenace << EOF
    #!${runtimeShell}
    $out/AstroMenace --dir=$out
    EOF

    chmod 755 $out/bin/AstroMenace
  '';

  meta = with lib; {
    description = "Hardcore 3D space shooter with spaceship upgrade possibilities";
    homepage = "https://www.viewizard.com/";
    license = licenses.gpl3Plus;
    platforms = platforms.linux;
    mainProgram = "AstroMenace";
  };
}