2019-06-25 06:55:12 +02:00
|
|
|
{ stdenv, fetchFromGitHub, autoreconfHook, lua5_3, pkgconfig, python
|
|
|
|
, zlib, bzip2, curl, lzma, gettext, libiconv
|
2015-08-02 21:37:03 +02:00
|
|
|
, sdlClient ? true, SDL, SDL_mixer, SDL_image, SDL_ttf, SDL_gfx, freetype, fluidsynth
|
2019-06-25 06:55:12 +02:00
|
|
|
, gtkClient ? false, gtk3
|
|
|
|
, 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
|
|
|
|
2012-02-13 20:34:39 +01:00
|
|
|
let
|
|
|
|
inherit (stdenv.lib) optional optionals;
|
2013-10-20 18:26:32 +02:00
|
|
|
|
2019-06-25 06:55:12 +02:00
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
pname = "freeciv";
|
2018-08-09 01:45:36 +02:00
|
|
|
version = "2.6.0";
|
2019-06-25 06:55:12 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "freeciv";
|
|
|
|
repo = "freeciv";
|
|
|
|
rev = "R${builtins.replaceStrings [ "." ] [ "_" ] version}";
|
|
|
|
sha256 = "1b3q5k9wpv7z24svz01ybw8d8wlzkkdr6ia5hgp6cxk6vq67n67s";
|
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 \
|
|
|
|
--replace '/usr/bin/env python' ${python.interpreter}
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [ autoreconfHook pkgconfig ];
|
2012-02-13 20:34:39 +01:00
|
|
|
|
2019-06-25 06:55:12 +02:00
|
|
|
buildInputs = [ lua5_3 zlib bzip2 curl lzma gettext libiconv ]
|
2015-08-02 21:37:03 +02:00
|
|
|
++ optionals sdlClient [ SDL SDL_mixer SDL_image SDL_ttf SDL_gfx freetype fluidsynth ]
|
2019-06-25 06:55:12 +02:00
|
|
|
++ optionals gtkClient [ gtk3 ]
|
|
|
|
++ optionals qtClient [ qt5.qtbase ]
|
2016-12-28 21:32:34 +01:00
|
|
|
++ optional server readline
|
2016-12-28 22:12:57 +01:00
|
|
|
++ optional enableSqlite sqlite;
|
2011-08-20 16:30:16 +02:00
|
|
|
|
2016-12-28 22:33:13 +01:00
|
|
|
configureFlags = [ "--enable-shared" ]
|
2015-08-02 21:37:03 +02:00
|
|
|
++ optional sdlClient "--enable-client=sdl"
|
2019-06-25 06:55:12 +02:00
|
|
|
++ optionals qtClient [
|
|
|
|
"--enable-client=qt"
|
|
|
|
"--with-qt5-includes=${qt5.qtbase.dev}/include"
|
|
|
|
]
|
2016-12-28 22:12:57 +01:00
|
|
|
++ optional enableSqlite "--enable-fcdb=sqlite3"
|
2015-08-02 21:37:03 +02:00
|
|
|
++ optional (!gtkClient) "--enable-fcmp=cli"
|
2019-06-25 06:55:12 +02:00
|
|
|
++ optional (!server) "--disable-server";
|
2015-08-02 21:37:03 +02:00
|
|
|
|
2017-11-26 08:42:18 +01:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2011-08-20 16:30:16 +02:00
|
|
|
meta = with stdenv.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
|
|
|
};
|
|
|
|
}
|