From 9ad6320712107064d03630037864fe1d1635c793 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Sat, 6 Sep 2025 14:01:55 +0300
Subject: [PATCH 8/8] Drop autotools support for gtk4x-client

See RM #1674

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 Makefile.am             |  1 -
 bootstrap/Makefile.am   |  9 -------
 client/Makefile.am      | 19 --------------
 configure.ac            | 56 ++---------------------------------------
 data/themes/Makefile.am |  4 ---
 m4/gtk5-client.m4       | 30 ----------------------
 tools/fcmp/Makefile.am  | 21 ----------------
 7 files changed, 2 insertions(+), 138 deletions(-)
 delete mode 100644 m4/gtk5-client.m4

diff --git a/Makefile.am b/Makefile.am
index 14d3db9d06..07c963fc55 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -66,7 +66,6 @@ EXTRA_DIST =	autogen.sh 			\
 		m4/gettimeofday.m4		\
 		m4/gtk3.22-client.m4		\
 		m4/gtk4-client.m4		\
-		m4/gtk5-client.m4		\
 		m4/host-cpu-c-abi.m4		\
 		m4/iconv.m4			\
 		m4/intl.m4			\
diff --git a/bootstrap/Makefile.am b/bootstrap/Makefile.am
index 9cb61bd2c4..940bf4e184 100644
--- a/bootstrap/Makefile.am
+++ b/bootstrap/Makefile.am
@@ -23,26 +23,22 @@ EXTRA_DIST =	freeciv.project		\
 		langstat_ruledit.txt	\
 		org.freeciv.gtk322.desktop	\
 		org.freeciv.gtk4.desktop	\
-		org.freeciv.gtk4x.desktop	\
 		org.freeciv.sdl2.desktop	\
 		org.freeciv.sdl3.desktop	\
 		org.freeciv.qt.desktop \
 		org.freeciv.server.desktop	\
 		org.freeciv.gtk3.mp.desktop	\
 		org.freeciv.gtk4.mp.desktop	\
-		org.freeciv.gtk4x.mp.desktop	\
 		org.freeciv.qt.mp.desktop	\
 		org.freeciv.ruledit.desktop	\
 		org.freeciv.gtk322.metainfo.xml.in \
 		org.freeciv.gtk4.metainfo.xml.in \
-		org.freeciv.gtk4x.metainfo.xml.in \
 		org.freeciv.sdl2.metainfo.xml.in \
 		org.freeciv.sdl3.metainfo.xml.in \
 		org.freeciv.qt.metainfo.xml.in \
 		org.freeciv.server.metainfo.xml.in \
 		org.freeciv.gtk3.mp.metainfo.xml.in \
 		org.freeciv.gtk4.mp.metainfo.xml.in \
-		org.freeciv.gtk4x.mp.metainfo.xml.in \
 		org.freeciv.qt.mp.metainfo.xml.in \
 		org.freeciv.ruledit.metainfo.xml.in \
 		config.rpath		\
@@ -72,11 +68,6 @@ metainfofile_DATA += org.freeciv.gtk4.metainfo.xml
 desktopfile_DATA  += org.freeciv.gtk4.desktop
 endif
 
-if CLIENT_GUI_GTK_5
-metainfofile_DATA += org.freeciv.gtk4x.metainfo.xml
-desktopfile_DATA  += org.freeciv.gtk4x.desktop
-endif
-
 if CLIENT_GUI_QT
 metainfofile_DATA += org.freeciv.qt.metainfo.xml
 desktopfile_DATA  += org.freeciv.qt.desktop
diff --git a/client/Makefile.am b/client/Makefile.am
index 31e9d8530b..78cb01c3ad 100644
--- a/client/Makefile.am
+++ b/client/Makefile.am
@@ -17,10 +17,6 @@ if CLIENT_GUI_GTK_4
 GUI_SUBDIRS += gui-gtk-4.0
 endif
 
