@@ -1,6 +1,33 @@
1−{ lib, stdenv, mkDerivation, fetchurl, autoconf, automake
2−, perl, unzip, zip, which, pkg-config, qtbase, qtscript
3−, SDL2, libtheora, openal, glew, physfs, fribidi, libXrandr
1+{ lib
2+, mkDerivation
3+, fetchurl
4+, cmake
5+, ninja
6+, zip, unzip
7+, pkg-config
8+, asciidoctor
9+, gettext
10+
11+, qtbase
12+, qtscript
13+, SDL2
14+, libtheora
15+, libvorbis
16+, openal
17+, openalSoft
18+, glew
19+, physfs
20+, fribidi
21+, libXrandr
22+, miniupnpc
23+, libsodium
24+, curl
25+, libpng
26+, freetype
27+, harfbuzz
28+, sqlite
29+, which
30+
431, withVideos ? false
532}:
633
@@ -14,38 +41,61 @@ in
1441
1542mkDerivation rec {
1643 inherit pname;
17− version = "3.3.0";
44+ version = "3.4.1";
1845
1946 src = fetchurl {
20− url = "mirror://sourceforge/${pname}/releases/${version}/${pname}-${version}_src.tar.xz";
21− sha256 = "1s0n67rh32g0bgq72p4qzkcqjlw58gc70r4r6gl9k90pil9chj6c";
47+ url = "mirror://sourceforge/${pname}/releases/${version}/${pname}_src.tar.xz";
48+ sha256 = "0savalmw1kp1sf8vg5aqrl5hc77p4jacxy5y9qj8k2hi2vqdfb7a";
2249 };
2350
2451 buildInputs = [
25− qtbase qtscript SDL2 libtheora openal
26− glew physfs fribidi libXrandr
52+ qtbase
53+ qtscript
54+ SDL2
55+ libtheora
56+ libvorbis
57+ openal
58+ openalSoft
59+ glew
60+ physfs
61+ fribidi
62+ libXrandr
63+ miniupnpc
64+ libsodium
65+ curl
66+ libpng
67+ freetype
68+ harfbuzz
69+ sqlite
2770 ];
71+
2872 nativeBuildInputs = [
29− perl zip unzip pkg-config autoconf automake
73+ cmake
74+ ninja
75+ zip unzip
76+ asciidoctor
77+ gettext
3078 ];
3179
32− preConfigure = "./autogen.sh";
33−
3480 postPatch = ''
3581 substituteInPlace lib/exceptionhandler/dumpinfo.cpp \
36− --replace "which %s" "${which}/bin/which %s"
82+ --replace '"which "' '"${which}/bin/which "'
3783 substituteInPlace lib/exceptionhandler/exceptionhandler.cpp \
3884 --replace "which %s" "${which}/bin/which %s"
3985 '';
4086
41− configureFlags = [ "--with-distributor=NixOS" ];
42−
43− hardeningDisable = [ "format" ];
44−
45− enableParallelBuilding = true;
87+ cmakeFlags = [
88+ "-DWZ_DISTRIBUTOR=NixOS"
89+ # The cmake builder automatically sets CMAKE_INSTALL_BINDIR to an absolute
90+ # path, but this results in an error.
91+ # By resetting it, we let the CMakeLists set it to an accepted value
92+ # based on prefix.
93+ "-DCMAKE_INSTALL_BINDIR="
94+ ];
4695
47− postInstall = lib.optionalString withVideos
48− "cp ${sequences_src} $out/share/warzone2100/sequences.wz";
96+ postInstall = lib.optionalString withVideos ''
97+ cp ${sequences_src} $out/share/warzone2100/sequences.wz
98+ '';
4999
50100 meta = with lib; {
51101 description = "A free RTS game, originally developed by Pumpkin Studios";