From fa1aad8dbcdcc45266ee7c81684744d0b65820a7 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Sat, 11 Jan 2025 08:35:02 +0200
Subject: [PATCH 1/9] Prepare main branch for 3.4 development

See RM #700

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 NEWS                                          |  6 ++++
 data/civ2civ3/README.civ2civ3                 |  2 +-
 doc/BUGS                                      |  2 +-
 doc/README.packaging                          | 31 +++++--------------
 doc/README.rulesets                           |  2 ++
 doc/README.tilesets                           |  2 ++
 fc_version                                    | 20 ++++++------
 meson.build                                   |  2 +-
 platforms/macos/homebrew-appbundle.sh         |  2 +-
 .../installer_msys2/Makefile.autotools        |  2 +-
 .../windows/installer_msys2/Makefile.meson    |  4 +--
 server/ruleset/rscompat.h                     |  2 +-
 server/savegame/savecompat.c                  | 25 +++++++++++++--
 translations/Strings.txt                      |  5 +--
 14 files changed, 61 insertions(+), 46 deletions(-)

diff --git a/NEWS b/NEWS
index b3d39c0f0f..faa3a2d24f 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,12 @@ Not all changes are shown here. Those who are interested in seeing
 the detailed changes should check the ChangeLog file.
 
 
+MAJOR CHANGES FROM 3.3.x to 3.4.0
+---------------------------------
+
+[TODO]
+
+
 MAJOR CHANGES FROM 3.2.x to 3.3.0
 ---------------------------------
 
diff --git a/data/civ2civ3/README.civ2civ3 b/data/civ2civ3/README.civ2civ3
index f61e837402..df3fccaf4e 100644
--- a/data/civ2civ3/README.civ2civ3
+++ b/data/civ2civ3/README.civ2civ3
@@ -1,5 +1,5 @@
 =================================
-Civ2Civ3 Ruleset for Freeciv v3.3
+Civ2Civ3 Ruleset for Freeciv v3.4
 =================================
 
 
diff --git a/doc/BUGS b/doc/BUGS
index 5668a0a285..281316f50d 100644
--- a/doc/BUGS
+++ b/doc/BUGS
@@ -2,7 +2,7 @@
 BUGS
 ====
 
-Freeciv 3.3 certainly contains some bugs. Please report all
+Freeciv 3.4 certainly contains some bugs. Please report all
 you find to https://redmine.freeciv.org/projects/freeciv
 
 
diff --git a/doc/README.packaging b/doc/README.packaging
index d0d0403404..2a3ca9ea9d 100644
--- a/doc/README.packaging
+++ b/doc/README.packaging
@@ -7,30 +7,15 @@ for their distribution, and, to some degree, those people who want to
 create Freeciv fork.
 
 ----------------------------------------------------------------------
-Updating from 3.2 to 3.3
+Updating from 3.3 to 3.4
 ------------------------
-* Client uses ~/.freeciv/freeciv-client-rc-3.3 for storing its options.
+* Client uses ~/.freeciv/freeciv-client-rc-3.4 for storing its options.
   Options are always saved to that file.
   Loading of options first tries to get options from
-  ~/.freeciv/freeciv-client-rc-3.3. If that file does not exist it tries to
+  ~/.freeciv/freeciv-client-rc-3.4. If that file does not exist it tries to
   load options from old client files generated by former version of Freeciv
-  (e.g. ~/.freeciv/freeciv-client-rc-3.2 generated by Freeciv 3.2,
-   ~/.freeciv-client-rc-3.1 generated by Freeciv 3.1).
-* Minimum version of Qt is Qt-5.15, when building in Qt5-mode
-* Configuring source directory is no longer allowed in autotools builds.
-  You have to use separate build dir(s)
-* One needs to use configure option --enable-ack-legacy to build
-  with autotools. Use meson based system instead, if possible
-* Minimum autoconf version, for autotools based builds, is now 2.69
-* New 'qt6x' mode for building Qt based components linked against
-  relatively new Qt6 versions
-* New gtk4x-client that is linked against relatively new gtk4 versions
-* Build with meson supports building gtk4x modpack installer that is linked
-  against relatively new gtk4 versions
-* va_copy support is now mandatory
-* Building web version of the server with autotools is no longer supported.
-  Make such builds with meson instead.
-* Minimum Python requirement for code generation scripts is 3.6.
+  (e.g. ~/.freeciv/freeciv-client-rc-3.3 generated by Freeciv 3.3,
+   ~/.freeciv-client-rc-3.2 generated by Freeciv 3.2).
 
 ----------------------------------------------------------------------
 Compatibility of modified versions
