37 pname = "warzone2100";
38 sequences_src = fetchurl {
39 url = "mirror://sourceforge/${pname}/warzone2100/Videos/high-quality-en/sequences.wz";
40 sha256 = "90ff552ca4a70e2537e027e22c5098ea4ed1bc11bb7fc94138c6c941a73d29fa";
44 stdenv.mkDerivation rec {
49 url = "mirror://sourceforge/${pname}/releases/${version}/${pname}_src.tar.xz";
50 sha256 = "sha256-GdHe8DskEd0G1E388z8GGOtjTqHTMBpFSxf1MNATGN0=";
68 ] ++ lib.optionals (!stdenv.isDarwin) [
84 substituteInPlace lib/exceptionhandler/dumpinfo.cpp \
85 --replace '"which "' '"${which}/bin/which "'
86 substituteInPlace lib/exceptionhandler/exceptionhandler.cpp \
87 --replace "which %s" "${which}/bin/which %s"
91 "-DWZ_DISTRIBUTOR=NixOS"
92 # The cmake builder automatically sets CMAKE_INSTALL_BINDIR to an absolute
93 # path, but this results in an error:
95 # > An absolute CMAKE_INSTALL_BINDIR path cannot be used if the following
96 # > are not also absolute paths: WZ_DATADIR
98 # WZ_DATADIR is based on CMAKE_INSTALL_DATAROOTDIR, so we set that.
100 # Alternatively, we could have set CMAKE_INSTALL_BINDIR to "bin".
101 "-DCMAKE_INSTALL_DATAROOTDIR=${placeholder "out"}/share"
102 ] ++ lib.optional stdenv.isDarwin "-P../configure_mac.cmake";
104 postInstall = lib.optionalString withVideos ''
105 cp ${sequences_src} $out/share/warzone2100/sequences.wz
109 version = testers.testVersion {
110 package = warzone2100;
111 # The command always exits with code 1
112 command = "(warzone2100 --version || [ $? -eq 1 ])";
117 description = "A free RTS game, originally developed by Pumpkin Studios";
119 Warzone 2100 is an open source real-time strategy and real-time tactics
120 hybrid computer game, originally developed by Pumpkin Studios and
121 published by Eidos Interactive.
122 In Warzone 2100, you command the forces of The Project in a battle to
123 rebuild the world after mankind has almost been destroyed by nuclear
124 missiles. The game offers campaign, multi-player, and single-player
125 skirmish modes. An extensive tech tree with over 400 different
126 technologies, combined with the unit design system, allows for a wide
127 variety of possible units and tactics.
129 homepage = "https://wz2100.net";
130 license = licenses.gpl2Plus;
131 maintainers = with maintainers; [ astsmtl fgaz ];
132 platforms = platforms.all;
133 # configure_mac.cmake tries to download stuff
134 # https://github.com/Warzone2100/warzone2100/blob/master/macosx/README.md
135 broken = stdenv.isDarwin;