From 8ff77b1c1c76f0a78b8ac9ff25a4d49708ecd8bb Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Sun, 16 Jun 2024 22:44:57 +0300
Subject: [PATCH 03/13] installer_cross: Build qt6x-client installer

See RM #720

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 .../installer_cross/create-freeciv-gtk-qt-nsi.sh      |  2 +-
 .../installer_cross/meson-build_all_installers.sh     | 10 ++++++++++
 .../windows/installer_cross/meson-installer_build.sh  | 11 ++++++++---
 3 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/platforms/windows/installer_cross/create-freeciv-gtk-qt-nsi.sh b/platforms/windows/installer_cross/create-freeciv-gtk-qt-nsi.sh
index 515a28937c..81018e4aa2 100755
--- a/platforms/windows/installer_cross/create-freeciv-gtk-qt-nsi.sh
+++ b/platforms/windows/installer_cross/create-freeciv-gtk-qt-nsi.sh
@@ -175,7 +175,7 @@ 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" = "qt6" ; then
+if 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
 
diff --git a/platforms/windows/installer_cross/meson-build_all_installers.sh b/platforms/windows/installer_cross/meson-build_all_installers.sh
index c6bcef70a5..4f5770c8c3 100755
--- a/platforms/windows/installer_cross/meson-build_all_installers.sh
+++ b/platforms/windows/installer_cross/meson-build_all_installers.sh
@@ -85,6 +85,15 @@ else
   QT6="Success"
 fi
 
+if test "${CROSSER_QT6}" != "yes" ; then
+  QT7="N/A"
+elif ! ./meson-installer_build.sh "${DLLSPATH}" qt6x ; then
+  RET=1
+  QT7="Fail"
+else
+  QT7="Success"
+fi
+
 # sdl2-client comes with gtk4 modpack installer
 if test "${CROSSER_GTK4}" != "yes" ; then
   SDL2="N/A"
@@ -108,6 +117,7 @@ echo "Gtk3.22: ${GTK322}"
 echo "Gtk4:    ${GTK4}"
 echo "Gtk4x:   ${GTK4x}"
 echo "Qt6:     ${QT6}"
+echo "Qt6x:    ${QT7}"
 echo "Sdl2:    ${SDL2}"
 echo "Ruledit: ${RULEDIT}"
 
diff --git a/platforms/windows/installer_cross/meson-installer_build.sh b/platforms/windows/installer_cross/meson-installer_build.sh
index f6e68f1de8..3ea059cb52 100755
--- a/platforms/windows/installer_cross/meson-installer_build.sh
+++ b/platforms/windows/installer_cross/meson-installer_build.sh
@@ -115,7 +115,7 @@ fi
 DLLSPATH="$1"
 GUI="$2"
 
-case $GUI in
+case "$GUI" in
   gtk3.22)
     GUINAME="GTK3.22"
     MPGUI="gtk3"
@@ -136,6 +136,11 @@ case $GUI in
     CLIENT="qt"
     MPGUI="qt"
     FCMP="qt" ;;
+  qt6x)
+    GUINAME="Qt6x"
+    CLIENT="qt"
+    MPGUI="qt"
+    FCMP="qt" ;;
   ruledit)
     ;;
   *)
@@ -261,7 +266,7 @@ else
         exit 1
       fi
       ;;
-    qt6)
+    qt6|qt6x)
       if ! cp freeciv-ruledit.cmd "${INSTDIR}"
       then
         echo "Adding cmd-file failed!" >&2
@@ -274,7 +279,7 @@ else
       ;;
   esac
 
-  if test "${GUI}" = "qt6" ; then
+  if test "${GUI}" = "qt6" || test "${GUI}" = "qt6x" ; then
     EXE_ID="qt"
   else
     EXE_ID="${GUI}"
-- 
2.45.2