@@ -120,7 +105,7 @@ Generated files
 This is list of files Freeciv might generate to filesystem when running.
 You may want to remove some of these when Freeciv is uninstalled.
 
-* Client saves its options to file "~/.freeciv/freeciv-client-rc-3.3"
+* Client saves its options to file "~/.freeciv/freeciv-client-rc-3.4"
 * Server saves its readline history to file "~/.freeciv/freeciv-server_history"
 * When running local single player games, challenge files with name
   like "~/.freeciv/challenge_*_*" are generated
@@ -129,7 +114,7 @@ You may want to remove some of these when Freeciv is uninstalled.
 * When saving game in independently launched server, savegames go
   to directory specified with "-s" command line option, defaulting
   to working directory
-* freeciv-modpack saves data under "~/.freeciv/3.3/" and
+* freeciv-modpack saves data under "~/.freeciv/3.4/" and
   "~/.freeciv/scenarios/"
 * Server can write log to file specified with "-l" command line option
 * When mapimage feature is used, it can save colortest images to
@@ -192,4 +177,4 @@ can see complete list, while list shown by Freeciv client only lists
 compatible servers.
 
 Any a.b.c release is network compatible with any a.b.d release. If you
-provide 3.3.c client, it can be used to play on 3.3.d server.
+provide 3.4.c client, it can be used to play on 3.4.d server.
diff --git a/doc/README.rulesets b/doc/README.rulesets
index 9eadc80e00..af6068a16c 100644
--- a/doc/README.rulesets
+++ b/doc/README.rulesets
@@ -163,6 +163,8 @@ different versions of Freeciv is kept in the wiki at https://www.freeciv.org/
 The URLs below list the differences between the freeciv versions from 2.2.x
 to the current version:
 
+https://www.freeciv.org/wiki/How_to_update_a_ruleset_from_3.3_to_3.4
+
 https://www.freeciv.org/wiki/How_to_update_a_ruleset_from_3.2_to_3.3
 
 https://www.freeciv.org/wiki/How_to_update_a_ruleset_from_3.1_to_3.2
diff --git a/doc/README.tilesets b/doc/README.tilesets
index 8a269d42fe..3640b8a0c5 100644
--- a/doc/README.tilesets
+++ b/doc/README.tilesets
@@ -17,6 +17,8 @@ different versions of Freeciv is kept in the wiki at https://www.freeciv.org/
 The URLs below list the differences between the freeciv versions from 1.14.x
 to the current version:
 
+https://www.freeciv.org/wiki/How_to_update_a_tileset_from_3.3_to_3.4
+
 https://www.freeciv.org/wiki/How_to_update_a_tileset_from_3.2_to_3.3
 
 https://www.freeciv.org/wiki/How_to_update_a_tileset_from_3.1_to_3.2
diff --git a/fc_version b/fc_version
index edc23aa735..007300c695 100755
--- a/fc_version
+++ b/fc_version
@@ -1,26 +1,26 @@
 #!/bin/sh
 
 #
-#  Copyright (C) 2004-2024 Freeciv team
+#  Copyright (C) 2004-2025 Freeciv team
 
 # Version definition for Freeciv.
 
 MAJOR_VERSION="3"
-MINOR_VERSION="2"
-PATCH_VERSION="92"
-EMERGENCY_VERSION="7"
+MINOR_VERSION="3"
+PATCH_VERSION="90"
+EMERGENCY_VERSION=""
 VERSION_LABEL="-dev"
 
 # Type is either "development" or "stable"
 # Date and NEWS URL are relevant only for "stable" releases
 if test "$VERSION_LABEL" = "" ; then
   RELEASE_TYPE="stable"
-  #RELEASE_DATE="2024-06-14"
+  #RELEASE_DATE="2025-01-17"
   NEWS_URL="https://www.freeciv.org/wiki/NEWS-${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}"
 else
   RELEASE_TYPE="development"
