nixpkgs/pkgs/games/freeciv/default.nix

70 lines
2.1 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchFromGitHub, autoreconfHook, lua5_3, pkg-config, python3
2019-06-25 04:55:12 +00:00
, zlib, bzip2, curl, lzma, gettext, libiconv
2015-08-02 19:37:03 +00:00
, sdlClient ? true, SDL, SDL_mixer, SDL_image, SDL_ttf, SDL_gfx, freetype, fluidsynth
2019-06-25 04:55:12 +00:00
, gtkClient ? false, gtk3
, qtClient ? false, qt5
, server ? true, readline
, enableSqlite ? true, sqlite
}:
let
2021-01-15 04:31:39 +00:00
inherit (lib) optional optionals;
2019-06-25 04:55:12 +00:00
in stdenv.mkDerivation rec {
pname = "freeciv";
2020-12-02 04:33:17 +00:00
version = "2.6.2.1";
2019-06-25 04:55:12 +00:00
src = fetchFromGitHub {
owner = "freeciv";
repo = "freeciv";
rev = "R${builtins.replaceStrings [ "." ] [ "_" ] version}";
2020-12-02 04:33:17 +00:00
sha256 = "1nra6b6sk2gciaw1fpwx7qa20hky8cwcdwlshcl1zsikg577hyg5";
};
2019-06-25 04:55:12 +00:00
postPatch = ''
for f in {common,utility}/*.py; do
substituteInPlace $f \
2020-04-03 20:26:05 +00:00
--replace '/usr/bin/env python3' ${python3.interpreter}
2019-06-25 04:55:12 +00:00
done
'';
nativeBuildInputs = [ autoreconfHook pkg-config ];
2019-06-25 04:55:12 +00:00
buildInputs = [ lua5_3 zlib bzip2 curl lzma gettext libiconv ]
2015-08-02 19:37:03 +00:00
++ optionals sdlClient [ SDL SDL_mixer SDL_image SDL_ttf SDL_gfx freetype fluidsynth ]
2019-06-25 04:55:12 +00:00
++ optionals gtkClient [ gtk3 ]
++ optionals qtClient [ qt5.qtbase ]
2016-12-28 20:32:34 +00:00
++ optional server readline
++ optional enableSqlite sqlite;
configureFlags = [ "--enable-shared" ]
2015-08-02 19:37:03 +00:00
++ optional sdlClient "--enable-client=sdl"
2019-06-25 04:55:12 +00:00
++ optionals qtClient [
"--enable-client=qt"
"--with-qt5-includes=${qt5.qtbase.dev}/include"
]
++ optional enableSqlite "--enable-fcdb=sqlite3"
2015-08-02 19:37:03 +00:00
++ optional (!gtkClient) "--enable-fcmp=cli"
2019-06-25 04:55:12 +00:00
++ optional (!server) "--disable-server";
2015-08-02 19:37:03 +00:00
2017-11-26 07:42:18 +00:00
enableParallelBuilding = true;
meta = with lib; {
description = "Multiplayer (or single player), turn-based strategy game";
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...
'';
homepage = "http://www.freeciv.org"; # http only
license = licenses.gpl2;
maintainers = with maintainers; [ pierron ];
2018-05-21 22:08:43 +00:00
platforms = platforms.unix;
2019-06-25 04:55:12 +00:00
hydraPlatforms = platforms.linux; # sdl-config times out on darwin
};
}