git: 05b6fd6a751d - main - games/openage: games/openage: upgrade to v0.4.1

From: Thierry Thomas <thierry_at_FreeBSD.org>
Date: Thu, 20 Jan 2022 21:47:32 UTC
The branch main has been updated by thierry:

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

commit 05b6fd6a751dd7e9480d816bf176c4be22376ace
Author:     Thierry Thomas <thierry@FreeBSD.org>
AuthorDate: 2022-01-20 21:39:01 +0000
Commit:     Thierry Thomas <thierry@FreeBSD.org>
CommitDate: 2022-01-20 21:44:13 +0000

    games/openage: games/openage: upgrade to v0.4.1
    
    - release notes at <https://github.com/SFTtech/openage/releases/tag/v0.4.1>
    
    - also chase the upgrade of py-Pygments to 2.9, with a patch from upstream.
    
    PR:             257471
    Approved by:    freebsd (at) sysctl.cz (maintainer)
---
 games/openage/Makefile                             |  15 +--
 games/openage/distinfo                             |   8 +-
 games/openage/files/patch-buildsystem_pxdgen.py    |  23 ++++
 .../openage/files/patch-libopenage_CMakeLists.txt  | 125 +++++++++++----------
 games/openage/files/patch-openage_default__dirs.py |  10 +-
 games/openage/pkg-descr                            |   8 +-
 games/openage/pkg-plist                            |  15 ++-
 7 files changed, 120 insertions(+), 84 deletions(-)

diff --git a/games/openage/Makefile b/games/openage/Makefile
index 0aa19528262c..07fd3bf4bc06 100644
--- a/games/openage/Makefile
+++ b/games/openage/Makefile
@@ -1,13 +1,8 @@
 PORTNAME=	openage
 DISTVERSIONPREFIX=	v
-DISTVERSION=	0.3.0-1262
-DISTVERSIONSUFFIX=	-ga554ab49
-PORTREVISION=	5
+DISTVERSION=	0.4.1
 CATEGORIES=	games
 
-PATCH_SITES=	https://github.com/SFTtech/openage/commit/
-PATCHFILES=	663b1158018d839eb5cfed63f4b228c1590c6104.patch:-p1
-
 MAINTAINER=	freebsd@sysctl.cz
 COMMENT=	Free engine clone of the Genie Engine
 
@@ -32,8 +27,8 @@ RUN_DEPENDS=	${PYNUMPY} \
 		${PY_PILLOW} \
 		${PYTHON_PKGNAMEPREFIX}pygments>0:textproc/py-pygments@${PY_FLAVOR}
 
-USES=		cmake compiler:c++17-lang gl python:3.4+ qt:5 sdl shebangfix
-SHEBANG_FILES=	configure run.py buildsystem/cythonize.py
+USES=		cmake compiler:c++17-lang eigen:3 gl ncurses:base python:3.4+ qt:5 sdl shebangfix
+SHEBANG_FILES=	configure run.py.in buildsystem/cythonize.py
 USE_GITHUB=	yes
 GH_ACCOUNT=	SFTtech
 USE_SDL=	image2 sdl2
@@ -45,8 +40,8 @@ USE_LDCONFIG=	yes
 CMAKE_OFF=	WANT_BACKTRACE WANT_GPERFTOOLS_PROFILER WANT_INOTIFY
 CMAKE_ARGS=	-DGLOBAL_CONFIG_DIR:STRING=${ETCDIR}
 
-post-patch:
-	@${REINPLACE_CMD} -e 's|/usr/bin/env python3|${PYTHON_CMD}|' ${WRKSRC}/buildsystem/modules/FindPython.cmake
+pre-configure:
+	${REINPLACE_CMD} -e 's|python3|${PYTHON_CMD}|' ${WRKSRC}/openage/codegen/main.py
 
 post-install:
 	@${MKDIR} ${STAGEDIR}${PREFIX}/etc/openage