-  #RELEASE_DATE="2024-06-14"
-  #NEWS_URL="https://www.freeciv.org/wiki/NEWS-3.3.0"
+  #RELEASE_DATE="2025-01-17"
+  #NEWS_URL="https://www.freeciv.org/wiki/NEWS-3.4.0"
 fi
 
 #
@@ -59,14 +59,14 @@ IS_DEVEL_VERSION=1
 IS_FREEZE_VERSION=0
 IS_BETA_VERSION=0
 
-NEXT_STABLE_VERSION="3.3.0"
+NEXT_STABLE_VERSION="3.4.0"
 
 # 0 to disable display of release month until we can make better estimate
 RELEASE_MONTH=0
 
-MAIN_VERSION=3.3
+MAIN_VERSION=3.4
 DATASUBDIR=dev
-DEFAULT_FOLLOW_TAG=S3_3
+DEFAULT_FOLLOW_TAG=S3_4
 
 # Freeciv network capstring: see documentation in common/capstr.c
 #
diff --git a/meson.build b/meson.build
index cbdc6475c6..a1e1d311eb 100644
--- a/meson.build
+++ b/meson.build
@@ -150,7 +150,7 @@ priv_conf_data.set('IS_DEVEL_VERSION', 1)
 priv_conf_data.set('IS_FREEZE_VERSION', 0)
 priv_conf_data.set('IS_BETA_VERSION', 0)
 priv_conf_data.set('FREECIV_RELEASE_MONTH', 0)
-priv_conf_data.set('NEXT_STABLE_VERSION', '"3.3.0"')
+priv_conf_data.set('NEXT_STABLE_VERSION', '"3.4.0"')
 
 if host_machine.endian() == 'big'
   priv_conf_data.set('WORDS_BIGENDIAN', 1)
diff --git a/platforms/macos/homebrew-appbundle.sh b/platforms/macos/homebrew-appbundle.sh
index d4f283bde2..4a82f76d1b 100755
--- a/platforms/macos/homebrew-appbundle.sh
+++ b/platforms/macos/homebrew-appbundle.sh
@@ -107,7 +107,7 @@ if ! meson setup .. \
        -Ddebug=false \
        -Dclients=gtk4,qt \
        -Dfcmp=qt \
-       -Dfollowtag=macos-S3_3 \
+       -Dfollowtag=macos-S3_4 \
        -Ddefault_library=static \
        -Dprefix="${CONTENTSDIR}" ||
    ! ninja ||
diff --git a/platforms/windows/installer_msys2/Makefile.autotools b/platforms/windows/installer_msys2/Makefile.autotools
index 121b1b2a15..808b89de6a 100644
--- a/platforms/windows/installer_msys2/Makefile.autotools
+++ b/platforms/windows/installer_msys2/Makefile.autotools
@@ -133,7 +133,7 @@ configure-freeciv-common:
 	# Create build directory
 	mkdir -p $(BUILD_DIR)/$(WINARCH)-$(GUI)
 	# Configure
-	cd $(BUILD_DIR)/$(WINARCH)-$(GUI); $(SRC_ROOT)/../../../configure FREECIV_LABEL_FORCE="<base>-msys2" CPPFLAGS="-D_WIN32_WINNT=$(MIN_WIN_VER)" --enable-client=$(CLIENT) --with-followtag="windows-S3_3" --with-tinycthread --without-readline --disable-sys-lua --enable-fcdb=sqlite3 --with-sqlite3-prefix=/$(ARCHDIR) --enable-fcmp=$(FCMP) --with-cacert-path="./ssl/certs/ca-bundle.crt" --enable-ack-legacy $(EXTRA_CONFIG)
+	cd $(BUILD_DIR)/$(WINARCH)-$(GUI); $(SRC_ROOT)/../../../configure FREECIV_LABEL_FORCE="<base>-msys2" CPPFLAGS="-D_WIN32_WINNT=$(MIN_WIN_VER)" --enable-client=$(CLIENT) --with-followtag="windows-S3_4" --with-tinycthread --without-readline --disable-sys-lua --enable-fcdb=sqlite3 --with-sqlite3-prefix=/$(ARCHDIR) --enable-fcmp=$(FCMP) --with-cacert-path="./ssl/certs/ca-bundle.crt" --enable-ack-legacy $(EXTRA_CONFIG)
 
 configure-freeciv-ruledit-qt5:
 	# Create build directory
