40 pname = "warzone2100";
41 sequences_src = fetchurl {
42 url = "mirror://sourceforge/${pname}/warzone2100/Videos/high-quality-en/sequences.wz";
43 sha256 = "90ff552ca4a70e2537e027e22c5098ea4ed1bc11bb7fc94138c6c941a73d29fa";
47 stdenv.mkDerivation rec {
52 url = "mirror://sourceforge/${pname}/releases/${version}/${pname}_src.tar.xz";
53 hash = "sha256-Ul77OihJWIH9H6FUpibGDjqX1BY4DWDQ3bR4lRDY9+U=";
71 ] ++ lib.optionals (!stdenv.isDarwin) [
87 substituteInPlace lib/exceptionhandler/dumpinfo.cpp \
88 --replace '"which "' '"${which}/bin/which "'
89 substituteInPlace lib/exceptionhandler/exceptionhandler.cpp \
90 --replace "which %s" "${which}/bin/which %s"
91 # https://github.com/Warzone2100/warzone2100/pull/3353
92 substituteInPlace lib/ivis_opengl/gfx_api_vk.cpp \
93 --replace vk::throwResultException vk::detail::throwResultException
97 "-DWZ_DISTRIBUTOR=NixOS"
98 # The cmake builder automatically sets CMAKE_INSTALL_BINDIR to an absolute
99 # path, but this results in an error:
101 # > An absolute CMAKE_INSTALL_BINDIR path cannot be used if the following
102 # > are not also absolute paths: WZ_DATADIR
104 # WZ_DATADIR is based on CMAKE_INSTALL_DATAROOTDIR, so we set that.
106 # Alternatively, we could have set CMAKE_INSTALL_BINDIR to "bin".
107 "-DCMAKE_INSTALL_DATAROOTDIR=${placeholder "out"}/share"
108 ] ++ lib.optional stdenv.isDarwin "-P../configure_mac.cmake";
110 postInstall = lib.optionalString withVideos ''
111 cp ${sequences_src} $out/share/warzone2100/sequences.wz
115 version = testers.testVersion {
116 package = warzone2100;
117 # The command always exits with code 1
118 command = "(warzone2100 --version || [ $? -eq 1 ])";
120 nixosTest = nixosTests.warzone2100;
123 passthru.updateScript = gitUpdater {
124 url = "https://github.com/Warzone2100/warzone2100";
128 description = "A free RTS game, originally developed by Pumpkin Studios";
130 Warzone 2100 is an open source real-time strategy and real-time tactics
131 hybrid computer game, originally developed by Pumpkin Studios and
132 published by Eidos Interactive.
133 In Warzone 2100, you command the forces of The Project in a battle to
134 rebuild the world after mankind has almost been destroyed by nuclear
135 missiles. The game offers campaign, multi-player, and single-player
136 skirmish modes. An extensive tech tree with over 400 different
137 technologies, combined with the unit design system, allows for a wide
138 variety of possible units and tactics.
140 homepage = "https://wz2100.net";
141 license = licenses.gpl2Plus;
142 maintainers = with maintainers; [ astsmtl fgaz ];
143 platforms = platforms.all;
144 # configure_mac.cmake tries to download stuff
145 # https://github.com/Warzone2100/warzone2100/blob/master/macosx/README.md
146 broken = stdenv.isDarwin;