-if CLIENT_GUI_GTK_5
-GUI_SUBDIRS += gui-gtk-5.0
-endif
-
 if CLIENT_GUI_QT
 GUI_SUBDIRS += gui-qt
 endif
@@ -213,21 +209,6 @@ freeciv_gtk4_LDADD = \
  $(gui_gtk4_libs)
 endif
 
-if CLIENT_GUI_GTK_5
-bin_PROGRAMS += freeciv-gtk4x
-noinst_LTLIBRARIES += libfcgui-gtk5.la
-libfcgui_gtk5_la_SOURCES = $(freeciv_client_src)
-libfcgui_gtk5_la_LIBADD = gui-gtk-5.0/libgui-gtk5.la $(clientlibs)
-freeciv_gtk4x_SOURCES = dummy.c
-freeciv_gtk4x_LDFLAGS = $(gui_gtk4_ldflags)
-freeciv_gtk4x_LDADD = \
- libfcgui-gtk5.la $(SOUND_LIBS) gui-gtk-5.0/gui_main.lo \
- $(top_builddir)/common/libfreeciv.la \
- $(INTLLIBS) $(CLIENT_LIBS) $(CLIENTICON) \
- $(TINYCTHR_LIBS) $(MAPIMG_WAND_LIBS) \
- $(gui_gtk5_libs)
-endif
-
 if CLIENT_GUI_SDL2
 bin_PROGRAMS += freeciv-sdl2
 noinst_LTLIBRARIES += libfcgui-sdl2.la
diff --git a/configure.ac b/configure.ac
index e43e4c7453..be2bc29f79 100644
--- a/configure.ac
+++ b/configure.ac
@@ -165,14 +165,13 @@ for db in $(echo $databases | $SED 's/,/ /g') ; do
 done
 
 AC_ARG_ENABLE([fcmp],
-  AS_HELP_STRING([--enable-fcmp=no/yes/gtk3/gtk4/gtk4x/qt/cli/all/auto], [build freeciv-modpack-program [auto]]),
+  AS_HELP_STRING([--enable-fcmp=no/yes/gtk3/gtk4/qt/cli/all/auto], [build freeciv-modpack-program [auto]]),
 [fc_mp=${enableval}],
 [fc_mp=auto])
 
 fcmp_cli=no
 fcmp_gtk3=no
 fcmp_gtk4=no
-fcmp_gtk5=no
 fcmp_qt=no
 fcmp_list=
 
@@ -195,8 +194,6 @@ for mp in $(echo $fc_mp | $SED 's/,/ /g') ; do
     req_fcmp_gtk3=yes
   elif test "x$mp" = "xgtk4" ; then
     req_fcmp_gtk4=yes
-  elif test "x$mp" = "xgtk4x" ; then
-    req_fcmp_gtk5=yes
   elif test "x$mp" = "xqt" ; then
     req_fcmp_qt=yes
   elif test "x$mp" = "xcli" ; then
