2021-01-17 06:49:22 +01:00
|
|
|
{ lib, stdenv, fetchFromGitHub, autoreconfHook, lua5_3, pkg-config, python3
|
2021-03-14 19:12:53 +01:00
|
|
|
, zlib, bzip2, curl, xz, gettext, libiconv
|
2015-08-02 21:37:03 +02:00
|
|
|
, sdlClient ? true, SDL, SDL_mixer, SDL_image, SDL_ttf, SDL_gfx, freetype, fluidsynth
|
2021-09-06 22:18:32 +02:00
|
|
|
, gtkClient ? false, gtk3, wrapGAppsHook
|
2019-06-25 06:55:12 +02:00
|
|
|
, qtClient ? false, qt5
|
2016-12-28 22:12:57 +01:00
|
|
|
, server ? true, readline
|
|
|
|
, enableSqlite ? true, sqlite
|
|
|
|
}:
|
2011-08-20 16:30:16 +02:00
|
|
|
|
2021-08-05 16:57:52 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2019-06-25 06:55:12 +02:00
|
|
|
pname = "freeciv";
|
2021-12-21 09:37:31 +01:00
|
|
|
version = "2.6.6";
|
2019-06-25 06:55:12 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "freeciv";
|
|
|
|
repo = "freeciv";
|
2021-08-05 16:57:52 +02:00
|
|
|
rev = "R${lib.replaceStrings [ "." ] [ "_" ] version}";
|
2021-12-21 09:37:31 +01:00
|
|
|
sha256 = "sha256-D5t6sMpm09jbixs5MCghBeDbeuRbGmrrfWR91VNolRM=";
|
2011-08-20 16:30:16 +02:00
|
|
|
};
|
|
|
|
|
2019-06-25 06:55:12 +02:00
|
|
|
postPatch = ''
|
|
|
|
for f in {common,utility}/*.py; do
|
|
|
|
substituteInPlace $f \
|
2020-04-03 22:26:05 +02:00
|
|
|
--replace '/usr/bin/env python3' ${python3.interpreter}
|
2019-06-25 06:55:12 +02:00
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2020-11-17 06:31:10 +01:00
|
|
|
nativeBuildInputs = [ autoreconfHook pkg-config ]
|
2021-09-06 22:18:32 +02:00
|
|
|
++ lib.optional qtClient [ qt5.wrapQtAppsHook ]
|
|
|
|
++ lib.optional gtkClient [ wrapGAppsHook ];
|
2012-02-13 20:34:39 +01:00
|
|
|
|
2021-03-14 19:12:53 +01:00
|
|
|
buildInputs = [ lua5_3 zlib bzip2 curl xz gettext libiconv ]
|
2021-08-05 16:57:52 +02:00
|
|
|
++ lib.optionals sdlClient [ SDL SDL_mixer SDL_image SDL_ttf SDL_gfx freetype fluidsynth ]
|
|
|
|
++ lib.optionals gtkClient [ gtk3 ]
|
|
|
|
++ lib.optionals qtClient [ qt5.qtbase ]
|
|
|
|
++ lib.optional server readline
|
|
|
|
++ lib.optional enableSqlite sqlite;
|
2011-08-20 16:30:16 +02:00
|
|
|
|
2021-01-12 12:50:23 +01:00
|
|
|
dontWrapQtApps = true;
|
2021-09-06 22:18:32 +02:00
|
|
|
dontWrapGApps = true;
|
2021-01-12 12:50:23 +01:00
|
|
|
|
2016-12-28 22:33:13 +01:00
|
|
|
configureFlags = [ "--enable-shared" ]
|
2021-08-05 16:57:52 +02:00
|
|
|
++ lib.optional sdlClient "--enable-client=sdl"
|
|
|
|
++ lib.optionals qtClient [
|
2019-06-25 06:55:12 +02:00
|
|
|
"--enable-client=qt"
|
|
|
|
"--with-qt5-includes=${qt5.qtbase.dev}/include"
|
2021-08-05 16:57:52 +02:00
|
|
|
] ++ lib.optionals gtkClient [ "--enable-client=gtk3.22" ]
|
|
|
|
++ lib.optional enableSqlite "--enable-fcdb=sqlite3"
|
|
|
|
++ lib.optional (!gtkClient) "--enable-fcmp=cli"
|
|
|
|
++ lib.optional (!server) "--disable-server";
|
2015-08-02 21:37:03 +02:00
|
|
|
|
2021-09-06 16:39:49 +02:00
|
|
|
postFixup = lib.optionalString qtClient ''
|
|
|
|
wrapQtApp $out/bin/freeciv-qt
|
2021-09-06 22:18:32 +02:00
|
|
|
'' + lib.optionalString gtkClient ''
|
|
|
|
wrapGApp $out/bin/freeciv-gtk3.22
|
2021-09-06 16:39:49 +02:00
|
|
|
'';
|
|
|
|
|
2017-11-26 08:42:18 +01:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2013-10-06 11:49:53 +02:00
|
|
|
description = "Multiplayer (or single player), turn-based strategy game";
|
2011-08-20 16:30:16 +02:00
|
|
|
longDescription = ''
|
|
|
|
Freeciv is a Free and Open Source empire-building strategy game
|
|
|
|
inspired by the history of human civilization. The game commences in
|
|
|
|
prehistory and your mission is to lead your tribe from the stone age
|
|
|
|
to the space age...
|
|
|
|
'';
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "http://www.freeciv.org"; # http only
|
2011-08-20 16:30:16 +02:00
|
|
|
license = licenses.gpl2;
|
|
|
|
maintainers = with maintainers; [ pierron ];
|
2018-05-22 00:08:43 +02:00
|
|
|
platforms = platforms.unix;
|
2019-06-25 06:55:12 +02:00
|
|
|
hydraPlatforms = platforms.linux; # sdl-config times out on darwin
|
2011-08-20 16:30:16 +02:00
|
|
|
};
|
|
|
|
}
|