git: 43ea5b171928 - main - games/stratagus: update 3.2.0 → 3.3.1

From: Dmitry Marakasov <amdmi3_at_FreeBSD.org>
Date: Wed, 31 Aug 2022 11:23:53 UTC
The branch main has been updated by amdmi3:

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

commit 43ea5b1719282d1066794067392f2eaf10d31ef2
Author:     Dmitry Marakasov <amdmi3@FreeBSD.org>
AuthorDate: 2022-08-31 11:13:48 +0000
Commit:     Dmitry Marakasov <amdmi3@FreeBSD.org>
CommitDate: 2022-08-31 11:23:41 +0000

    games/stratagus: update 3.2.0 → 3.3.1
---
 games/stratagus/Makefile                           | 28 +++++------
 games/stratagus/distinfo                           |  6 +--
 games/stratagus/files/patch-CMakeLists.txt         | 56 ++++++++++++++++++++--
 .../stratagus/files/patch-src_stratagus_iolib.cpp  | 10 ++++
 4 files changed, 76 insertions(+), 24 deletions(-)

diff --git a/games/stratagus/Makefile b/games/stratagus/Makefile
index 3796471d3c10..d4fa68c3e245 100644
--- a/games/stratagus/Makefile
+++ b/games/stratagus/Makefile
@@ -1,5 +1,5 @@
 PORTNAME=	stratagus
-PORTVERSION=	3.2.0
+PORTVERSION=	3.3.1
 DISTVERSIONPREFIX=	v
 CATEGORIES=	games
 
@@ -16,7 +16,7 @@ RUN_DEPENDS=	zenity:x11/zenity
 USE_GITHUB=	yes
 GH_ACCOUNT=	Wargus
 
-USES=		cmake lua:51 pkgconfig sdl
+USES=		cmake compiler:c++17-lang lua:51 pkgconfig sdl
 USE_SDL=	sdl2 mixer2 image2
 CMAKE_ARGS=	-DGAMEDIR:STRING="bin" \
 		-DTOLUA++_APP:STRING="tolua++-${LUA_VER}" \
@@ -27,8 +27,12 @@ CMAKE_OFF=	WITH_STACKTRACE  # not in ports
 
 PORTDOCS=	*
 
-OPTIONS_DEFINE=	MNG THEORA VORBIS DOCS
+OPTIONS_DEFINE=	MNG THEORA VORBIS EAGER_LOAD DOCS
 OPTIONS_DEFAULT=MNG THEORA VORBIS
+.if exists(/usr/include/omp.h)
+OPTIONS_DEFINE+=OPENMP
+OPTIONS_DEFAULT+=OPENMP
+.endif
 
 MNG_DESC=		MNG image library support
 MNG_LIB_DEPENDS=	libmng.so:graphics/libmng
@@ -36,23 +40,15 @@ MNG_CMAKE_BOOL=		WITH_MNG
 
 THEORA_LIB_DEPENDS=	libtheora.so:multimedia/libtheora
 THEORA_CMAKE_BOOL=	WITH_THEORA
-# XXX: does not build otherwise, remove after upstream bug is fixed: https://github.com/Wargus/stratagus/issues/396
-THEORA_IMPLIES=		VORBIS
+THEORA_IMPLIES=		VORBIS  # https://github.com/Wargus/stratagus/issues/396
 
 VORBIS_LIB_DEPENDS=	libvorbis.so:audio/libvorbis \
 			libogg.so:audio/libogg
 VORBIS_CMAKE_BOOL=	WITH_OGGVORBIS
 
-.if !exists(/usr/include/omp.h)
-USES+=		compiler:gcc-c++11-lib
-.else
-USES+=		compiler:c++17-lang
-.endif
-
-.include <bsd.port.pre.mk>
+EAGER_LOAD_DESC=	Load all game data at startup (more memory, less stutter)
+EAGER_LOAD_CMAKE_BOOL=	EAGER_LOAD
 
-.if ${CHOSEN_COMPILER_TYPE} == clang
-CXXFLAGS+=	-Wno-register  # incompatible code included from lcms
-.endif
+OPENMP_CMAKE_BOOL=	WITH_OPENMP
 
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
diff --git a/games/stratagus/distinfo b/games/stratagus/distinfo
index 4d274b5e6812..f7535161cea9 100644
--- a/games/stratagus/distinfo
+++ b/games/stratagus/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1640690292
-SHA256 (Wargus-stratagus-v3.2.0_GH0.tar.gz) = 6fef6934714b80fabd61fde97cff5f0918a20ca490fcff7adbcebc3e899a8bee
-SIZE (Wargus-stratagus-v3.2.0_GH0.tar.gz) = 1537172
+TIMESTAMP = 1660165973
+SHA256 (Wargus-stratagus-v3.3.1_GH0.tar.gz) = 66fe57e59a1dddf6a1d4f4ecf0db3841e0c7401dacefd6d9a1cee273cd7bdbd7
+SIZE (Wargus-stratagus-v3.3.1_GH0.tar.gz) = 1582605
diff --git a/games/stratagus/files/patch-CMakeLists.txt b/games/stratagus/files/patch-CMakeLists.txt
index 0c1bc6f73b2f..7c0850bf2f87 100644
--- a/games/stratagus/files/patch-CMakeLists.txt
+++ b/games/stratagus/files/patch-CMakeLists.txt
@@ -1,20 +1,66 @@
---- CMakeLists.txt.orig	2021-12-24 20:26:54 UTC
+--- CMakeLists.txt.orig	2022-07-31 09:44:18 UTC
 +++ CMakeLists.txt
