2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
2021-04-08 16:26:57 +00:00
|
|
|
, stdenv
|
2021-02-05 17:12:51 +00:00
|
|
|
, fetchurl
|
|
|
|
, cmake
|
|
|
|
, ninja
|
2021-06-04 09:07:49 +00:00
|
|
|
, p7zip
|
2021-02-05 17:12:51 +00:00
|
|
|
, pkg-config
|
|
|
|
, asciidoctor
|
|
|
|
, gettext
|
|
|
|
|
|
|
|
, SDL2
|
|
|
|
, libtheora
|
|
|
|
, libvorbis
|
|
|
|
, openal
|
|
|
|
, openalSoft
|
|
|
|
, physfs
|
|
|
|
, miniupnpc
|
|
|
|
, libsodium
|
|
|
|
, curl
|
|
|
|
, libpng
|
|
|
|
, freetype
|
|
|
|
, harfbuzz
|
|
|
|
, sqlite
|
|
|
|
, which
|
2021-04-08 16:26:57 +00:00
|
|
|
, vulkan-headers
|
|
|
|
, vulkan-loader
|
|
|
|
, shaderc
|
2021-02-05 17:12:51 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
, withVideos ? false
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
pname = "warzone2100";
|
|
|
|
sequences_src = fetchurl {
|
|
|
|
url = "mirror://sourceforge/${pname}/warzone2100/Videos/high-quality-en/sequences.wz";
|
|
|
|
sha256 = "90ff552ca4a70e2537e027e22c5098ea4ed1bc11bb7fc94138c6c941a73d29fa";
|
|
|
|
};
|
|
|
|
in
|
|
|
|
|
2021-04-08 16:26:57 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
inherit pname;
|
2021-04-22 02:08:21 +00:00
|
|
|
version = "4.0.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-02-05 17:12:51 +00:00
|
|
|
url = "mirror://sourceforge/${pname}/releases/${version}/${pname}_src.tar.xz";
|
2021-04-22 02:08:21 +00:00
|
|
|
sha256 = "1f8a4kflslsjl8jrryhwg034h1yc9y3y1zmllgww3fqkz3aj4xik";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [
|
2021-02-05 17:12:51 +00:00
|
|
|
SDL2
|
|
|
|
libtheora
|
|
|
|
libvorbis
|
|
|
|
openal
|
|
|
|
openalSoft
|
|
|
|
physfs
|
|
|
|
miniupnpc
|
|
|
|
libsodium
|
|
|
|
curl
|
|
|
|
libpng
|
|
|
|
freetype
|
|
|
|
harfbuzz
|
|
|
|
sqlite
|
2021-04-08 16:26:57 +00:00
|
|
|
vulkan-headers
|
|
|
|
vulkan-loader
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
2021-02-05 17:12:51 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
nativeBuildInputs = [
|
2021-04-08 16:26:57 +00:00
|
|
|
pkg-config
|
2021-02-05 17:12:51 +00:00
|
|
|
cmake
|
|
|
|
ninja
|
2021-06-04 09:07:49 +00:00
|
|
|
p7zip
|
2021-02-05 17:12:51 +00:00
|
|
|
asciidoctor
|
|
|
|
gettext
|
2021-04-08 16:26:57 +00:00
|
|
|
shaderc
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace lib/exceptionhandler/dumpinfo.cpp \
|
2021-02-05 17:12:51 +00:00
|
|
|
--replace '"which "' '"${which}/bin/which "'
|
2020-04-24 23:36:52 +00:00
|
|
|
substituteInPlace lib/exceptionhandler/exceptionhandler.cpp \
|
|
|
|
--replace "which %s" "${which}/bin/which %s"
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DWZ_DISTRIBUTOR=NixOS"
|
|
|
|
# The cmake builder automatically sets CMAKE_INSTALL_BINDIR to an absolute
|
|
|
|
# path, but this results in an error.
|
|
|
|
# By resetting it, we let the CMakeLists set it to an accepted value
|
|
|
|
# based on prefix.
|
|
|
|
"-DCMAKE_INSTALL_BINDIR="
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
postInstall = lib.optionalString withVideos ''
|
|
|
|
cp ${sequences_src} $out/share/warzone2100/sequences.wz
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A free RTS game, originally developed by Pumpkin Studios";
|
|
|
|
longDescription = ''
|
|
|
|
Warzone 2100 is an open source real-time strategy and real-time tactics
|
|
|
|
hybrid computer game, originally developed by Pumpkin Studios and
|
|
|
|
published by Eidos Interactive.
|
|
|
|
In Warzone 2100, you command the forces of The Project in a battle to
|
|
|
|
rebuild the world after mankind has almost been destroyed by nuclear
|
|
|
|
missiles. The game offers campaign, multi-player, and single-player
|
|
|
|
skirmish modes. An extensive tech tree with over 400 different
|
|
|
|
technologies, combined with the unit design system, allows for a wide
|
|
|
|
variety of possible units and tactics.
|
|
|
|
'';
|
|
|
|
homepage = "http://wz2100.net";
|
|
|
|
license = licenses.gpl2Plus;
|
2021-02-05 17:12:51 +00:00
|
|
|
maintainers = with maintainers; [ astsmtl fgaz ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|