@@ -1,7 +1,7 @@
11{ lib, stdenv, fetchFromGitHub, autoreconfHook, lua5_3, pkg-config, python3
22, zlib, bzip2, curl, xz, gettext, libiconv
33, sdlClient ? true, SDL, SDL_mixer, SDL_image, SDL_ttf, SDL_gfx, freetype, fluidsynth
4−, gtkClient ? stdenv.isLinux, gtk3
4+, gtkClient ? false, gtk3, wrapGAppsHook
55, qtClient ? false, qt5
66, server ? true, readline
77, enableSqlite ? true, sqlite
@@ -26,7 +26,8 @@ stdenv.mkDerivation rec {
2626 '';
2727
2828 nativeBuildInputs = [ autoreconfHook pkg-config ]
29− ++ lib.optional qtClient [ qt5.wrapQtAppsHook ];
29+ ++ lib.optional qtClient [ qt5.wrapQtAppsHook ]
30+ ++ lib.optional gtkClient [ wrapGAppsHook ];
3031
3132 buildInputs = [ lua5_3 zlib bzip2 curl xz gettext libiconv ]
3233 ++ lib.optionals sdlClient [ SDL SDL_mixer SDL_image SDL_ttf SDL_gfx freetype fluidsynth ]
@@ -36,6 +37,7 @@ stdenv.mkDerivation rec {
3637 ++ lib.optional enableSqlite sqlite;
3738
3839 dontWrapQtApps = true;
40+ dontWrapGApps = true;
3941
4042 configureFlags = [ "--enable-shared" ]
4143 ++ lib.optional sdlClient "--enable-client=sdl"
@@ -47,6 +49,12 @@ stdenv.mkDerivation rec {
4749 ++ lib.optional (!gtkClient) "--enable-fcmp=cli"
4850 ++ lib.optional (!server) "--disable-server";
4951
52+ postFixup = lib.optionalString qtClient ''
53+ wrapQtApp $out/bin/freeciv-qt
54+ '' + lib.optionalString gtkClient ''
55+ wrapGApp $out/bin/freeciv-gtk3.22
56+ '';
57+
5058 enableParallelBuilding = true;
5159
5260 meta = with lib; {