diff --git a/platforms/windows/installer_msys2/Makefile.meson b/platforms/windows/installer_msys2/Makefile.meson
index 089731ca6c..c299f952aa 100644
--- a/platforms/windows/installer_msys2/Makefile.meson
+++ b/platforms/windows/installer_msys2/Makefile.meson
@@ -160,7 +160,7 @@ installer-common: install-freeciv-$(GUI) install-env-$(GUI)
 install-freeciv-common: clean-install-client-arch
 	# Create build directory
 	mkdir -p $(BUILD_DIR)/$(WINARCH)-client-$(GUI)
-	cd $(BUILD_DIR)/$(WINARCH)-client-$(GUI); meson setup $(IMSYS2_DIR)/../../.. -Dprefix=$(IMSYS2_DIR)/$(INST_DIR)/$(WINARCH)-client-$(GUI) -Dfollowtag='windows-S3_3' -Dclients=$(CLIENT) -Dfcmp=$(FCMP) -Dtools=manual,ruleup -Dreadline=false -Dcacert-path='./ssl/certs/ca-bundle.crt' -Dmin-win-ver=$(MIN_WIN_VER) -Dsyslua=false $(EXTRA_CONFIG)
+	cd $(BUILD_DIR)/$(WINARCH)-client-$(GUI); meson setup $(IMSYS2_DIR)/../../.. -Dprefix=$(IMSYS2_DIR)/$(INST_DIR)/$(WINARCH)-client-$(GUI) -Dfollowtag='windows-S3_4' -Dclients=$(CLIENT) -Dfcmp=$(FCMP) -Dtools=manual,ruleup -Dreadline=false -Dcacert-path='./ssl/certs/ca-bundle.crt' -Dmin-win-ver=$(MIN_WIN_VER) -Dsyslua=false $(EXTRA_CONFIG)
 	cd $(BUILD_DIR)/$(WINARCH)-client-$(GUI); ninja
 	cd $(BUILD_DIR)/$(WINARCH)-client-$(GUI); ninja install
 	cd $(BUILD_DIR)/$(WINARCH)-client-$(GUI); ninja langstat_core.txt
@@ -176,7 +176,7 @@ install-freeciv-common: clean-install-client-arch
 install-ruledit-common: clean-ruledit-install-arch
 	# Create build directory
 	mkdir -p $(BUILD_DIR)/$(WINARCH)-ruledit-$(GUI)
-	cd $(BUILD_DIR)/$(WINARCH)-ruledit-$(GUI); meson setup $(IMSYS2_DIR)/../../.. -Dprefix=$(IMSYS2_DIR)/$(INST_DIR)/$(WINARCH)-ruledit-$(GUI) -Dfollowtag='windows-S3_3' -Dclients=[] -Dfcmp=[] -Dserver=disabled -Dtools=ruledit -Dreadline=false -Dcacert-path='./ssl/certs/ca-bundle.crt' -Dmin-win-ver=$(MIN_WIN_VER) -Dsyslua=false $(EXTRA_CONFIG)
+	cd $(BUILD_DIR)/$(WINARCH)-ruledit-$(GUI); meson setup $(IMSYS2_DIR)/../../.. -Dprefix=$(IMSYS2_DIR)/$(INST_DIR)/$(WINARCH)-ruledit-$(GUI) -Dfollowtag='windows-S3_4' -Dclients=[] -Dfcmp=[] -Dserver=disabled -Dtools=ruledit -Dreadline=false -Dcacert-path='./ssl/certs/ca-bundle.crt' -Dmin-win-ver=$(MIN_WIN_VER) -Dsyslua=false $(EXTRA_CONFIG)
 	cd $(BUILD_DIR)/$(WINARCH)-ruledit-$(GUI); ninja
 	cd $(BUILD_DIR)/$(WINARCH)-ruledit-$(GUI); ninja install
 	cd $(BUILD_DIR)/$(WINARCH)-ruledit-$(GUI); ninja langstat_core.txt langstat_ruledit.txt
