about summary refs log tree commit diff
path: root/pkgs/games
diff options
context:
space:
mode:
authorPeter Hoeg <peter@hoeg.com>2019-06-25 16:20:31 +0800
committerGitHub <noreply@github.com>2019-06-25 16:20:31 +0800
commita2075a2c314ccb3df6522dd957bb4e237446dc49 (patch)
treeb14fec1562e2b4550b203c828756271c3474a3aa /pkgs/games
parentcd83cecdc8accee367d3d09171024464b0fb98ad (diff)
parent31c33e34200b9704ceaaa26d82b73f54a175aae8 (diff)
downloadnixlib-a2075a2c314ccb3df6522dd957bb4e237446dc49.tar
nixlib-a2075a2c314ccb3df6522dd957bb4e237446dc49.tar.gz
nixlib-a2075a2c314ccb3df6522dd957bb4e237446dc49.tar.bz2
nixlib-a2075a2c314ccb3df6522dd957bb4e237446dc49.tar.lz
nixlib-a2075a2c314ccb3df6522dd957bb4e237446dc49.tar.xz
nixlib-a2075a2c314ccb3df6522dd957bb4e237446dc49.tar.zst
nixlib-a2075a2c314ccb3df6522dd957bb4e237446dc49.zip
Merge pull request #63760 from peterhoeg/f/freeciv
freeciv_qt: init at 2.6.0
Diffstat (limited to 'pkgs/games')
-rw-r--r--pkgs/games/freeciv/default.nix47
1 files changed, 30 insertions, 17 deletions
diff --git a/pkgs/games/freeciv/default.nix b/pkgs/games/freeciv/default.nix
index 5d7883c18949..9fc260e74062 100644
--- a/pkgs/games/freeciv/default.nix
+++ b/pkgs/games/freeciv/default.nix
@@ -1,6 +1,8 @@
-{ stdenv, fetchurl, zlib, bzip2, pkgconfig, curl, lzma, gettext, libiconv
+{ stdenv, fetchFromGitHub, autoreconfHook, lua5_3, pkgconfig, python
+, zlib, bzip2, curl, lzma, gettext, libiconv
 , sdlClient ? true, SDL, SDL_mixer, SDL_image, SDL_ttf, SDL_gfx, freetype, fluidsynth
-, gtkClient ? false, gtk2
+, gtkClient ? false, gtk3
+, qtClient ? false, qt5
 , server ? true, readline
 , enableSqlite ? true, sqlite
 }:
@@ -8,31 +10,42 @@
 let
   inherit (stdenv.lib) optional optionals;
 
-  name = "freeciv";
+in stdenv.mkDerivation rec {
+  pname = "freeciv";
   version = "2.6.0";
-in
-stdenv.mkDerivation {
-  name = "${name}-${version}";
-  inherit version;
-
-  src = fetchurl {
-    url = "mirror://sourceforge/freeciv/${name}-${version}.tar.bz2";
-    sha256 = "16f9wsnn7073s6chzbm3819swd0iw019p9nrzr3diiynk28kj83w";
+
+  src = fetchFromGitHub {
+    owner = "freeciv";
+    repo = "freeciv";
+    rev = "R${builtins.replaceStrings [ "." ] [ "_" ] version}";
+    sha256 = "1b3q5k9wpv7z24svz01ybw8d8wlzkkdr6ia5hgp6cxk6vq67n67s";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  postPatch = ''
+    for f in {common,utility}/*.py; do
+      substituteInPlace $f \
+        --replace '/usr/bin/env python' ${python.interpreter}
+    done
+  '';
+
+  nativeBuildInputs = [ autoreconfHook pkgconfig ];
 
-  buildInputs = [ zlib bzip2 curl lzma gettext libiconv ]
+  buildInputs = [ lua5_3 zlib bzip2 curl lzma gettext libiconv ]
     ++ optionals sdlClient [ SDL SDL_mixer SDL_image SDL_ttf SDL_gfx freetype fluidsynth ]
-    ++ optionals gtkClient [ gtk2 ]
+    ++ optionals gtkClient [ gtk3 ]
+    ++ optionals qtClient  [ qt5.qtbase ]
     ++ optional server readline
     ++ optional enableSqlite sqlite;
 
   configureFlags = [ "--enable-shared" ]
     ++ optional sdlClient "--enable-client=sdl"
+    ++ optionals qtClient [
+      "--enable-client=qt"
+      "--with-qt5-includes=${qt5.qtbase.dev}/include"
+    ]
     ++ optional enableSqlite "--enable-fcdb=sqlite3"
     ++ optional (!gtkClient) "--enable-fcmp=cli"
-    ++ optional (!server) "--disable-server";
+    ++ optional (!server)    "--disable-server";
 
   enableParallelBuilding = true;
 
@@ -46,11 +59,11 @@ stdenv.mkDerivation {
       to the space age...
     '';
 
-    homepage = http://freeciv.wikia.com/;
+    homepage = http://www.freeciv.org; # http only
     license = licenses.gpl2;
 
     maintainers = with maintainers; [ pierron ];
     platforms = platforms.unix;
-    hydraPlatforms = stdenv.lib.platforms.linux; # sdl-config times out on darwin
+    hydraPlatforms = platforms.linux; # sdl-config times out on darwin
   };
 }