diff --git a/games/openage/distinfo b/games/openage/distinfo
index 7a103cee3b35..75018f680a67 100644
--- a/games/openage/distinfo
+++ b/games/openage/distinfo
@@ -1,5 +1,3 @@
-TIMESTAMP = 1586003415
-SHA256 (SFTtech-openage-v0.3.0-1262-ga554ab49_GH0.tar.gz) = a0c7de5b4a187fb991c4f3e560d80f1a7afc411812ab4d7ab49a63c61b446e29
-SIZE (SFTtech-openage-v0.3.0-1262-ga554ab49_GH0.tar.gz) = 2081730
-SHA256 (663b1158018d839eb5cfed63f4b228c1590c6104.patch) = defe0d166e0c70524b53ebaa61e6e220e7e1b6c569b3dd33088eb4d47bf8779a
-SIZE (663b1158018d839eb5cfed63f4b228c1590c6104.patch) = 1365
+TIMESTAMP = 1628960206
+SHA256 (SFTtech-openage-v0.4.1_GH0.tar.gz) = 9d83138cc0f544b0fae799f10cbbaec7671511f9600a869bdb755668db0e5ccf
+SIZE (SFTtech-openage-v0.4.1_GH0.tar.gz) = 2321890
diff --git a/games/openage/files/patch-buildsystem_pxdgen.py b/games/openage/files/patch-buildsystem_pxdgen.py
new file mode 100644
index 000000000000..645f3eb92dd7
--- /dev/null
+++ b/games/openage/files/patch-buildsystem_pxdgen.py
@@ -0,0 +1,23 @@
+--- buildsystem/pxdgen.py.orig	2020-08-15 10:50:07 UTC
++++ buildsystem/pxdgen.py
+@@ -23,6 +23,7 @@ class ParserError(Exception):
+     """
+     Represents a fatal parsing error in PXDGenerator.
+     """
++
+     def __init__(self, filename, lineno, message):
+         super().__init__("{}:{} {}".format(filename, lineno, message))
+ 
+@@ -218,8 +219,11 @@ class PXDGenerator:
+             return self.handle_token(token, val)
+ 
+         def handle_state_1(self, token, val, namespace_parts):
++            # Patch from upstream, commit 3aa91ea4d4a72a5f3b6f90ad0390b9e07de7aa77
+             # we're inside a namespace definition; expect Token.Name
+-            if token != Token.Name:
++            # TODO: pygments 2.9 correctly reports Token.Name.Namespace
++            #       we can require this version eventually and change the condition
++            if token not in Token.Name:
+                 raise self.parser_error(
+                     "expected identifier after 'namespace'")
+             namespace_parts.append(val)
diff --git a/games/openage/files/patch-libopenage_CMakeLists.txt b/games/openage/files/patch-libopenage_CMakeLists.txt
index a3e4cc3db316..cd4e8314d6e3 100644
--- a/games/openage/files/patch-libopenage_CMakeLists.txt
+++ b/games/openage/files/patch-libopenage_CMakeLists.txt
@@ -1,8 +1,8 @@
---- libopenage/CMakeLists.txt.orig	2018-07-14 15:12:15 UTC
+--- libopenage/CMakeLists.txt.orig	2020-08-15 10:50:07 UTC
 +++ libopenage/CMakeLists.txt
-@@ -86,13 +86,21 @@ if(MSVC)
+@@ -38,13 +38,21 @@ if(WIN32)
  endif()
- if(NOT APPLE AND NOT MSVC)
+ if(NOT APPLE AND NOT WIN32)
  	find_library(RT_LIB rt)
 -	if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
 -		find_library(EXECINFO_LIB execinfo)
@@ -16,17 +16,17 @@
 +   find_library(NYAN_LIBRARY NAMES "nyan" PATHS /usr/local/lib )
 +   list(APPEND CMAKE_REQUIRED_INCLUDES ${NYAN_INCLUDE_DIR})
 +   list(APPEND CMAKE_REQUIRED_LIBRARIES ${NYAN_LIBRARY})
-+
+ 
 +#    message(STATUS ${NYAN_INCLUDE_DIR})
 +#    message(STATUS ${NYAN_LIBRARY})
 +endif()
 +
- 
++
 +find_library(FONTCONFIG_LIB fontconfig)
  find_package(Freetype REQUIRED)
- find_package(OpenGL REQUIRED)
  find_package(PNG REQUIRED)
-@@ -115,74 +123,74 @@ endif()
+ find_package(SDL2 REQUIRED)
+@@ -70,78 +78,78 @@ endif()
  
  # first, try to locate nyan directly
  # this discovers the system package or the user-registry package
@@ -35,8 +35,12 @@
  
  # if this didn't work, we can download nyan like a git submodule.
  # this is the treeish to be checked out.