@@ -460,14 +457,13 @@ dnl auto: Autodetect one.
 dnl all:  Autodetect as many as possible.
 dnl comma-separated-list: Detect these or abort.
 AC_ARG_ENABLE([client],
-  AS_HELP_STRING([--enable-client=auto/all/gtk3.22/sdl2/qt/gtk4/gtk4x/stub],
+  AS_HELP_STRING([--enable-client=auto/all/gtk3.22/sdl2/qt/gtk4/stub],
                  [clients to compile [auto](list for multiple)]),
 [clients=${enableval}],
 [client=auto])
 
 gui_gtk3_22=no
 gui_gtk4=no
-gui_gtk5=no
 gui_sdl2=no
 gui_qt=no
 gui_stub=no
@@ -484,8 +480,6 @@ for gui in $(echo $clients | $SED 's/,/ /g') ; do
       gui_gtk3_22=yes
     elif test "x$gui" = "xgtk4" ; then
       gui_gtk4=yes
-    elif test "x$gui" = "xgtk4x" ; then
-      gui_gtk5=yes
     elif test "x$gui" = "xgtk" ; then
       AC_MSG_WARN([for requested client 'gtk' enabled gtk3.22-client, that has changed since earlier versions and will change again in the future])
       gui_gtk3_22=yes
@@ -1070,9 +1064,6 @@ if test "x$client" != "xno"; then
   dnl SDL2-specific overrides
   FC_SDL2_CLIENT
 
-  dnl Gtk-5.0-specific overrides
-  FC_GTK5_CLIENT
-
   dnl Stub-specific overrides
   if test "x$gui_stub" = "xyes" || test "x$client" = "xall" ; then
     gui_stub=yes
@@ -1091,7 +1082,6 @@ fi
 if test "x$client" = "xall" ; then
   if test "x$gui_gtk3_22" = "xyes" ||
      test "x$gui_gtk4" = "xyes" ||
-     test "x$gui_gtk5" = "xyes" ||
      test "x$gui_sdl2" = "xyes" ||
      test "x$gui_qt" = "xyes" ||
      test "x$gui_stub" = "xyes" ; then
@@ -1209,34 +1199,6 @@ if test "x$req_fcmp_qt" = "xyes" && test "x$fcmp_qt" != "xyes" ; then
 Maybe another --with-qtver value would help?])
 fi
 
-if test "x$req_fcmp_gtk5" = "xyes" ||
-   test "x$modinst" = "xall" || test "x$modinst" = "xauto" ; then
-  PKG_CHECK_MODULES([GTK5_MP], [gtk4 >= 4.14.0],
-[
-  GTK5_MP_CFLAGS="$GTK5_MP_CFLAGS -DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_4_14"
-  GTK5_MP_CFLAGS="$GTK5_MP_CFLAGS -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_76"
-  PKG_CHECK_MODULES([GTHREAD_GTK5], [gthread-2.0],
-[
-  fcmp_gtk5=yes
-  fcmp_list="$fcmp_list gtk4x"
-  mp_gtk5_cflags="$GTK5_MP_CFLAGS $GTHREAD_GTK5_CFLAGS"
-  mp_gtk5_libs="$GTK5_MP_LIBS $GTHREAD_GTK5_LIBS"
-  if test "x$MINGW" = "xyes"; then
-    dnl Required to compile gtk5 on Windows platform
-    mp_gtk5_cflags="$mp_gtk5_cflags -mms-bitfields"
-    mp_gtk5_ldflags="$mp_gtk5_ldflags $MWINDOWS_FLAG"
-  fi
-
-  if test "x$modinst" = "xauto" ; then
-    modinst=found
-  fi
-], [fcmp_gtk5=no])], [fcmp_gtk5=no])
-fi
-
-if test "x$req_fcmp_gtk5" = "xyes" && test "x$fcmp_gtk5" != "xyes" ; then
-  AC_MSG_ERROR([Cannot build gtk4x-version of freeciv-modpack as requested])
-fi
-
 dnl Cli does not satisfy --enable-fcmp=auto as it's not an gui.
 if test "x$req_fcmp_cli" = "xyes" || test "x$modinst" = "xall" ; then
   fcmp_cli=yes
@@ -1248,7 +1210,6 @@ if test "x$modinst" != "xfound" &&
    test "x$modinst" != "xcli" &&
    test "x$fcmp_gtk3" != "xyes" &&
    test "x$fcmp_gtk4" != "xyes" &&
-   test "x$fcmp_gtk5" != "xyes" &&
    test "x$fcmp_qt" != "xyes" ;then
   AC_MSG_ERROR([Cannot build modpack installer with any gui])
 fi