-@@ -1238,7 +1238,6 @@ endif()
- install(TARGETS stratagus DESTINATION ${GAMEDIR})
- install(TARGETS png2stratagus DESTINATION ${BINDIR})
+@@ -807,7 +807,7 @@ endif()
+ # Stratagus definitions
+ 
+ add_definitions(-DUSE_ZLIB -DPIXMAPS=\"${PIXMAPSDIRABS}\")
+-include_directories(${LUA_INCLUDE_DIR} ${SDL2_INCLUDE_DIR} ${SDL2_MIXER_INCLUDE_DIRS} ${SDL2_IMAGE_INCLUDE_DIRS} ${TOLUA++_INCLUDE_DIR} ${ZLIB_INCLUDE_DIRS})
++include_directories(SYSTEM ${LUA_INCLUDE_DIR} ${SDL2_INCLUDE_DIR} ${SDL2_MIXER_INCLUDE_DIRS} ${SDL2_IMAGE_INCLUDE_DIRS} ${TOLUA++_INCLUDE_DIR} ${ZLIB_INCLUDE_DIRS})
+ set(stratagus_LIBS ${stratagus_LIBS} ${LUA_LIBRARIES} ${SDL2_LIBRARY} ${SDL2_MIXER_LIBRARIES} ${SDL2_IMAGE_LIBRARIES} ${TOLUA++_LIBRARY} ${ZLIB_LIBRARIES})
+ 
+ if(WIN32 AND NOT ENABLE_STDIO_REDIRECT)
+@@ -816,13 +816,13 @@ endif()
+ 
+ if(WITH_BZIP2 AND BZIP2_FOUND)
+ 	add_definitions(-DUSE_BZ2LIB ${BZIP2_DEFINITIONS})
+-	include_directories(${BZIP2_INCLUDE_DIR})
++	include_directories(SYSTEM ${BZIP2_INCLUDE_DIR})
+ 	set(stratagus_LIBS ${stratagus_LIBS} ${BZIP2_LIBRARIES})
+ endif()
+ 
+ if(WITH_MNG AND MNG_FOUND)
+ 	add_definitions(-DUSE_MNG)
+-	include_directories(${MNG_INCLUDE_DIR})
++	include_directories(SYSTEM ${MNG_INCLUDE_DIR})
+ 	set(stratagus_LIBS ${stratagus_LIBS} ${MNG_LIBRARY})
+ 	if (MSVC)
+ 		include_directories(${JPEG_INCLUDE_DIR})
+@@ -832,13 +832,13 @@ endif()
+ 
+ if(WITH_OGGVORBIS AND OGGVORBIS_FOUND)
+ 	add_definitions(-DUSE_VORBIS)
+-	include_directories(${OGGVORBIS_INCLUDE_DIR})
++	include_directories(SYSTEM ${OGGVORBIS_INCLUDE_DIR})
+ 	set(stratagus_LIBS ${stratagus_LIBS} ${OGG_LIBRARY} ${VORBIS_LIBRARY})
+ endif()
+ 
+ if(WITH_THEORA AND THEORA_FOUND)
+ 	add_definitions(-DUSE_THEORA)
+-	include_directories(${THEORA_INCLUDE_DIR})
++	include_directories(SYSTEM ${THEORA_INCLUDE_DIR})
+ 	set(stratagus_LIBS ${stratagus_LIBS} ${THEORA_LIBRARY})
+ endif()
+ 
+@@ -1311,7 +1311,7 @@ if (WIN32)
+ 	install(TARGETS midiplayer DESTINATION ${GAMEDIR})
+ endif()
  
 -if(ENABLE_DOC AND DOXYGEN_FOUND)
  	install(FILES doc/stratagus.6 DESTINATION ${MANDIR})
++if(ENABLE_DOC)
  	install(FILES
  		doc/development.html
-@@ -1252,8 +1251,7 @@ if(ENABLE_DOC AND DOXYGEN_FOUND)
+@@ -1325,8 +1325,11 @@ if(ENABLE_DOC AND DOXYGEN_FOUND)
  		doc/README-SDL.txt
  		DESTINATION share/doc/stratagus
  	)
 -	install(DIRECTORY doc/graphics doc/scripts ${CMAKE_CURRENT_BINARY_DIR}/doxygen DESTINATION ${DOCDIR})
 -endif(ENABLE_DOC AND DOXYGEN_FOUND)
 +	install(DIRECTORY doc/graphics doc/scripts DESTINATION ${DOCDIR})
++	if(DOXYGEN_FOUND)
++		install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doxygen DESTINATION ${DOCDIR})
++	endif()
++endif()
  
  if(ENABLE_DEV)
  	install(FILES ${gameheaders_HDRS} DESTINATION ${STRATAGUS_HEADERS})
diff --git a/games/stratagus/files/patch-src_stratagus_iolib.cpp b/games/stratagus/files/patch-src_stratagus_iolib.cpp
new file mode 100644
index 000000000000..44ea1853f7a2
--- /dev/null
+++ b/games/stratagus/files/patch-src_stratagus_iolib.cpp
@@ -0,0 +1,10 @@
+--- src/stratagus/iolib.cpp.orig	2022-07-31 09:44:18 UTC
++++ src/stratagus/iolib.cpp
+@@ -47,6 +47,7 @@
+ #include "SDL.h"
+ 
+ #include <map>
++#include <unordered_map>
+ #include <stdarg.h>
+ #include <stdio.h>
+