--set(nyan_clone_version origin/master)
-+#set(nyan_clone_version origin/master)
+-if(NOT DEFINED NYAN_CLONE_VERSION)
+-	set(NYAN_CLONE_VERSION origin/master)
+-endif()
++#if(NOT DEFINED NYAN_CLONE_VERSION)
++#	set(NYAN_CLONE_VERSION origin/master)
++#endif()
  
 -option(
 -	DOWNLOAD_NYAN
@@ -76,40 +80,6 @@
  # or if it was used before.
 -if((NOT nyan_FOUND AND DOWNLOAD_NYAN) OR FORCE_DOWNLOAD_NYAN)
 -	message(STATUS "Downloading nyan as submodule project...")
--
--	if(DISABLE_SUBPROJECT_UPDATES)
--		set(DISABLE_NYAN_UPDATES "DISABLE_UPDATES")
--	endif()
--
--	fetch_project(
--		NAME nyan
--		${DISABLE_NYAN_UPDATES}
--		GIT_REPOSITORY https://github.com/SFTtech/nyan
--		GIT_TAG ${nyan_clone_version}
--	)
--
--	# don't register nyan to the userpackage-repo!
--	set(REGISTER_USERPACKAGE OFF)
--	# don't generate the `doc` target again (name conflict!)
--	set(DOXYGEN_ENABLE OFF)
--
--	# register the targets
--	add_subdirectory(${nyan_SOURCE_DIR} ${nyan_BINARY_DIR})
--
--	message(STATUS "nyan processed successfully!")
--
--elseif(NOT nyan_FOUND)
--	message(FATAL_ERROR "
--  Could not find the cmake package configuration file \"nyanConfig.cmake\".
--  To find it, you have several options:
--  * If your distribution provides it, install \"nyan\" through the package manager.
--  * If you want openage to automatically download \"nyan\", append `-DDOWNLOAD_NYAN=YES` to the cmake invocation or use `./configure --download-nyan`.
--  * If you want to build nyan manually, follow the build instructions:
--      [[  doc/building.md#nyan-installation  ]]
--  * If you already built nyan but it still can't be found (cmake package repo fails):
--    * Try to set \"nyan_DIR\" to the nyan build directory (it contains nyanConfig.cmake)
--      either through:  \"./configure $youroptions -- -Dnyan_DIR=/home/dev/nyan/build\"
--      or:              \"cmake $yourotheroptions -Dnyan_DIR=/home/dev/nyan/build ..\"
 +#if((NOT nyan_FOUND AND DOWNLOAD_NYAN) OR FORCE_DOWNLOAD_NYAN)
 +#	message(STATUS "Downloading nyan as submodule project...")
 +#
@@ -121,7 +91,7 @@
 +#		NAME nyan
 +#		${DISABLE_NYAN_UPDATES}
 +#		GIT_REPOSITORY https://github.com/SFTtech/nyan
-+#		GIT_TAG ${nyan_clone_version}
++#		GIT_TAG ${NYAN_CLONE_VERSION}
 +#	)
 +#
 +#	# don't register nyan to the userpackage-repo!
@@ -133,11 +103,7 @@
 +#	add_subdirectory(${nyan_SOURCE_DIR} ${nyan_BINARY_DIR})
 +#
 +#	message(STATUS "nyan processed successfully!")
- 
--  In case of other problems, please try to figure them out (and tell us what you did).
--  Contact information is in README.md.
--")
--endif()
++#
 +#elseif(NOT nyan_FOUND)
 +#	message(FATAL_ERROR "
 +#  Could not find the cmake package configuration file \"nyanConfig.cmake\".
@@ -156,23 +122,64 @@
 +#")
 +#endif()
  
+-	if(DISABLE_SUBPROJECT_UPDATES)
+-		set(DISABLE_NYAN_UPDATES "DISABLE_UPDATES")
+-	endif()
+ 
+-	fetch_project(
+-		NAME nyan
+-		${DISABLE_NYAN_UPDATES}
+-		GIT_REPOSITORY https://github.com/SFTtech/nyan
+-		GIT_TAG ${NYAN_CLONE_VERSION}
+-	)
+-
+-	# don't register nyan to the userpackage-repo!
+-	set(REGISTER_USERPACKAGE OFF)
+-	# don't generate the `doc` target again (name conflict!)
+-	set(DOXYGEN_ENABLE OFF)
+-
+-	# register the targets
+-	add_subdirectory(${nyan_SOURCE_DIR} ${nyan_BINARY_DIR})
+-
+-	message(STATUS "nyan processed successfully!")
+-
+-elseif(NOT nyan_FOUND)
+-	message(FATAL_ERROR "
+-  Could not find the cmake package configuration file \"nyanConfig.cmake\".
+-  To find it, you have several options:
+-  * If your distribution provides it, install \"nyan\" through the package manager.
+-  * If you want openage to automatically download \"nyan\", append `-DDOWNLOAD_NYAN=YES` to the cmake invocation or use `./configure --download-nyan`.
+-  * If you want to build nyan manually, follow the build instructions:
+-      [[  doc/building.md#nyan-installation  ]]
+-  * If you already built nyan but it still can't be found (cmake package repo fails):
+-    * Try to set \"nyan_DIR\" to the nyan build directory (it contains nyanConfig.cmake)
+-      either through:  \"./configure $youroptions -- -Dnyan_DIR=/home/dev/nyan/build\"
+-      or:              \"cmake $yourotheroptions -Dnyan_DIR=/home/dev/nyan/build ..\"
+-
+-  In case of other problems, please try to figure them out (and tell us what you did).
+-  Contact information is in README.md.
+-")
+-endif()
+-
+-
+ ##################################################
+ # optional dependencies
  
- if(GCCBacktrace_FOUND)
-@@ -245,6 +253,7 @@ include_directories(
+@@ -264,6 +272,7 @@ target_include_directories(libopenage
  	${SDL2IMAGE_INCLUDE_DIRS}
  	${HarfBuzz_INCLUDE_DIRS}
  	${QTPLATFORM_INCLUDE_DIRS}
 +	${NYAN_INCLUDE_DIRS}
  )
  
- # link the executable to those libraries
-@@ -265,7 +274,8 @@ target_link_libraries(libopenage
- 		${RT_LIB}
- 		${OGG_LIB}
- 		${EXECINFO_LIB}
+ ##################################################
+@@ -274,7 +283,8 @@ target_include_directories(libopenage
+ target_link_libraries(libopenage
+ 	PRIVATE
+ 		Threads::Threads
 -		nyan::nyan
 +		${NYAN_LIBRARY}
 +#		nyan::nyan
- 
- 	# TODO: change to PUBLIC (or, alternatively, remove all keywords
- 	# of this type) when qt cmake scripts change declarations of the
+ 		Eigen3::Eigen
+ 		${PNG_LIBRARIES}
+ 		${OPUS_LIBRARIES}
diff --git a/games/openage/files/patch-openage_default__dirs.py b/games/openage/files/patch-openage_default__dirs.py
index c854e99323d1..c4eab7f570c7 100644
--- a/games/openage/files/patch-openage_default__dirs.py
+++ b/games/openage/files/patch-openage_default__dirs.py
@@ -1,4 +1,4 @@
---- openage/default_dirs.py.orig	2018-07-15 14:29:49 UTC
+--- openage/default_dirs.py.orig	2020-08-15 10:50:07 UTC
 +++ openage/default_dirs.py
 @@ -33,6 +33,14 @@ LINUX_DIRS = {
      "runtime_dir": ("XDG_RUNTIME_DIR", ("/run/user/$UID")),
@@ -15,13 +15,13 @@
  
  # Windows-specific paths
  WINDOWS_DIRS = {
-@@ -60,6 +68,9 @@ def get_dir(which):
+@@ -59,6 +67,9 @@ def get_dir(which):
+ 
      elif sys.platform.startswith("win32"):
          platform_table = WINDOWS_DIRS
- 
++
 +    elif sys.platform.startswith("freebsd"):
 +    	platform_table = FREEBSD_DIRS
-+
+ 
      else:
          raise Exception("unsupported platform: '%s'" % sys.platform)
- 
diff --git a/games/openage/pkg-descr b/games/openage/pkg-descr
index f99822111dad..7daa620b4b51 100644
--- a/games/openage/pkg-descr
+++ b/games/openage/pkg-descr
@@ -1,8 +1,8 @@
 Openage: a volunteer project to create a free engine clone of the Genie Engine
-used by Age of Empires, Age of Empires II (HD) and Star Wars: Galactic 
-Battlegrounds, comparable to projects like OpenMW, OpenRA, OpenTTD and 
-OpenRCT2. Openage uses the original game assets (such as sounds and graphics), 
-but (for obvious reasons) doesn't ship them. To play, you require an original 
+used by Age of Empires, Age of Empires II (HD) and Star Wars: Galactic
+Battlegrounds, comparable to projects like OpenMW, OpenRA, OpenTTD and
+OpenRCT2. Openage uses the original game assets (such as sounds and graphics),
+but (for obvious reasons) doesn't ship them. To play, you require an original
 AoE II : TC installation or AoE II: HD (installation via Wine).
 
 WWW: https://openage.sft.mx/
diff --git a/games/openage/pkg-plist b/games/openage/pkg-plist
index a68114d48af7..e838a0935031 100644
--- a/games/openage/pkg-plist
+++ b/games/openage/pkg-plist
@@ -1,5 +1,5 @@
-%%ETCDIR%%/keybinds.oac
 bin/openage
+%%ETCDIR%%/keybinds.oac
 lib/libopenage.so
 lib/libopenage.so.0
 %%PYTHON_SITELIBDIR%%/openage/__init__.py
@@ -144,6 +144,8 @@ lib/libopenage.so.0
 %%PYTHON_SITELIBDIR%%/openage/convert/singlefile.py
 %%PYTHON_SITELIBDIR%%/openage/convert/slp%%PYTHON_EXT_SUFFIX%%.so
 %%PYTHON_SITELIBDIR%%/openage/convert/slp_converter_pool.py
+%%PYTHON_SITELIBDIR%%/openage/convert/smp%%PYTHON_EXT_SUFFIX%%.so
+%%PYTHON_SITELIBDIR%%/openage/convert/smx%%PYTHON_EXT_SUFFIX%%.so
 %%PYTHON_SITELIBDIR%%/openage/convert/stringresource.py
 %%PYTHON_SITELIBDIR%%/openage/convert/texture.py
 %%PYTHON_SITELIBDIR%%/openage/cppinterface/__init__.py
@@ -161,7 +163,11 @@ lib/libopenage.so.0
 %%PYTHON_SITELIBDIR%%/openage/cvar/config_file.py
 %%PYTHON_SITELIBDIR%%/openage/cvar/cvar%%PYTHON_EXT_SUFFIX%%.so
 %%PYTHON_SITELIBDIR%%/openage/cvar/location.py
+%%PYTHON_SITELIBDIR%%/openage/cython_check%%PYTHON_EXT_SUFFIX%%.so
 %%PYTHON_SITELIBDIR%%/openage/default_dirs.py
+%%PYTHON_SITELIBDIR%%/openage/event/__init__.py
+%%PYTHON_SITELIBDIR%%/openage/event/__pycache__/__init__.cpython-%%PYTHON_SUFFIX%%.pyc
+%%PYTHON_SITELIBDIR%%/openage/event/demo%%PYTHON_EXT_SUFFIX%%.so
 %%PYTHON_SITELIBDIR%%/openage/game/__init__.py
 %%PYTHON_SITELIBDIR%%/openage/game/__pycache__/__init__.cpython-%%PYTHON_SUFFIX%%.pyc
 %%PYTHON_SITELIBDIR%%/openage/game/__pycache__/main.cpython-%%PYTHON_SUFFIX%%.pyc
@@ -172,6 +178,10 @@ lib/libopenage.so.0
 %%PYTHON_SITELIBDIR%%/openage/log/__pycache__/tests.cpython-%%PYTHON_SUFFIX%%.pyc
 %%PYTHON_SITELIBDIR%%/openage/log/log_cpp%%PYTHON_EXT_SUFFIX%%.so
 %%PYTHON_SITELIBDIR%%/openage/log/tests.py
+%%PYTHON_SITELIBDIR%%/openage/renderer/__init__.py
+%%PYTHON_SITELIBDIR%%/openage/renderer/__pycache__/__init__.cpython-%%PYTHON_SUFFIX%%.pyc
+%%PYTHON_SITELIBDIR%%/openage/renderer/renderer_cpp%%PYTHON_EXT_SUFFIX%%.so
+%%PYTHON_SITELIBDIR%%/openage/renderer/tests%%PYTHON_EXT_SUFFIX%%.so
 %%PYTHON_SITELIBDIR%%/openage/testing/__init__.py
 %%PYTHON_SITELIBDIR%%/openage/testing/__pycache__/__init__.cpython-%%PYTHON_SUFFIX%%.pyc
 %%PYTHON_SITELIBDIR%%/openage/testing/__pycache__/benchmark.cpython-%%PYTHON_SUFFIX%%.pyc
@@ -242,6 +252,9 @@ lib/libopenage.so.0
 %%PYTHON_SITELIBDIR%%/openage/util/struct.py
 %%PYTHON_SITELIBDIR%%/openage/util/system.py
 %%PYTHON_SITELIBDIR%%/openage/util/threading.py
+%%PYTHON_SITELIBDIR%%/openage/versions/__init__.py
+%%PYTHON_SITELIBDIR%%/openage/versions/__pycache__/__init__.cpython-%%PYTHON_SUFFIX%%.pyc
+%%PYTHON_SITELIBDIR%%/openage/versions/versions%%PYTHON_EXT_SUFFIX%%.so
 share/applications/openage.desktop
 %%DATADIR%%/banner.svg
 %%DATADIR%%/gaben.png