From eadbc7c397595b237d512325cd0e6d50898f0f7d Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Tue, 10 Sep 2024 05:42:14 +0300
Subject: [PATCH 31/31] Msys2: Add qt6x-installer

See RM #845

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 platforms/windows/Makefile.am                 |  1 +
 .../windows/installer_msys2/Makefile.meson    | 22 ++++++++++++++++++-
 .../create-freeciv-gtk-qt-nsi.sh              | 12 +++++-----
 .../create-freeciv-qt6x-nsi.sh                |  5 +++++
 4 files changed, 33 insertions(+), 7 deletions(-)
 create mode 100644 platforms/windows/installer_msys2/create-freeciv-qt6x-nsi.sh

diff --git a/platforms/windows/Makefile.am b/platforms/windows/Makefile.am
index 074325e017..140cfcebe0 100644
--- a/platforms/windows/Makefile.am
+++ b/platforms/windows/Makefile.am
@@ -9,6 +9,7 @@ dist_noinst_DATA = \
 		installer_msys2/create-freeciv-gtk4-nsi.sh	\
 		installer_msys2/create-freeciv-qt5-nsi.sh	\
 		installer_msys2/create-freeciv-qt6-nsi.sh	\
+		installer_msys2/create-freeciv-qt6x-nsi.sh	\
 		installer_msys2/create-freeciv-sdl2-nsi.sh	\
 		installer_msys2/create-freeciv-ruledit-nsi.sh	\
 		installer_msys2/freeciv-gtk3.22.cmd		\
diff --git a/platforms/windows/installer_msys2/Makefile.meson b/platforms/windows/installer_msys2/Makefile.meson
index 1456b7bc2c..fb32329bfa 100644
--- a/platforms/windows/installer_msys2/Makefile.meson
+++ b/platforms/windows/installer_msys2/Makefile.meson
@@ -70,7 +70,7 @@ 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
+all-win64-10: gtk3.22-installer sdl2-installer gtk4-installer qt6-installer ruledit-installer-qt6 qt6x-installer
 
 all-win64+: gtk3.22-install sdl2-install gtk4-install qt6-install ruledit-install-qt6
 
@@ -96,12 +96,18 @@ qt5-installer:
 qt6-installer:
 	make -f $(MAKEFILE_NAME) EXTRA_CONFIG="-Ddebug=false -Dqtver=qt6 -Dsvgflags=true $(EXTRA_CONFIG)" GUI=qt6 CLIENT=qt FCMP=qt installer-common
 
+qt6x-installer:
+	make -f $(MAKEFILE_NAME) EXTRA_CONFIG="-Ddebug=false -Dqtver=qt6x -Dsvgflags=true $(EXTRA_CONFIG)" GUI=qt6x CLIENT=qt FCMP=qt installer-common
+
 ruledit-installer-qt5:
 	make -f $(MAKEFILE_NAME) EXTRA_CONFIG="-Ddebug=false -Dqtver=qt5 $(EXTRA_CONFIG)" GUI=qt5 installer-ruledit-common
 
 ruledit-installer-qt6:
 	make -f $(MAKEFILE_NAME) EXTRA_CONFIG="-Ddebug=false -Dqtver=qt6 $(EXTRA_CONFIG)" GUI=qt6 installer-ruledit-common
 
+ruledit-installer-qt6x:
+	make -f $(MAKEFILE_NAME) EXTRA_CONFIG="-Ddebug=false -Dqtver=qt6x $(EXTRA_CONFIG)" GUI=qt6x installer-ruledit-common
+
 gtk3.22-install:
 	make -f $(MAKEFILE_NAME) GUI=gtk3.22 CLIENT=gtk3.22 FCMP=gtk3 install-freeciv-gtk3.22
 
@@ -117,12 +123,18 @@ qt5-install:
 qt6-install:
 	make -f $(MAKEFILE_NAME) GUI=qt6 CLIENT=qt FCMP=qt EXTRA_CONFIG="-Dqtver=qt6 -Dsvgflags=true $(EXTRA_CONFIG)" install-freeciv-qt6
 
+qt6x-install:
+	make -f $(MAKEFILE_NAME) GUI=qt6x CLIENT=qt FCMP=qt EXTRA_CONFIG="-Dqtver=qt6x -Dsvgflags=true $(EXTRA_CONFIG)" install-freeciv-qt6x
+
 ruledit-install-qt5:
 	make -f $(MAKEFILE_NAME) GUI=qt5 EXTRA_CONFIG="-Dqtver=qt5 $(EXTRA_CONFIG)" install-ruledit-qt5
 
 ruledit-install-qt6:
 	make -f $(MAKEFILE_NAME) GUI=qt6 EXTRA_CONFIG="-Dqtver=qt6 $(EXTRA_CONFIG)" install-ruledit-qt6
 
+ruledit-install-qt6x:
+	make -f $(MAKEFILE_NAME) GUI=qt6x EXTRA_CONFIG="-Dqtver=qt6x $(EXTRA_CONFIG)" install-ruledit-qt6x
+
 installer-common: install-freeciv-$(GUI) install-env-$(GUI)
 	# Extract Freeciv version
 	$(eval FREECIV_VERSION := $(shell $(SRC_ROOT)/fc_version))
