git: 1aecf2db7cc2 - main - games/devilutionX: fix build with SDL2 2.24.0

From: Dmitry Marakasov <amdmi3_at_FreeBSD.org>
Date: Wed, 07 Sep 2022 17:23:12 UTC
The branch main has been updated by amdmi3:

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

commit 1aecf2db7cc2630fa4a550a3e48368d597264bc9
Author:     Dmitry Marakasov <amdmi3@FreeBSD.org>
AuthorDate: 2022-09-07 15:43:33 +0000
Commit:     Dmitry Marakasov <amdmi3@FreeBSD.org>
CommitDate: 2022-09-07 17:22:39 +0000

    games/devilutionX: fix build with SDL2 2.24.0
---
 games/devilutionX/Makefile                             |  2 +-
 games/devilutionX/files/patch-CMake_Dependencies.cmake | 13 +++++++++++++
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/games/devilutionX/Makefile b/games/devilutionX/Makefile
index 34dbef6b5bc7..afc2bf60c7fd 100644
--- a/games/devilutionX/Makefile
+++ b/games/devilutionX/Makefile
@@ -16,7 +16,7 @@ LIB_DEPENDS=	libfmt.so:devel/libfmt
 BUILD_DEPENDS=	${LOCALBASE}/include/SimpleIni.h:devel/simpleini
 
 USES=		cmake compiler:c++11-lang dos2unix gettext-tools pkgconfig sdl
-DOS2UNIX_GLOB=	*.cpp *.h CMakeLists.txt
+DOS2UNIX_GLOB=	*.cpp *.h CMakeLists.txt Dependencies.cmake
 USE_GITHUB=	yes
 GH_ACCOUNT=	diasurgical
 GH_TUPLE=	diasurgical:libsmackerdec:2997ee0e41e91bb723003bc09234be553b190e38:libsmackerdec/_deps/libsmackerdec-src \
diff --git a/games/devilutionX/files/patch-CMake_Dependencies.cmake b/games/devilutionX/files/patch-CMake_Dependencies.cmake
new file mode 100644
index 000000000000..b5916c37a486
--- /dev/null
+++ b/games/devilutionX/files/patch-CMake_Dependencies.cmake
@@ -0,0 +1,13 @@
+--- CMake/Dependencies.cmake.orig	2022-07-25 04:41:06 UTC
++++ CMake/Dependencies.cmake
+@@ -31,7 +31,9 @@ else()
+   if(DEVILUTIONX_SYSTEM_SDL2)
+     find_package(SDL2 REQUIRED)
+     if(TARGET SDL2::SDL2)
+-      set(SDL2_MAIN SDL2::SDL2main)
++      if(TARGET SDL2::SDL2main)
++        set(SDL2_MAIN SDL2::SDL2main)
++      endif()
+     elseif(TARGET SDL2::SDL2-static)
+       # On some distros, such as vitasdk, only the SDL2::SDL2-static target is available.
+       # Alias to SDL2::SDL2 because some finder scripts may refer to SDL2::SDL2.