From 9ae248d5ba3dba5923c9cdda95ac777bce56f92b Mon Sep 17 00:00:00 2001 From: Michael Livshin Date: Sat, 11 Jun 2022 01:21:12 +0300 Subject: [PATCH] freeciv: 2.6.6 -> 3.0.1 * change the default client to gtk (because sdl2 is marked experimental) * use sdl2 sound in all clients --- pkgs/games/freeciv/default.nix | 25 +++++++++++++++++-------- pkgs/top-level/all-packages.nix | 17 +++++++++++------ 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/pkgs/games/freeciv/default.nix b/pkgs/games/freeciv/default.nix index f5c1ff0ea3f4..b1d215912a0a 100644 --- a/pkgs/games/freeciv/default.nix +++ b/pkgs/games/freeciv/default.nix @@ -1,7 +1,8 @@ { lib, stdenv, fetchFromGitHub, autoreconfHook, lua5_3, pkg-config, python3 -, zlib, bzip2, curl, xz, gettext, libiconv -, sdlClient ? true, SDL, SDL_mixer, SDL_image, SDL_ttf, SDL_gfx, freetype, fluidsynth -, gtkClient ? false, gtk3, wrapGAppsHook +, zlib, bzip2, curl, xz, gettext, libiconv, icu +, SDL2, SDL2_mixer, SDL2_image, SDL2_ttf, SDL2_gfx, freetype, fluidsynth +, sdl2Client ? false +, gtkClient ? true, gtk3, wrapGAppsHook , qtClient ? false, qt5 , server ? true, readline , enableSqlite ? true, sqlite @@ -9,13 +10,13 @@ stdenv.mkDerivation rec { pname = "freeciv"; - version = "2.6.6"; + version = "3.0.1"; src = fetchFromGitHub { owner = "freeciv"; repo = "freeciv"; rev = "R${lib.replaceStrings [ "." ] [ "_" ] version}"; - sha256 = "sha256-D5t6sMpm09jbixs5MCghBeDbeuRbGmrrfWR91VNolRM="; + sha256 = "sha256-Nzc6Tirj6TKLgTYN5XjZZut9HVYLKGOp1GZeaoqEtW8="; }; postPatch = '' @@ -29,8 +30,8 @@ stdenv.mkDerivation rec { ++ lib.optional qtClient [ qt5.wrapQtAppsHook ] ++ lib.optional gtkClient [ wrapGAppsHook ]; - buildInputs = [ lua5_3 zlib bzip2 curl xz gettext libiconv ] - ++ lib.optionals sdlClient [ SDL SDL_mixer SDL_image SDL_ttf SDL_gfx freetype fluidsynth ] + buildInputs = [ lua5_3 zlib bzip2 curl xz gettext libiconv icu ] + ++ [ SDL2 SDL2_mixer SDL2_image SDL2_ttf SDL2_gfx freetype fluidsynth ] ++ lib.optionals gtkClient [ gtk3 ] ++ lib.optionals qtClient [ qt5.qtbase ] ++ lib.optional server readline @@ -39,8 +40,16 @@ stdenv.mkDerivation rec { dontWrapQtApps = true; dontWrapGApps = true; + # configure is not smart enough to look for SDL2 headers under + # .../SDL2, but thankfully $SDL2_PATH is almost exactly what we want + preConfigure = '' + export CPPFLAGS="$(echo $SDL2_PATH | sed 's#/nix/store/#-I/nix/store/#g')" + ''; configureFlags = [ "--enable-shared" ] - ++ lib.optional sdlClient "--enable-client=sdl" + ++ lib.optionals sdl2Client [ + "--enable-client=sdl2" + "--enable-sdl-mixer=sdl2" + ] ++ lib.optionals qtClient [ "--enable-client=qt" "--with-qt5-includes=${qt5.qtbase.dev}/include" diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 5d53db14aa9d..9e2a1c38e275 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -31803,20 +31803,25 @@ with pkgs; freecell-solver = callPackage ../games/freecell-solver { }; freeciv = callPackage ../games/freeciv { - autoreconfHook = buildPackages.autoreconfHook269; - qt5 = qt514; + sdl2Client = false; + gtkClient = true; + qtClient = false; }; - freeciv_gtk = freeciv.override { - gtkClient = true; - sdlClient = false; + freeciv_sdl2 = freeciv.override { + sdl2Client = true; + gtkClient = false; + qtClient = false; }; freeciv_qt = freeciv.override { + sdl2Client = false; + gtkClient = false; qtClient = true; - sdlClient = false; }; + freeciv_gtk = freeciv; + freedink = callPackage ../games/freedink { }; freeorion = callPackage ../games/freeorion { };