2021-01-25 12:07:03 +00:00
|
|
|
{ lib
|
2021-04-05 14:08:32 +00:00
|
|
|
, stdenv
|
2021-01-25 12:07:03 +00:00
|
|
|
, fetchurl
|
|
|
|
, cmake
|
|
|
|
, ninja
|
2021-06-01 15:54:10 +00:00
|
|
|
, p7zip
|
2021-01-25 12:07:03 +00:00
|
|
|
, pkg-config
|
|
|
|
, asciidoctor
|
|
|
|
, gettext
|
|
|
|
|
|
|
|
, SDL2
|
|
|
|
, libtheora
|
|
|
|
, libvorbis
|
2022-11-04 08:47:03 +00:00
|
|
|
, libopus
|
2021-01-25 12:07:03 +00:00
|
|
|
, openal
|
|
|
|
, openalSoft
|
|
|
|
, physfs
|
|
|
|
, miniupnpc
|
|
|
|
, libsodium
|
|
|
|
, curl
|
|
|
|
, libpng
|
|
|
|
, freetype
|
|
|
|
, harfbuzz
|
|
|
|
, sqlite
|
|
|
|
, which
|
2021-04-05 14:08:32 +00:00
|
|
|
, vulkan-headers
|
|
|
|
, vulkan-loader
|
|
|
|
, shaderc
|
2021-01-25 12:07:03 +00:00
|
|
|
|
2022-04-20 14:40:48 +00:00
|
|
|
, testers
|
2021-12-24 14:54:42 +00:00
|
|
|
, warzone2100
|
2022-11-24 19:46:05 +00:00
|
|
|
, nixosTests
|
2021-12-24 14:54:42 +00:00
|
|
|
|
2014-06-15 09:40:24 +00:00
|
|
|
, withVideos ? false
|
2010-05-03 16:07:01 +00:00
|
|
|
}:
|
2016-04-11 02:47:15 +00:00
|
|
|
|
|
|
|
let
|
2010-05-03 16:07:01 +00:00
|
|
|
pname = "warzone2100";
|
2014-06-15 09:40:24 +00:00
|
|
|
sequences_src = fetchurl {
|
|
|
|
url = "mirror://sourceforge/${pname}/warzone2100/Videos/high-quality-en/sequences.wz";
|
|
|
|
sha256 = "90ff552ca4a70e2537e027e22c5098ea4ed1bc11bb7fc94138c6c941a73d29fa";
|
|
|
|
};
|
2016-04-11 02:47:15 +00:00
|
|
|
in
|
|
|
|
|
2021-04-05 14:08:32 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-09-02 11:42:47 +00:00
|
|
|
inherit pname;
|
2023-01-02 15:01:51 +00:00
|
|
|
version = "4.3.3";
|
2017-01-07 15:47:55 +00:00
|
|
|
|
2016-04-11 02:47:15 +00:00
|
|
|
src = fetchurl {
|
2021-01-25 12:07:03 +00:00
|
|
|
url = "mirror://sourceforge/${pname}/releases/${version}/${pname}_src.tar.xz";
|
2023-01-02 15:01:51 +00:00
|
|
|
sha256 = "sha256-PDy5mIYAoQ9VAJCTRMiBqUlRtKIqVHiMuBiozTtH5Z4=";
|
2016-04-11 02:47:15 +00:00
|
|
|
};
|
2017-01-07 15:47:55 +00:00
|
|
|
|
2019-08-12 00:38:33 +00:00
|
|
|
buildInputs = [
|
2021-01-25 12:07:03 +00:00
|
|
|
SDL2
|
|
|
|
libtheora
|
|
|
|
libvorbis
|
2022-11-04 08:47:03 +00:00
|
|
|
libopus
|
2021-01-25 12:07:03 +00:00
|
|
|
openal
|
|
|
|
openalSoft
|
|
|
|
physfs
|
|
|
|
miniupnpc
|
|
|
|
libsodium
|
|
|
|
curl
|
|
|
|
libpng
|
|
|
|
freetype
|
|
|
|
harfbuzz
|
|
|
|
sqlite
|
2021-11-30 19:27:15 +00:00
|
|
|
] ++ lib.optionals (!stdenv.isDarwin) [
|
2021-04-05 14:08:32 +00:00
|
|
|
vulkan-headers
|
|
|
|
vulkan-loader
|
2019-08-12 00:38:33 +00:00
|
|
|
];
|
2021-01-25 12:07:03 +00:00
|
|
|
|
2019-08-12 00:38:33 +00:00
|
|
|
nativeBuildInputs = [
|
2021-04-05 14:08:32 +00:00
|
|
|
pkg-config
|
2021-01-25 12:07:03 +00:00
|
|
|
cmake
|
|
|
|
ninja
|
2021-06-01 15:54:10 +00:00
|
|
|
p7zip
|
2021-01-25 12:07:03 +00:00
|
|
|
asciidoctor
|
|
|
|
gettext
|
2021-04-05 14:08:32 +00:00
|
|
|
shaderc
|
2019-08-12 00:38:33 +00:00
|
|
|
];
|
|
|
|
|
2017-01-07 15:47:55 +00:00
|
|
|
postPatch = ''
|
2010-05-03 16:07:01 +00:00
|
|
|
substituteInPlace lib/exceptionhandler/dumpinfo.cpp \
|
2021-01-25 12:07:03 +00:00
|
|
|
--replace '"which "' '"${which}/bin/which "'
|
2014-06-15 09:40:24 +00:00
|
|
|
substituteInPlace lib/exceptionhandler/exceptionhandler.cpp \
|
2010-05-03 16:07:01 +00:00
|
|
|
--replace "which %s" "${which}/bin/which %s"
|
|
|
|
'';
|
2014-09-04 19:02:14 +00:00
|
|
|
|
2021-01-25 12:07:03 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DWZ_DISTRIBUTOR=NixOS"
|
|
|
|
# The cmake builder automatically sets CMAKE_INSTALL_BINDIR to an absolute
|
2021-07-03 14:56:42 +00:00
|
|
|
# path, but this results in an error:
|
|
|
|
#
|
|
|
|
# > An absolute CMAKE_INSTALL_BINDIR path cannot be used if the following
|
|
|
|
# > are not also absolute paths: WZ_DATADIR
|
|
|
|
#
|
|
|
|
# WZ_DATADIR is based on CMAKE_INSTALL_DATAROOTDIR, so we set that.
|
|
|
|
#
|
|
|
|
# Alternatively, we could have set CMAKE_INSTALL_BINDIR to "bin".
|
|
|
|
"-DCMAKE_INSTALL_DATAROOTDIR=${placeholder "out"}/share"
|
2021-11-30 19:27:15 +00:00
|
|
|
] ++ lib.optional stdenv.isDarwin "-P../configure_mac.cmake";
|
2014-09-04 19:02:14 +00:00
|
|
|
|
2021-01-25 12:07:03 +00:00
|
|
|
postInstall = lib.optionalString withVideos ''
|
|
|
|
cp ${sequences_src} $out/share/warzone2100/sequences.wz
|
|
|
|
'';
|
2014-09-04 19:04:11 +00:00
|
|
|
|
2021-12-24 14:54:42 +00:00
|
|
|
passthru.tests = {
|
2022-04-20 14:40:48 +00:00
|
|
|
version = testers.testVersion {
|
2021-12-24 14:54:42 +00:00
|
|
|
package = warzone2100;
|
|
|
|
# The command always exits with code 1
|
|
|
|
command = "(warzone2100 --version || [ $? -eq 1 ])";
|
|
|
|
};
|
2022-11-24 19:46:05 +00:00
|
|
|
nixosTest = nixosTests.warzone2100;
|
2021-12-24 14:54:42 +00:00
|
|
|
};
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2010-05-03 16:07:01 +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
|
2016-04-11 02:47:15 +00:00
|
|
|
variety of possible units and tactics.
|
2010-05-03 16:07:01 +00:00
|
|
|
'';
|
2022-01-03 15:53:12 +00:00
|
|
|
homepage = "https://wz2100.net";
|
2014-09-04 19:04:11 +00:00
|
|
|
license = licenses.gpl2Plus;
|
2021-01-25 12:06:19 +00:00
|
|
|
maintainers = with maintainers; [ astsmtl fgaz ];
|
2021-11-30 19:27:15 +00:00
|
|
|
platforms = platforms.all;
|
|
|
|
# configure_mac.cmake tries to download stuff
|
|
|
|
# https://github.com/Warzone2100/warzone2100/blob/master/macosx/README.md
|
|
|
|
broken = stdenv.isDarwin;
|
2010-05-03 16:07:01 +00:00
|
|
|
};
|
|
|
|
}
|