From cfbb908ce243d1bd9e2aedea968e330a214b1d21 Mon Sep 17 00:00:00 2001 From: bsdcode Date: Tue, 20 Feb 2024 12:54:28 +0100 Subject: [PATCH] games/gemrb: fix crash and improve port - use GCC (https://github.com/gemrb/gemrb/issues/1786) - add optional OpenGL and SDL2_mixer support - add disabled pixelscaling to screensize option - change GemRB.cfg into a proper conffile (remove from pkg-plist and annotate GemRB.cfg.sample with @sample) - fix and modernize pkg-message - use distfiles form GitHub instead of SourceForge - make PNG, OGG, TTF and OpenAL support optional - make optional demo assets also optional in the port - use compiler:c++11-lang - remove gnome and localbase uses - remove DOC_DIR and MAN_DIR from CMAKE_ARGS - set CMake options explicitly - use CMake options helpers for boolean options - organize options into AUDIO, RESOURCE and VIDEO groups git rm games/gemrb/files/patch-gemrb_plugins_TTFImporter_CMakeLists.txt git add games/gemrb/files/extra-patch-gemrb_plugins_TTFImporter_CMakeLists.txt --- games/gemrb/Makefile | 91 ++++++++++++++----- games/gemrb/distinfo | 8 +- ...-gemrb_plugins_TTFImporter_CMakeLists.txt} | 0 games/gemrb/files/pkg-message.in | 24 +++-- games/gemrb/pkg-plist | 16 ++-- 5 files changed, 100 insertions(+), 39 deletions(-) rename games/gemrb/files/{patch-gemrb_plugins_TTFImporter_CMakeLists.txt => extra-patch-gemrb_plugins_TTFImporter_CMakeLists.txt} (100%) diff --git a/games/gemrb/Makefile b/games/gemrb/Makefile index 14d06b5e93593..e78c7b2ec233d 100644 --- a/games/gemrb/Makefile +++ b/games/gemrb/Makefile @@ -1,8 +1,8 @@ -PORTNAME= gemrb -PORTVERSION= 0.9.2 -CATEGORIES= games emulators -MASTER_SITES= SF/${PORTNAME}/Releases/${PORTVERSION} -DISTNAME= ${PORTNAME}-${PORTVERSION}-sources +PORTNAME= gemrb +DISTVERSIONPREFIX= v +DISTVERSION= 0.9.2 +PORTREVISION= 1 +CATEGORIES= games emulators MAINTAINER= pkubaj@FreeBSD.org COMMENT= GemRB (Game engine made with preRendered Background) @@ -11,27 +11,76 @@ WWW= https://www.gemrb.org/ LICENSE= GPLv2+ LICENSE_FILE= ${WRKSRC}/COPYING -LIB_DEPENDS= libpng.so:graphics/png \ - libvorbis.so:audio/libvorbis \ - libfreetype.so:print/freetype2 - -USES= cmake compiler:c11 gnome iconv localbase openal:al,alut \ - python sdl shebangfix +USES= cmake compiler:c++11-lang iconv python sdl shebangfix SHEBANG_FILES= admin/extend2da.py -USE_SDL= sdl2 +USE_GCC= yes # https://github.com/gemrb/gemrb/issues/1786 +USE_GITHUB= yes USE_LDCONFIG= yes +USE_SDL= sdl2 + +CMAKE_ARGS= -DCMAKE_BUILD_TYPE=Release \ + -DHAVE_LDEXPF=1 \ + -DLAYOUT=fhs \ + -DPYTHON_VERSION=Auto \ + -DSANITIZE=None \ + -DSDL_BACKEND=SDL2 +CMAKE_OFF= DISABLE_WERROR \ + INSOURCEBUILD \ + STATIC_LINK \ + USE_LIBVLC \ + USE_SDL_CONTROLLER_API + +SUB_FILES= pkg-message + +OPTIONS_DEFINE= DOCS +OPTIONS_DEFAULT= DEMO FREETYPE OPENAL OPENGL PNG SDLMIXER VORBIS + +OPTIONS_GROUP= AUDIO RESOURCE VIDEO +OPTIONS_GROUP_AUDIO= OPENAL SDLMIXER +OPTIONS_GROUP_RESOURCE= DEMO FREETYPE PNG VORBIS +OPTIONS_GROUP_VIDEO= OPENGL RESIND + +OPTIONS_SUB= yes -OPTIONS_DEFINE= DOCS -OPTIONS_SUB= yes +DEMO_DESC= Optional demo assets +DEMO_GH_ACCOUNT= gemrb:demo +DEMO_GH_PROJECT= gemrb-assets:demo +DEMO_GH_TAGNAME= 5b5dcde:demo -CMAKE_ARGS= -DDOC_DIR="${DOCSDIR}" \ - -DMAN_DIR="${PREFIX}/share/man/man6/" \ - -DSDL_BACKEND=SDL2 \ - -DUSE_OPENAL=ON \ - -DUSE_LIBVLC=OFF \ - -DHAVE_LDEXPF=1 +FREETYPE_LIB_DEPENDS= libfreetype.so:print/freetype2 +FREETYPE_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-gemrb_plugins_TTFImporter_CMakeLists.txt +FREETYPE_CMAKE_BOOL= USE_FREETYPE + +OPENAL_USES= openal:al,alut +OPENAL_CMAKE_BOOL= USE_OPENAL + +OPENGL_USES= gl +OPENGL_USE= gl=egl +OPENGL_CMAKE_ON= -DOPENGL_BACKEND=OpenGL +OPENGL_CMAKE_OFF= -DOPENGL_BACKEND=None + +PNG_LIB_DEPENDS= libpng.so:graphics/png +PNG_CMAKE_BOOL= USE_PNG + +RESIND_DESC= Scale to screensize with pixelscaling +RESIND_CMAKE_BOOL= SDL_RESOLUTION_INDEPENDANCE + +SDLMIXER_DESC= Audio support via SDL_mixer +SDLMIXER_USE= sdl=mixer2 +SDLMIXER_CMAKE_BOOL= USE_SDLMIXER + +VORBIS_LIB_DEPENDS= libvorbis.so:audio/libvorbis +VORBIS_CMAKE_BOOL= USE_VORBIS PLIST_SUB= PORTVERSION=${PORTVERSION} -WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION} + +post-extract-DEMO-on: + ${MKDIR} ${WRKSRC}/demo/music/mx0100 + ${INSTALL_DATA} ${WRKSRC_demo}/demo/audio/whispers-seamless.ogg ${WRKSRC}/demo/music/mx0100/mx0100a.ogg + ${MKDIR} ${WRKSRC}/demo/music/theme + ${INSTALL_DATA} ${WRKSRC_demo}/demo/audio/themea.ogg ${WRKSRC}/demo/music/theme + +post-install: + ${RM} ${STAGEDIR}${ETCDIR}/GemRB.cfg .include diff --git a/games/gemrb/distinfo b/games/gemrb/distinfo index 0ae3e57419712..a80d2e1ab4dc0 100644 --- a/games/gemrb/distinfo +++ b/games/gemrb/distinfo @@ -1,3 +1,5 @@ -TIMESTAMP = 1705483350 -SHA256 (gemrb-0.9.2-sources.tar.gz) = 5206d7e3fee45d21030caac92bc799b12ec011f90e59d7408c4b0eb4a8330d40 -SIZE (gemrb-0.9.2-sources.tar.gz) = 16123769 +TIMESTAMP = 1708291230 +SHA256 (gemrb-gemrb-v0.9.2_GH0.tar.gz) = ea614c067483606dab680ab18cd50527f56803bd46e0888e3c786eec05d3bb7d +SIZE (gemrb-gemrb-v0.9.2_GH0.tar.gz) = 14327547 +SHA256 (gemrb-gemrb-assets-5b5dcde_GH0.tar.gz) = 3e180e3ae063651bfabaab5795a946183212fd451986e3f4cac9203278283d23 +SIZE (gemrb-gemrb-assets-5b5dcde_GH0.tar.gz) = 11161448 diff --git a/games/gemrb/files/patch-gemrb_plugins_TTFImporter_CMakeLists.txt b/games/gemrb/files/extra-patch-gemrb_plugins_TTFImporter_CMakeLists.txt similarity index 100% rename from games/gemrb/files/patch-gemrb_plugins_TTFImporter_CMakeLists.txt rename to games/gemrb/files/extra-patch-gemrb_plugins_TTFImporter_CMakeLists.txt diff --git a/games/gemrb/files/pkg-message.in b/games/gemrb/files/pkg-message.in index c58d42d857b14..26668d0faccbb 100644 --- a/games/gemrb/files/pkg-message.in +++ b/games/gemrb/files/pkg-message.in @@ -1,14 +1,24 @@ [ { type: install message: <