1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 ncurses,
6 SDL,
7}:
8
9stdenv.mkDerivation (finalAttrs: {
10 pname = "curseofwar";
11 version = "1.3.0";
12
13 src = fetchFromGitHub {
14 owner = "a-nikolaev";
15 repo = "curseofwar";
16 rev = "v${finalAttrs.version}";
17 sha256 = "1wd71wdnj9izg5d95m81yx3684g4zdi7fsy0j5wwnbd9j34ilz1i";
18 };
19
20 buildInputs = [
21 ncurses
22 SDL
23 ];
24
25 makeFlags = (lib.optionals (SDL != null) [ "SDL=yes" ]) ++ [
26 "PREFIX=$(out)"
27 # force platform's cc on darwin, otherwise gcc is used
28 "CC=${stdenv.cc.targetPrefix}cc"
29 ];
30
31 meta = with lib; {
32 description = "Fast-paced action strategy game";
33 homepage = "https://a-nikolaev.github.io/curseofwar/";
34 license = licenses.gpl3;
35 mainProgram = if SDL != null then "curseofwar-sdl" else "curseofwar";
36 maintainers = with maintainers; [ fgaz ];
37 platforms = platforms.all;
38 };
39})