1{
2 lib,
3 stdenv,
4 fetchurl,
5 xorgproto,
6 libX11,
7 libXrender,
8 gmp,
9 libjpeg,
10 libpng,
11 expat,
12 gettext,
13 perl,
14 guile,
15 SDL,
16 SDL_image,
17 SDL_mixer,
18 SDL_ttf,
19 curl,
20 sqlite,
21 libtool,
22 readline,
23 libogg,
24 libvorbis,
25 libcaca,
26 csound,
27 cunit,
28 pkg-config,
29}:
30
31stdenv.mkDerivation rec {
32 pname = "liquidwar6";
33 version = "0.6.3902";
34
35 src = fetchurl {
36 url = "mirror://gnu/liquidwar6/${pname}-${version}.tar.gz";
37 sha256 = "1976nnl83d8wspjhb5d5ivdvdxgb8lp34wp54jal60z4zad581fn";
38 };
39
40 buildInputs = [
41 xorgproto
42 libX11
43 gmp
44 guile
45 libjpeg
46 libpng
47 expat
48 gettext
49 perl
50 SDL
51 SDL_image
52 SDL_mixer
53 SDL_ttf
54 curl
55 sqlite
56 libogg
57 libvorbis
58 csound
59 libXrender
60 libcaca
61 cunit
62 libtool
63 readline
64 ];
65
66 nativeBuildInputs = [ pkg-config ];
67
68 hardeningDisable = [ "format" ];
69
70 env.NIX_CFLAGS_COMPILE = toString (
71 lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [
72 # Needed with GCC 12 but problematic with some old GCCs
73 "-Wno-error=address"
74 "-Wno-error=use-after-free"
75 ]
76 ++ [
77 "-Wno-error=deprecated-declarations"
78 # Avoid GL_GLEXT_VERSION double definition
79 " -DNO_SDL_GLEXT"
80 ]
81 );
82
83 # To avoid problems finding SDL_types.h.
84 configureFlags = [ "CFLAGS=-I${lib.getDev SDL}/include/SDL" ];
85
86 meta = with lib; {
87 description = "Quick tactics game";
88 homepage = "https://www.gnu.org/software/liquidwar6/";
89 maintainers = [ maintainers.raskin ];
90 license = licenses.gpl3Plus;
91 platforms = platforms.linux;
92 };
93}