@@ -306,6 +318,8 @@ install-freeciv-qt5: install-freeciv-common
 
 install-freeciv-qt6: install-freeciv-common
 
+install-freeciv-qt6x: install-freeciv-common
+
 install-env-gtk3.22: install-env-gtk3-fcmp
 
 install-env-gtk4: install-env-gtk4-fcmp
@@ -374,6 +388,8 @@ install-env-qt6: install-env-qt6-fcmp
 	# Add DLLs
 	cp -R $(addprefix $(DLLPATH_PREFIX), $(CLIENT_QT6_DLLS)) $(INST_DIR)/$(WINARCH)-client-$(GUI)/
 
+install-env-qt6x: install-env-qt6
+
 installer-ruledit-common: install-ruledit-$(GUI)
 	# Add DLLs
 	cp -R $(addprefix $(DLLPATH_PREFIX), $(COMMON_DLLS)) $(INST_DIR)/$(WINARCH)-ruledit-$(GUI)/
@@ -424,6 +440,8 @@ install-ruledit-qt6: install-ruledit-common
 	cp -R /usr/share/locale $(INST_DIR)/$(WINARCH)-ruledit-$(GUI)/share/
 	find $(INST_DIR)/$(WINARCH)-ruledit-$(GUI)/share/locale -type f -not -name "freeciv-*.mo" -delete
 
+install-ruledit-qt6: install-ruledit-qt6
+
 # Cleanup
 
 clean-build-client:
@@ -460,5 +478,7 @@ clean:
 	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
+	make -f $(MAKEFILE_NAME) GUI=qt6x clean-build-client clean-install-client clean-installer-common
 	make -f $(MAKEFILE_NAME) GUI=qt5 clean-build-ruledit clean-ruledit-install clean-ruledit-common
 	make -f $(MAKEFILE_NAME) GUI=qt6 clean-build-ruledit clean-ruledit-install clean-ruledit-common
+	make -f $(MAKEFILE_NAME) GUI=qt6x clean-build-ruledit clean-ruledit-install clean-ruledit-common
diff --git a/platforms/windows/installer_msys2/create-freeciv-gtk-qt-nsi.sh b/platforms/windows/installer_msys2/create-freeciv-gtk-qt-nsi.sh
index cd5f210aa7..7903790dee 100644
--- a/platforms/windows/installer_msys2/create-freeciv-gtk-qt-nsi.sh
+++ b/platforms/windows/installer_msys2/create-freeciv-gtk-qt-nsi.sh
@@ -142,14 +142,14 @@ Section "\${APPNAME} (required)"
   SetOutPath \$INSTDIR
 EOF
 
-  # find files and directories to exclude from default installation
+  # Find files and directories to exclude from default installation
 
   echo -n "  File /nonfatal /r "
 
-  # languages
+  # Languages
   echo -n "/x locale "
 
-  # soundsets
+  # Soundsets
   find $1/data -mindepth 1 -maxdepth 1 -name *.soundspec -printf %f\\n |
   sed 's|.soundspec||' |
   while read -r name
@@ -171,8 +171,8 @@ cat <<EOF
   CreateShortCut "\$SMPROGRAMS\\\$STARTMENU_FOLDER\Freeciv Modpack Installer.lnk" "\$INSTDIR\freeciv-mp-\${MPEXE_ID}.cmd" "\$DefaultLanguageCode" "\$INSTDIR\freeciv-mp-\${MPEXE_ID}.exe" 0 SW_SHOWMINIMIZED
 EOF
 
-if test "$4" = "qt5" || test "$4" = "qt6" ; then
-    echo "CreateShortCut \"\$SMPROGRAMS\\\$STARTMENU_FOLDER\Freeciv Ruleset Editor.lnk\" \"\$INSTDIR\freeciv-ruledit.cmd\" \"\$DefaultLanguageCode\" \"\$INSTDIR\freeciv-ruledit.exe\" 0 SW_SHOWMINIMIZED"
+if test "$4" = "qt5" || test "$4" = "qt6" || test "$4" = "qt6x" ; then
+  echo "CreateShortCut \"\$SMPROGRAMS\\\$STARTMENU_FOLDER\Freeciv Ruleset Editor.lnk\" \"\$INSTDIR\freeciv-ruledit.cmd\" \"\$DefaultLanguageCode\" \"\$INSTDIR\freeciv-ruledit.exe\" 0 SW_SHOWMINIMIZED"
 fi
 
 cat <<EOF
@@ -194,7 +194,7 @@ SectionEnd
 
 EOF
 
-### soundsets ###
+### Soundsets ###
 
 cat <<EOF
 SectionGroup "Soundsets"
diff --git a/platforms/windows/installer_msys2/create-freeciv-qt6x-nsi.sh b/platforms/windows/installer_msys2/create-freeciv-qt6x-nsi.sh
new file mode 100644
index 0000000000..a5ab4df317
--- /dev/null
+++ b/platforms/windows/installer_msys2/create-freeciv-qt6x-nsi.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+# ./create-freeciv-qt6x-nsi.sh <freeciv files dir> <output dir> <version> <win32|win64|win>
+
+./create-freeciv-gtk-qt-nsi.sh "$1" "$2" "$3" "qt6x" "Qt6x" "$4" "" "qt"
-- 
2.45.2

