From 447562c1dd6cc49a74948a088db369103ab1e0d9 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Sat, 28 Sep 2024 01:19:45 +0300
Subject: [PATCH 44/44] Msys2: Add gtk4x-installer

See RM #920

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 doc/README.msys2                                  |  3 ++-
 platforms/windows/Makefile.am                     |  3 +++
 platforms/windows/installer_msys2/Makefile.meson  | 15 +++++++++++++--
 .../installer_msys2/create-freeciv-gtk4x-nsi.sh   |  5 +++++
 .../windows/installer_msys2/freeciv-gtk4x.cmd     |  3 +++
 .../windows/installer_msys2/freeciv-mp-gtk4x.cmd  |  3 +++
 6 files changed, 29 insertions(+), 3 deletions(-)
 create mode 100644 platforms/windows/installer_msys2/create-freeciv-gtk4x-nsi.sh
 create mode 100644 platforms/windows/installer_msys2/freeciv-gtk4x.cmd
 create mode 100644 platforms/windows/installer_msys2/freeciv-mp-gtk4x.cmd

diff --git a/doc/README.msys2 b/doc/README.msys2
index 68106ecfd6..f7c3efbd95 100644
--- a/doc/README.msys2
+++ b/doc/README.msys2
@@ -22,7 +22,7 @@ is located here for quick reference for the specific freeciv revision.
 
 - With premade environment, buildable clients are:
   For "win64":    gtk3.22, gtk4, sdl2, Qt5
-  For "win64-10": gtk3.22, gtk4, sdl2, Qt6
+  For "win64-10": gtk3.22, gtk4, gtk4x, sdl2, Qt6
 
 
  Setup
@@ -202,6 +202,7 @@ Get the freeciv sources there somehow. Some options are:
   - "<gui>-installer", where <gui> is
      - gtk3.22
      - gtk4
+     - gtk4x
      - sdl2
      - qt5
      - qt6
diff --git a/platforms/windows/Makefile.am b/platforms/windows/Makefile.am
index 140cfcebe0..a040482430 100644
--- a/platforms/windows/Makefile.am
+++ b/platforms/windows/Makefile.am
@@ -7,6 +7,7 @@ dist_noinst_DATA = \
 		installer_msys2/create-freeciv-gtk-qt-nsi.sh	\
 		installer_msys2/create-freeciv-gtk3.22-nsi.sh	\
 		installer_msys2/create-freeciv-gtk4-nsi.sh	\
+		installer_msys2/create-freeciv-gtk4x-nsi.sh	\
 		installer_msys2/create-freeciv-qt5-nsi.sh	\
 		installer_msys2/create-freeciv-qt6-nsi.sh	\
 		installer_msys2/create-freeciv-qt6x-nsi.sh	\
@@ -14,8 +15,10 @@ dist_noinst_DATA = \
 		installer_msys2/create-freeciv-ruledit-nsi.sh	\
 		installer_msys2/freeciv-gtk3.22.cmd		\
 		installer_msys2/freeciv-gtk4.cmd		\
+		installer_msys2/freeciv-gtk4x.cmd		\
 		installer_msys2/freeciv-mp-gtk3.cmd		\
 		installer_msys2/freeciv-mp-gtk4.cmd		\
+		installer_msys2/freeciv-mp-gtk4x.cmd		\
 		installer_msys2/freeciv-mp-qt.cmd		\
 		installer_msys2/freeciv-qt.cmd			\
 		installer_msys2/freeciv-sdl2.cmd		\
diff --git a/platforms/windows/installer_msys2/Makefile.meson b/platforms/windows/installer_msys2/Makefile.meson
index fb32329bfa..6bfa609794 100644
--- a/platforms/windows/installer_msys2/Makefile.meson
+++ b/platforms/windows/installer_msys2/Makefile.meson
@@ -70,9 +70,9 @@ all: all-$(WINARCH)
 
 all-win64: gtk3.22-installer sdl2-installer gtk4-installer qt5-installer ruledit-installer-qt5
 
-all-win64-10: gtk3.22-installer sdl2-installer gtk4-installer qt6-installer ruledit-installer-qt6 qt6x-installer
+all-win64-10: gtk3.22-installer sdl2-installer gtk4-installer qt6-installer ruledit-installer-qt6 qt6x-installer gtk4x-installer
 
-all-win64+: gtk3.22-install sdl2-install gtk4-install qt6-install ruledit-install-qt6
+all-win64+: gtk3.22-install sdl2-install gtk4-install qt6-install ruledit-install-qt6 gtk4x-install
 
 snapshot:
 	cd $(SRC_ROOT) ; ./scripts/refresh_changelog.sh