diff --git a/server/ruleset/rscompat.h b/server/ruleset/rscompat.h
index 8597ea080e..8ba8ca0a4d 100644
--- a/server/ruleset/rscompat.h
+++ b/server/ruleset/rscompat.h
@@ -24,7 +24,7 @@ extern "C" {
 #include "ruleload.h"
 #include "settings.h"
 
-#define RULESET_COMPAT_CAP "+Freeciv-3.2-ruleset"
+#define RULESET_COMPAT_CAP "+Freeciv-ruleset-3.3-Devel-2023.Feb.24"
 
 struct rscompat_info
 {
diff --git a/server/savegame/savecompat.c b/server/savegame/savecompat.c
index 225bd2e7b7..ab55b13721 100644
--- a/server/savegame/savecompat.c
+++ b/server/savegame/savecompat.c
@@ -70,7 +70,8 @@ static char *special_names[] =
   3.0.0   | 3.0.0 release                                  | 201./../.. | 40
   3.1.0   | 3.1.0 release                                  | 201./../.. | 50
   3.2.0   | 3.2.0 release                                  | 202./../.. | 60
-  3.3.0   | 3.3.0 release (development)                    | 202./../.. | 70
+  3.3.0   | 3.3.0 release                                  | 202./../.. | 70
+  3.4.0   | 3.4.0 release (development)                    | 202./../.. | 80
           |                                                |            |
 */
 
@@ -81,6 +82,7 @@ static void compat_load_030000(struct loaddata *loading, enum sgf_version format
 static void compat_load_030100(struct loaddata *loading, enum sgf_version format_class);
 static void compat_load_030200(struct loaddata *loading, enum sgf_version format_class);
 static void compat_load_030300(struct loaddata *loading, enum sgf_version format_class);
+static void compat_load_030400(struct loaddata *loading, enum sgf_version format_class);
 static void compat_post_load_030100(struct loaddata *loading,
                                     enum sgf_version format_class);
 
@@ -107,8 +109,8 @@ struct compatibility {
  * add the needed code to load the old version below. Thus, old
  * savegames can still be loaded while the main definition
  * represents the current state of the art. */
-/* While developing freeciv 3.3.0, add the compatibility functions to
- * - compat_load_030300 to load old savegame. */
+/* While developing freeciv 3.4.0, add the compatibility functions to
+ * - compat_load_030400 to load old savegame. */
 static struct compatibility compat[] = {
   /* dummy; equal to the current version (last element) */
   { 0, NULL, NULL },
@@ -130,6 +132,8 @@ static struct compatibility compat[] = {
   { 60, compat_load_030200, NULL },
   /* version 61 to 69 are reserved for possible changes in 3.2.x */
   { 70, compat_load_030300, NULL },
+  /* version 71 to 79 are reserved for possible changes in 3.3.x */
+  { 80, compat_load_030400, NULL },
   /* Current savefile version is listed above this line; it corresponds to
      the definitions in this file. */
 };
@@ -2646,6 +2650,21 @@ static void compat_load_030300(struct loaddata *loading,
   } player_slots_iterate_end;
 }
 
+/************************************************************************//**
+  Translate savegame secfile data from 3.3.x to 3.4.0 format.
+  Note that even after 2.6 savegame has gone through all the compatibility
+  functions, it's still 2.6 savegame in the sense that savegame2.c, and not
+  savegame3.c, handles it.
+****************************************************************************/
+static void compat_load_030400(struct loaddata *loading,
+                               enum sgf_version format_class)
+{
+  /* Check status and return if not OK (sg_success != TRUE). */
+  sg_check_ret();
+
+  log_debug("Upgrading data from savegame to version 3.4.0");
+}
+
 /************************************************************************//**
   Translate savegame secfile data from earlier development version format
   to current one.
diff --git a/translations/Strings.txt b/translations/Strings.txt
index d9fb4ef902..f7c54409b1 100644
--- a/translations/Strings.txt
+++ b/translations/Strings.txt
@@ -15,15 +15,16 @@ added to gettext to get the translation.
 _("?vertag:stable")
 _("?vertag:windows")
 _("?vertag:macos")
-_("?vertag:S3_1")
 _("?vertag:S3_2")
 _("?vertag:S3_3")
+_("?vertag:S3_4")
 _("?vertag:crosser")
-_("?vertag:windows-S3_1")
 _("?vertag:windows-S3_2")
 _("?vertag:windows-S3_3")
+_("?vertag:windows-S3_4")
 _("?vertag:macos-S3_2")
 _("?vertag:macos-S3_3")
+_("?vertag:macos-S3_4")
 
 
 Generated version header
-- 
2.45.2