@@ -1257,7 +1218,6 @@ if test "x$modinst" != "xno" && test "x$MINGW" != "xyes" ; then
   dnl Hack to get a run-time icon -- not needed on Windows
   mp_gtk3_cflags="$mp_gtk3_cflags -DMPICON_PATH=\"\\\"$datadir/freeciv/misc/mpicon.png\\\"\""
   mp_gtk4_cflags="$mp_gtk4_cflags -DMPICON_PATH=\"\\\"$datadir/freeciv/misc/mpicon.png\\\"\""
-  mp_gtk5_cflags="$mp_gtk5_cflags -DMPICON_PATH=\"\\\"$datadir/freeciv/misc/mpicon.png\\\"\""
 fi
 
 if test "x$fcmp_list" = "x" ; then
@@ -1267,7 +1227,6 @@ fi
 AM_CONDITIONAL([MODINST], [test "x$modinst" != "xno"])
 AM_CONDITIONAL([MODINST_GTK3], [test "x$fcmp_gtk3" = "xyes"])
 AM_CONDITIONAL([MODINST_GTK4], [test "x$fcmp_gtk4" = "xyes"])
-AM_CONDITIONAL([MODINST_GTK5], [test "x$fcmp_gtk5" = "xyes"])
 AM_CONDITIONAL([MODINST_QT], [test "x$fcmp_qt" = "xyes"])
 AM_CONDITIONAL([MODINST_CLI], [test "x$fcmp_cli" = "xyes"])
 
@@ -1439,9 +1398,6 @@ AC_SUBST([gui_gtk3_22_ldflags])
 AC_SUBST([gui_gtk4_cflags])
 AC_SUBST([gui_gtk4_libs])
 AC_SUBST([gui_gtk4_ldflags])
-AC_SUBST([gui_gtk5_cflags])
-AC_SUBST([gui_gtk5_libs])
-AC_SUBST([gui_gtk5_ldflags])
 AC_SUBST([gui_sdl2_cflags])
 AC_SUBST([gui_sdl2_libs])
 AC_SUBST([gui_sdl2_ldflags])
@@ -1462,9 +1418,6 @@ AC_SUBST([mp_gtk3_ldflags])
 AC_SUBST([mp_gtk4_cflags])
 AC_SUBST([mp_gtk4_libs])
 AC_SUBST([mp_gtk4_ldflags])
-AC_SUBST([mp_gtk5_cflags])
-AC_SUBST([mp_gtk5_libs])
-AC_SUBST([mp_gtk5_ldflags])
 AC_SUBST([mp_qt_cppflags])
 AC_SUBST([mp_qt_cxxflags])
 AC_SUBST([mp_qt_libs])
@@ -1481,7 +1434,6 @@ AM_CONDITIONAL(AUDIO_SDL, test "x$SDL_mixer" != "xno")
 AM_CONDITIONAL(CLIENT_GUI_SDL2, test "x$gui_sdl2" = "xyes")
 AM_CONDITIONAL(CLIENT_GUI_GTK_3_22, test "x$gui_gtk3_22" = "xyes")
 AM_CONDITIONAL(CLIENT_GUI_GTK_4, test "x$gui_gtk4" = "xyes")
-AM_CONDITIONAL(CLIENT_GUI_GTK_5, test "x$gui_gtk5" = "xyes")
 AM_CONDITIONAL(CLIENT_GUI_QT, test "x$gui_qt" = "xyes")
 AM_CONDITIONAL(CLIENT_GUI_STUB, test "x$gui_stub" = "xyes")
 AM_CONDITIONAL(MINGW, test x"$MINGW" = "xyes")
