From 335a3e7888e773690ba7973f326162b0faa39e8d Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Sun, 17 Mar 2024 10:04:14 +0200
Subject: [PATCH 04/44] Update msys2 environment to 240323 level

- Update to upstream snapshot 240113
- Drop win32 support completely
- Update to use autoconf-2.72

See RM #285

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 doc/README.msys2                              | 25 ++++++++-----------
 .../installer_msys2/Makefile.autotools        | 10 +++++++-
 .../windows/installer_msys2/Makefile.meson    | 10 +++++++-
 3 files changed, 28 insertions(+), 17 deletions(-)

diff --git a/doc/README.msys2 b/doc/README.msys2
index 248d7834e4..e46a571565 100644
--- a/doc/README.msys2
+++ b/doc/README.msys2
@@ -10,8 +10,8 @@ using MSYS2 from https://www.msys2.org/
 ==============
 
 Current official premade MSYS2 environment version info:
-[premade]:  msys2-freeciv-win64-231202.7z
-[upstream]: https://repo.msys2.org/distrib/x86_64/msys2-x86_64-20231026.exe
+[premade]:  msys2-freeciv-win64-240323.7z
+[upstream]: https://repo.msys2.org/distrib/x86_64/msys2-x86_64-20240113.exe
 
 See chapter "Premade environment" for what these mean. The info
 is located here for quick reference for the specific freeciv revision.
@@ -24,9 +24,6 @@ is located here for quick reference for the specific freeciv revision.
   For "win64":    gtk3.22, gtk4, sdl2, Qt5
   For "win64-10": gtk3.22, gtk4, sdl2, Qt6
 
-- With custom environment (see "Setup" chapter below)
-  one can also build all the clients for "win32" targets
-
 
  Setup
 ====================================
@@ -38,7 +35,6 @@ is located here for quick reference for the specific freeciv revision.
  with listing of versions current at the time of this freeciv version.
 
  "<arch>" in the package names depends on the build target:
- - win32    -> "i686"
  - win64    -> "x86_64"
  - win64-10 -> "ucrt-x86_64"
 
@@ -81,7 +77,7 @@ is located here for quick reference for the specific freeciv revision.
  - git
  - automake1.16
  - libtool
- - autoconf2.71
+ - autoconf2.72
  - autoconf-wrapper
 
 2.1.2) Arch-specific packages needed for building freeciv
@@ -146,11 +142,10 @@ and then packages were updated to the level indicated
 by the date (YYMMDD) in the freeciv msys2 environment
 .7z package name.
 
-Most packages are included for all of win32, win64 and
+Most packages are included for all of win64 and
 ucrt64 (win64, with minimum requirement of Windows 10) targets.
 For each package listed below with <arch> in the name, actually
-three packages are installed;
-one with a name where <arch> is replaced by 'i686',
+two packages are installed;
 one where <arch> is replaced by 'x86_64', and
 one where <arch> is replaced by 'ucrt-x86_64'
 
@@ -162,7 +157,7 @@ Following packages have been installed:
 - patch
 - automake1.16
 - libtool
-- autoconf2.71
+- autoconf2.72
 - autoconf-wrapper
 - gdb
 - mingw-w64-<arch>-gcc
@@ -179,8 +174,8 @@ Following packages have been installed:
 - mingw-w64-<arch>-SDL2_ttf
 - mingw-w64-<arch>-SDL2_gfx
 - mingw-w64-<arch>-imagemagick
-- mingw-w64-i686-qt5-base, mingw-w64-x86_64-qt5-base
-- mingw-w64-i686-qt5-svg, mingw-w64-x86_64-qt5-svg
+- mingw-w64-x86_64-qt5-base
+- mingw-w64-x86_64-qt5-svg
 - mingw-w64-<arch>-drmingw
 - mingw-w64-<arch>-meson
 - mingw-w64-<arch>-tolua
@@ -195,7 +190,7 @@ empty the package cache for having smaller environment package.
 ====================================
 
 Launch build target specific msys2 shell;
-ucrt64.exe, mingw64.exe or mingw32.exe.
+ucrt64.exe or mingw64.exe.
 Get the freeciv sources there somehow. Some options are:
 1) Download freeciv tarball within msys2 shell with wget
 2) Use git within msys2 shell to get them from version control
@@ -224,7 +219,7 @@ Get the freeciv sources there somehow. Some options are:
  newer Windows versions could otherwise have.
  The version is set via MIN_WIN_VER variable. For values to use, see
  list in: https://msdn.microsoft.com/en-us/library/6sehtctf.aspx
- Current default is 0x0603 (Windows 8.1) for "win32" and "win64".
+ Current default is 0x0603 (Windows 8.1) for "win64".
  This is also the lowest value that msys2 upstream supports.
  For "win64-10" the default is 0x0A00 (Windows 10)
 
diff --git a/platforms/windows/installer_msys2/Makefile.autotools b/platforms/windows/installer_msys2/Makefile.autotools
index 27ed0ef71d..8c472ab6e6 100644
--- a/platforms/windows/installer_msys2/Makefile.autotools
+++ b/platforms/windows/installer_msys2/Makefile.autotools
@@ -420,7 +420,15 @@ SDL2_DLLS := \
 	libzstd.dll \
 	libjxl.dll \
 	libbrotlienc.dll \
-	libhwy.dll
+	libhwy.dll \
+        libavif-16.dll \
+        libwebpdemux-2.dll \
+        libjxl_cms.dll \
+        libaom.dll \
+        libdav1d-7.dll \
+        rav1e.dll \
+        libSvtAv1Enc-2.dll \
+        libyuv.dll
 
 install-env-sdl2: install-env-gtk4-fcmp
 	# Add DLLs
diff --git a/platforms/windows/installer_msys2/Makefile.meson b/platforms/windows/installer_msys2/Makefile.meson
index ea6532a8c8..d359527c5c 100644
--- a/platforms/windows/installer_msys2/Makefile.meson
+++ b/platforms/windows/installer_msys2/Makefile.meson
@@ -333,7 +333,15 @@ SDL2_DLLS := \
 	SDL2_image.dll \
 	libjxl.dll \
 	libbrotlienc.dll \
-	libhwy.dll
+	libhwy.dll \
+        libavif-16.dll \
+        libwebpdemux-2.dll \
+        libjxl_cms.dll \
+        libaom.dll \
+        libdav1d-7.dll \
+        rav1e.dll \
+        libSvtAv1Enc-2.dll \
+        libyuv.dll
 
 install-env-sdl2: install-env-gtk4-fcmp
 	# Add DLLs
-- 
2.43.0

