git: b274c8918b4f - main - games/openttd: update OpenTTD to the latest version 13.4

From: Alexey Dokuchaev <danfe_at_FreeBSD.org>
Date: Thu, 22 Feb 2024 11:10:58 UTC
The branch main has been updated by danfe:

URL: https://cgit.FreeBSD.org/ports/commit/?id=b274c8918b4f9bda160326dc0233524975acd031

commit b274c8918b4f9bda160326dc0233524975acd031
Author:     Alexey Dokuchaev <danfe@FreeBSD.org>
AuthorDate: 2024-02-22 11:09:56 +0000
Commit:     Alexey Dokuchaev <danfe@FreeBSD.org>
CommitDate: 2024-02-22 11:09:56 +0000

    games/openttd: update OpenTTD to the latest version 13.4
    
    - By popular demand, prefer SDL 2.x by default but leave the option
      to use the previous stable version
    - Drop incomplete work-around for strange Clang bug added in commit
      f2488f960dc8: the problem is not specific to PowerPC but versions
      13.1 and later no longer trigger it (pending investigation)
    
    PR:             272428, 272623
    Reported by:    portscout, pkg-fallout
    Clang bug:      https://github.com/llvm/llvm-project/issues/49093
---
 games/openttd/Makefile                   | 30 +++++++++---------------------
 games/openttd/distinfo                   |  6 +++---
 games/openttd/files/patch-CMakeLists.txt | 14 ++++++++++----
 3 files changed, 22 insertions(+), 28 deletions(-)

diff --git a/games/openttd/Makefile b/games/openttd/Makefile
index 4c78f3a2bb26..2c8767d76450 100644
--- a/games/openttd/Makefile
+++ b/games/openttd/Makefile
@@ -1,8 +1,7 @@
 PORTNAME=	openttd
-DISTVERSION=	13.0
-PORTREVISION=	2
+DISTVERSION=	13.4
 CATEGORIES=	games
-MASTER_SITES=	https://proxy.binaries.openttd.org/openttd-releases/${DISTVERSION}/
+MASTER_SITES=	https://cdn.openttd.org/openttd-releases/${DISTVERSION}/
 DISTNAME=	${PORTNAME}-${DISTVERSION}-source
 
 MAINTAINER=	danfe@FreeBSD.org
@@ -14,13 +13,13 @@ LICENSE=	GPLv2
 LIB_DEPENDS=	libpng.so:graphics/png \
 		liblzo2.so:archivers/lzo2
 
-USES=		cmake cpe pkgconfig tar:xz
+USES=		cmake compiler:c++17-lang cpe pkgconfig tar:xz
 CMAKE_ARGS=	-DCMAKE_INSTALL_BINDIR:PATH=bin \
 		-DCMAKE_INSTALL_DATADIR:PATH=share
 
 WRKSRC=		${WRKDIR}/${PORTNAME}-${DISTVERSION}
 
-OPTIONS_DEFINE=	DOCS FLUIDSYNTH SAVE_PASSWORDS SERVER
+OPTIONS_DEFINE=	DOCS FLUIDSYNTH SAVE_PASSWORDS SDL1 SERVER
 SERVER_PREVENTS=	FLUIDSYNTH
 
 FLUIDSYNTH_LIB_DEPENDS=	libfluidsynth.so:audio/fluidsynth
@@ -29,6 +28,11 @@ FLUIDSYNTH_CMAKE_ON=	-DWITH_FLUIDSYNTH:BOOL=ON
 SAVE_PASSWORDS_DESC=	Save passwords between server restarts
 SAVE_PASSWORDS_EXTRA_PATCHES=	${FILESDIR}/extra-patch-save-passwords
 
+SDL1_DESC=	Use SDL v1.2 instead of v2 for GUI
+SDL1_VARS=	_SDL_VERSION=sdl
+SDL1_CMAKE_OFF=	-DWITH_SDL2:BOOL=ON
+SDL1_VARS_OFF=	_SDL_VERSION=sdl2
+
 SERVER_DESC=		Build dedicated server only (no GUI)
 SERVER_USES_OFF=	gnome sdl
 SERVER_USE_OFF=		SDL=${_SDL_VERSION}
@@ -40,22 +44,6 @@ SERVER_LIB_DEPENDS_OFF=	libfontconfig.so:x11-fonts/fontconfig \
 			libiculx.so:devel/icu-lx
 SERVER_VARS=		USE_RC_SUBR=${PORTNAME}
 
-.include <bsd.port.options.mk>
-
-.if ${ARCH:Mpowerpc*} && ${OSVERSION} > 1400078
-USES+=		llvm:min=16
-CC=		clang${LLVM_VERSION}
-CXX=		clang++${LLVM_VERSION}
-.else
-USES+=		compiler:c++17-lang
-.endif
-
-.if exists(${LOCALBASE}/lib/libSDL2.so)
-_SDL_VERSION=		sdl2
-.else
-_SDL_VERSION=		sdl
-.endif
-
 post-install-SERVER-on:
 	@${REINPLACE_CMD} -E '/\.desktop|icons|pixmaps/d' ${TMPPLIST}
 
diff --git a/games/openttd/distinfo b/games/openttd/distinfo
index 2b588f925aa5..c3828606cb3b 100644
--- a/games/openttd/distinfo
+++ b/games/openttd/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1675619840
-SHA256 (openttd-13.0-source.tar.xz) = 339df8e0e0827087c83afe78f8efc6a73b0a3d8a950a0b53137ce6e8aad7ab67
-SIZE (openttd-13.0-source.tar.xz) = 7422316
+TIMESTAMP = 1708509717
+SHA256 (openttd-13.4-source.tar.xz) = 2a1deba01bfe58e2188879f450c3fa4f3819271ab49bf348dd66545f040d146f
+SIZE (openttd-13.4-source.tar.xz) = 7428012
diff --git a/games/openttd/files/patch-CMakeLists.txt b/games/openttd/files/patch-CMakeLists.txt
index 24881ccc445a..d6e569721c72 100644
--- a/games/openttd/files/patch-CMakeLists.txt
+++ b/games/openttd/files/patch-CMakeLists.txt
@@ -1,7 +1,13 @@
---- CMakeLists.txt.orig	2022-04-02 10:38:20 UTC
+--- CMakeLists.txt.orig	2023-07-29 23:01:44 UTC
 +++ CMakeLists.txt
-@@ -133,7 +133,9 @@ if(NOT OPTION_DEDICATED)
-             if(NOT SDL2_FOUND)
+@@ -129,11 +129,14 @@ if(NOT OPTION_DEDICATED)
+         find_package(Allegro)
+         if(NOT APPLE)
+             find_package(Freetype)
++if(WITH_SDL2)
+             find_package(SDL2)
+-            if(NOT SDL2_FOUND)
++else()
                  find_package(SDL)
              endif()
 +if(WITH_FLUIDSYNTH)
@@ -10,7 +16,7 @@
              find_package(Fontconfig)
              find_package(ICU OPTIONAL_COMPONENTS i18n lx)
          endif()
-@@ -260,7 +262,9 @@ link_package(LIBLZMA TARGET LibLZMA::LibLZMA ENCOURAGE
+@@ -260,7 +263,9 @@ link_package(LIBLZMA TARGET LibLZMA::LibLZMA ENCOURAGE
  link_package(LZO)
  
  if(NOT OPTION_DEDICATED)