@@ -2038,10 +1990,6 @@ AC_MSG_NOTICE([
     SDL2:    $gui_sdl2
     Stub:    $gui_stub
 
-  In-development client frontends:
-   (these are not yet ready for general use)
-    Gtk-4.x: $gui_gtk5
-
   == Server ==
   Build freeciv server:  $server
     AI modules support:    $enable_aimodules
diff --git a/data/themes/Makefile.am b/data/themes/Makefile.am
index 7ed6a7aafd..33eaf88e36 100644
--- a/data/themes/Makefile.am
+++ b/data/themes/Makefile.am
@@ -9,10 +9,6 @@ endif
 
 if CLIENT_GUI_GTK_4
 SUBDIRS += gtk4
-else
-if CLIENT_GUI_GTK_5
-SUBDIRS += gtk4
-endif
 endif
 
 if CLIENT_GUI_SDL2
diff --git a/m4/gtk5-client.m4 b/m4/gtk5-client.m4
deleted file mode 100644
index 37a868b278..0000000000
--- a/m4/gtk5-client.m4
+++ /dev/null
@@ -1,30 +0,0 @@
-# Try to configure the GTK-4.x client (gui-gtk-5.0)
-
-# FC_GTK5_CLIENT
-# Test for GTK-5.0 libraries needed for gui-gtk-4.x
-
-AC_DEFUN([FC_GTK5_CLIENT],
-[
-  if test "x$gui_gtk5" = "xyes" ||
-     test "x$client" = "xall" || test "x$client" = "xauto" ; then
-    PKG_CHECK_MODULES([GTK5], [gtk4 >= 4.14.0],
-      [
-        GTK5_CFLAGS="$GTK5_CFLAGS -DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_4_8"
-        GTK5_CFLAGS="$GTK5_CFLAGS -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_76"
-        gui_gtk5=yes
-        if test "x$client" = "xauto" ; then
-          client=yes
-        fi
-        gui_gtk5_cflags="$GTK5_CFLAGS"
-        gui_gtk5_libs="$GTK5_LIBS"
-        if test "x$MINGW" = "xyes"; then
-          dnl Required to compile gtk5 on Windows platform
-          gui_gtk5_cflags="$gui_gtk5_cflags -mms-bitfields"
-          gui_gtk5_ldflags="$gui_gtk5_ldflags $MWINDOWS_FLAG"
-        fi
-      ],
-      [
-        FC_NO_CLIENT([gtk4x], [GTK-4.x libraries not found])
-      ])
-  fi
-])
diff --git a/tools/fcmp/Makefile.am b/tools/fcmp/Makefile.am
index 4d61520ada..7d46c90c84 100644
--- a/tools/fcmp/Makefile.am
+++ b/tools/fcmp/Makefile.am
@@ -15,9 +15,6 @@ endif
 if MODINST_GTK4
 bin_PROGRAMS += freeciv-mp-gtk4
 endif
-if MODINST_GTK5
-bin_PROGRAMS += freeciv-mp-gtk4x
-endif
 if MODINST_QT
 bin_PROGRAMS += freeciv-mp-qt
 endif
@@ -102,22 +99,6 @@ freeciv_mp_gtk4_LDADD = \
 		$(MPICON)
 endif
 
-if MODINST_GTK5
-freeciv_mp_gtk4x_CPPFLAGS = $(common_cppflags) $(mp_gtk5_cflags)
-
-freeciv_mp_gtk4x_SOURCES = mpgui_gtk5.c
-
-freeciv_mp_gtk4x_LDFLAGS = $(mp_gtk5_ldflags)
-
-freeciv_mp_gtk4x_LDADD = \
-		libfcmp.la \
-		$(top_builddir)/dependencies/cvercmp/libcvercmp.la \
-		$(top_builddir)/common/libfreeciv.la \
-		$(TINYCTHR_LIBS) $(MAPIMG_WAND_LIBS) \
-		$(mp_gtk5_libs) -lsqlite3 \
-		$(MPICON)
-endif
-
 if MODINST_QT
 
 MOC_FILES = \
@@ -145,5 +126,3 @@ freeciv_mp_qt_LDADD = \
 		$(mp_qt_libs) -lsqlite3 \
 		$(MPICON)
 endif
-
-EXTRA_DIST = mpgui_gtk5.c
-- 
2.51.0