@@ -87,6 +87,9 @@ gtk3.22-installer:
 gtk4-installer:
 	make -f $(MAKEFILE_NAME) GUI=gtk4 CLIENT=gtk4 FCMP=gtk4 installer-common
 
+gtk4x-installer:
+	make -f $(MAKEFILE_NAME) GUI=gtk4x CLIENT=gtk4x FCMP=gtk4x installer-common
+
 sdl2-installer:
 	make -f $(MAKEFILE_NAME) GUI=sdl2 CLIENT=sdl2 FCMP=gtk4 installer-common
 
@@ -114,6 +117,9 @@ gtk3.22-install:
 gtk4-install:
 	make -f $(MAKEFILE_NAME) GUI=gtk4 CLIENT=gtk4 FCMP=gtk4 install-freeciv-gtk4
 
+gtk4x-install:
+	make -f $(MAKEFILE_NAME) GUI=gtk4x CLIENT=gtk4x FCMP=gtk4x install-freeciv-gtk4x
+
 sdl2-install:
 	make -f $(MAKEFILE_NAME) GUI=sdl2 CLIENT=sdl2 FCMP=gtk4 install-freeciv-sdl2
 
@@ -312,6 +318,8 @@ install-freeciv-gtk3.22: install-freeciv-common
 
 install-freeciv-gtk4: install-freeciv-common
 
+install-freeciv-gtk4x: install-freeciv-common
+
 install-freeciv-sdl2: install-freeciv-common
 
 install-freeciv-qt5: install-freeciv-common
@@ -324,6 +332,8 @@ install-env-gtk3.22: install-env-gtk3-fcmp
 
 install-env-gtk4: install-env-gtk4-fcmp
 
+install-env-gtk4x: install-env-gtk4-fcmp
+
 SDL2_DLLS := \
 	SDL2_ttf.dll \
 	libSDL2_gfx-1-0-0.dll \
@@ -475,6 +485,7 @@ clean-ruledit-common:
 clean:
 	make -f $(MAKEFILE_NAME) GUI=gtk3.22 clean-build-client clean-install-client clean-installer-common
 	make -f $(MAKEFILE_NAME) GUI=gtk4 clean-build-client clean-install-client clean-installer-common
+	make -f $(MAKEFILE_NAME) GUI=gtk4x clean-build-client clean-install-client clean-installer-common
 	make -f $(MAKEFILE_NAME) GUI=sdl2 clean-build-client clean-install-client clean-installer-common
 	make -f $(MAKEFILE_NAME) GUI=qt5 clean-build-client clean-install-client clean-installer-common
 	make -f $(MAKEFILE_NAME) GUI=qt6 clean-build-client clean-install-client clean-installer-common
diff --git a/platforms/windows/installer_msys2/create-freeciv-gtk4x-nsi.sh b/platforms/windows/installer_msys2/create-freeciv-gtk4x-nsi.sh
new file mode 100644
index 0000000000..d1b023d755
--- /dev/null
+++ b/platforms/windows/installer_msys2/create-freeciv-gtk4x-nsi.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+# ./create-freeciv-gtk4x-nsi.sh <freeciv files dir> <output dir> <version> <win32|win64|win>
+
+./create-freeciv-gtk-qt-nsi.sh "$1" "$2" "$3" "gtk4x" "GTK4x" "$4" "gtk4x"
diff --git a/platforms/windows/installer_msys2/freeciv-gtk4x.cmd b/platforms/windows/installer_msys2/freeciv-gtk4x.cmd
new file mode 100644
index 0000000000..d1fad55fa9
--- /dev/null
+++ b/platforms/windows/installer_msys2/freeciv-gtk4x.cmd
@@ -0,0 +1,3 @@
+@echo off
+if not "%1" == "auto" set LANG=%1
+start "%~n0" /D . "%~dp0\freeciv-gtk4x.exe" %2 %3 %4 %5 %6 %7 %8 %9
diff --git a/platforms/windows/installer_msys2/freeciv-mp-gtk4x.cmd b/platforms/windows/installer_msys2/freeciv-mp-gtk4x.cmd
new file mode 100644
index 0000000000..ce1aeee6a8
--- /dev/null
+++ b/platforms/windows/installer_msys2/freeciv-mp-gtk4x.cmd
@@ -0,0 +1,3 @@
+@echo off
+if not "%1" == "auto" set LANG=%1
+start "%~n0" /D . "%~dp0\freeciv-mp-gtk4x.exe" %2 %3 %4 %5 %6 %7 %8 %9
-- 
2.45.2

