summary refs log tree commit diff
path: root/pkgs/games/btanks/default.nix
blob: ad2cef1ac39af974690478d7775819f649ccf0db (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
{ stdenv, fetchurl, fetchpatch, sconsPackages, pkgconfig, SDL, libGLU_combined, zlib, smpeg
, SDL_image, libvorbis, expat, zip, lua5_1 }:

stdenv.mkDerivation rec {
  pname = "btanks";
  version = "0.9.8083";

  src = fetchurl {
    url = "mirror://sourceforge/${pname}/${pname}-${version}.tar.bz2";
    sha256 = "0ha35kxc8xlbg74wsrbapfgxvcrwy6psjkqi7c6adxs55dmcxliz";
  };

  nativeBuildInputs = [ sconsPackages.scons_3_0_1 pkgconfig ];
  buildInputs = [ SDL libGLU_combined zlib smpeg SDL_image libvorbis expat zip lua5_1 ];

  NIX_CFLAGS_COMPILE = "-I${SDL_image}/include/SDL";

  prePatch = ''
    substituteInPlace ./engine/SConscript --replace "lua5.1" "lua" \
          --replace "lua5.0" "lua"
  '';

  patches = [
    (fetchpatch {
      url = "https://salsa.debian.org/games-team/btanks/raw/master/debian/patches/gcc-4.7.patch";
      sha256 = "1dxlk1xh69gj10sqcsyckiakb8an3h41206wby4z44mpmvxc7pi4";
    })
    (fetchpatch {
      url = "https://salsa.debian.org/games-team/btanks/raw/master/debian/patches/pow10f.patch";
      sha256 = "1h45790v2dpdbccfn6lwfgl8782q54i14cz9gpipkaghcka4y0g9";
    })
  ];

  meta = with stdenv.lib; {
    homepage = "https://sourceforge.net/projects/btanks/";
    description = "Fast 2d tank arcade game";
    license = licenses.gpl2Plus;
    platforms = platforms.linux;
  };
}