Warning: there may be occasional oddness due to css and blog edits. **remodel of posts done. Overhaul of pages (distilled) in progress 3/9
Showing posts with label minetest. Show all posts
Showing posts with label minetest. Show all posts

Sunday, November 3, 2024

Luanti minetest fallout

It had been mentioned long ago that minetest ought to change its name.  This was considered necessary for the minetest engine to be viewed apart from minetest the minecraft-esque game.  Distancing itself from a very specific type of voxel game would allow for the engine to be used for a greater variety of game development using the engine, much like godot and others.  The change to the name of the executable, and all references to it in most places in the code and supporting files, and the eventual switch to a git repo with its name cause a lot of upheaval.

The new name for the engine is Luanti, is a sensible and meaningful name even if some won't change their thinking of it and may continue to refer to it as minetest.  Many paths once had a minetest directory, many files installed either had minetest in their name or were placed in one of those directories.  What I had to change over a few days and a few upstream commits included the pkg-plist and some lines in the Makefile.  I had to test numerous times, after each change to be sure everything was done accurately.  At present, the upstream git repo is not yet luanti-org/luanti, but it may change in time from what is now minetest/minetest.

The Makefile adjustments below took more time to test than to edit of course because I had to attempt to build and then check what the pkg-plist that was generated looked like.
diff -y -W 200 ./Makefile ../minetest-dev/Makefile | more

diff
# PORTNAME block											# PORTNAME block
PORTNAME=		luanti									   |	PORTNAME=		minetest
DISTVERSION=	g20241102									   |	DISTVERSION=	g20241026
CATEGORIES=		games										CATEGORIES=		games
MASTER_SITES=	GH											MASTER_SITES=	GH
PKGNAMESUFFIX=	-dev											PKGNAMESUFFIX=	-dev
DISTNAME=		${PORTNAME}-${GH_TAGNAME}							DISTNAME=		${PORTNAME}-${GH_TAGNAME}
DIST_SUBDIR=	${PORTNAME}${PKGNAMESUFFIX}								DIST_SUBDIR=	${PORTNAME}${PKGNAMESUFFIX}

# Maintainer block											# Maintainer block
MAINTAINER=		nope@nothere									MAINTAINER=		nope@nothere
COMMENT=		Near-infinite-world block sandbox game						COMMENT=		Near-infinite-world block sandbox game
WWW=			https://www.minetest.net/							WWW=			https://www.minetest.net/

# License block												# License block
LICENSE=		LGPL21+										LICENSE=		LGPL21+

# dependencies												# dependencies
LIB_DEPENDS=	libzstd.so:archivers/zstd \								LIB_DEPENDS=	libzstd.so:archivers/zstd \
				libfreetype.so:print/freetype2										libfreetype.so:print/freetype2

# uses block												# uses block
USES=			cmake iconv:wchar_t sqlite ninja:make pkgconfig:build				USES=			cmake iconv:wchar_t sqlite ninja:make pkgconfig:build
USE_GITHUB=		nodefault								   |	USE_GITHUB=     nodefault
GH_ACCOUNT=		minetest #GH_ACCOUNT=		luanti-org				   |	GH_ACCOUNT=     minetest
GH_PROJECT=		minetest #GH_PROJECT=		luanti					   |	GH_PROJECT=     minetest
GH_TAGNAME=		e952a0807b85e089eaa320cfeb09e33816d141ed				   |	GH_TAGNAME=		b7073df68cc9ca89e62a2b97c5fbb23cd1454bdf

# uses=cmake related variables										# uses=cmake related variables
CMAKE_ARGS=		-DCMAKE_BUILD_TYPE="MinSizeRel" \						CMAKE_ARGS=		-DCMAKE_BUILD_TYPE="MinSizeRel" \
				-DCUSTOM_EXAMPLE_CONF_DIR="${PREFIX}/etc" \								-DCUSTOM_EXAMPLE_CONF_DIR="${PREFIX}/etc" \
				-DCMAKE_CXX_FLAGS="-stdlib=libc++"									-DCMAKE_CXX_FLAGS="-stdlib=libc++"
#				-DCMAKE_FETCHCONTENT_FULLY_DISCONNECTED="FALSE"				#				-DCMAKE_FETCHCONTENT_FULLY_DISCONNECTED="FALSE"

# conflicts												# conflicts
CONFLICTS=		minetest irrlichtMt minetest-dev irrlicht-minetest			   |	CONFLICTS=		minetest irrlichtMt irrlicht-minetest

# wrksrc block												# wrksrc block
WRKSRC=			${WRKDIR}/minetest-${GH_TAGNAME} #WRKSRC=			${WRKDIR   |	WRKSRC=			${WRKDIR}/${PORTNAME}-${GH_TAGNAME}

# packaging list block											# packaging list block
#DOCS=		*											#DOCS=		*
#PORTDATA=		*										#PORTDATA=		*

# options definitions											# options definitions
OPTIONS_DEFAULT=			CURL DOCS LTO SOUND SPATIAL SYSTEM_LUAJIT SYSTEM_FONTS S	OPTIONS_DEFAULT=			CURL DOCS LTO SOUND SPATIAL SYSTEM_LUAJIT SYSTEM_FONTS S
OPTIONS_GROUP=				BUILD DATABASE MISC NEEDS SYSTEM				OPTIONS_GROUP=				BUILD DATABASE MISC NEEDS SYSTEM
OPTIONS_GROUP_BUILD=		BENCHMARKS DEVTEST DOCS NCURSES PROFILING PROMETHEUS UNITTESTS #	OPTIONS_GROUP_BUILD=		BENCHMARKS DEVTEST DOCS NCURSES PROFILING PROMETHEUS UNITTESTS #
OPTIONS_GROUP_DATABASE=		LEVELDB PGSQL REDIS							OPTIONS_GROUP_DATABASE=		LEVELDB PGSQL REDIS
OPTIONS_GROUP_MISC=			LTO								OPTIONS_GROUP_MISC=			LTO
OPTIONS_GROUP_NEEDS=		CURL NLS SOUND SPATIAL							OPTIONS_GROUP_NEEDS=		CURL NLS SOUND SPATIAL
OPTIONS_GROUP_SYSTEM=		SYSTEM_FONTS SYSTEM_GMP SYSTEM_JSONCPP SYSTEM_LUAJIT			OPTIONS_GROUP_SYSTEM=		SYSTEM_FONTS SYSTEM_GMP SYSTEM_JSONCPP SYSTEM_LUAJIT
OPTIONS_MULTI=				SOFTWARE							OPTIONS_MULTI=				SOFTWARE
OPTIONS_MULTI_SOFTWARE=		CLIENT SERVER								OPTIONS_MULTI_SOFTWARE=		CLIENT SERVER
OPTIONS_SINGLE=				GRAPHICS							OPTIONS_SINGLE=				GRAPHICS
OPTIONS_SINGLE_GRAPHICS=	GLES1 GLES2 OPENGL OPENGL3						OPTIONS_SINGLE_GRAPHICS=	GLES1 GLES2 OPENGL OPENGL3
OPTIONS_SUB=				yes								OPTIONS_SUB=				yes

# options descriptions											# options descriptions
BENCHMARKS_DESC=			Build benchmarks (Adds some benchmark chat commands)		BENCHMARKS_DESC=			Build benchmarks (Adds some benchmark chat commands)
BUILD_DESC=					Admin/Dev needs						BUILD_DESC=					Admin/Dev needs
CLIENT_DESC=				Build client, add graphics and sdl2 support, dependencie	CLIENT_DESC=				Build client, add graphics and sdl2 support, dependencie
CURL_DESC=					Enable cURL support for fetching media: contentd	CURL_DESC=					Enable cURL support for fetching media: contentd
DATABASE_DESC=				Database support						DATABASE_DESC=				Database support
DEVTEST_DESC=				Install Development Test game also (INSTALL_DEVTEST)		DEVTEST_DESC=				Install Development Test game also (INSTALL_DEVTEST)
DOCS_DESC=					Build and install documentation (via doxygen)		DOCS_DESC=					Build and install documentation (via doxygen)
#GITTRACY_DESC=				Fetch Tracy git tag --build fails-- --purpose uncertain-	#GITTRACY_DESC=				Fetch Tracy git tag --build fails-- --purpose uncertain-
GLES1_DESC=					Enable OpenGL ES driver, legacy				GLES1_DESC=					Enable OpenGL ES driver, legacy
GLES2_DESC=					Enable OpenGL ES 2+ driver				GLES2_DESC=					Enable OpenGL ES 2+ driver
GRAPHICS_DESC=				Graphics support						GRAPHICS_DESC=				Graphics support
LEVELDB_DESC=				Enable LevelDB backend --broken - build fails--			LEVELDB_DESC=				Enable LevelDB backend --broken - build fails--
LTO_DESC=					Build with IPO/LTO optimizations (smaller and mo	LTO_DESC=					Build with IPO/LTO optimizations (smaller and mo
MISC_DESC=					Other options						MISC_DESC=					Other options
NCURSES_DESC=				Enables server side terminal (cli option: --terminal) (E	NCURSES_DESC=				Enables server side terminal (cli option: --terminal) (E
NEEDS_DESC=					Client essentials					NEEDS_DESC=					Client essentials
NLS_DESC=					Native Language Support (ENABLE_GETTEXT)		NLS_DESC=					Native Language Support (ENABLE_GETTEXT)
OPENGL3_DESC=				Enable OpenGL 3+ driver (likely needs sdl2 built with OP	OPENGL3_DESC=				Enable OpenGL 3+ driver (likely needs sdl2 built with OP
OPENGL_DESC=				Enable OpenGL driver						OPENGL_DESC=				Enable OpenGL driver
PGSQL_DESC=					Enable PostgreSQL map backend				PGSQL_DESC=					Enable PostgreSQL map backend
PROFILING_DESC=				Use gprof for profiling (USE_GPROF)				PROFILING_DESC=				Use gprof for profiling (USE_GPROF)
PROMETHEUS_DESC=			Build with Prometheus metrics exporter				PROMETHEUS_DESC=			Build with Prometheus metrics exporter
REDIS_DESC=					Enable Redis backend					REDIS_DESC=					Enable Redis backend
SERVER_DESC=				Build server							SERVER_DESC=				Build server
SOFTWARE_DESC=				Software components						SOFTWARE_DESC=				Software components
SOUND_DESC=					Enable sound via openal-soft				SOUND_DESC=					Enable sound via openal-soft
SPATIAL_DESC=				Enable SpatialIndex (Speeds up AreaStores)			SPATIAL_DESC=				Enable SpatialIndex (Speeds up AreaStores)
SYSTEM_DESC=				System subsitutes						SYSTEM_DESC=				System subsitutes
SYSTEM_FONTS_DESC=			Use or install default fonts from ports				SYSTEM_FONTS_DESC=			Use or install default fonts from ports
SYSTEM_GMP_DESC=			Use gmp from ports (ENABLE_SYSTEM_GMP)				SYSTEM_GMP_DESC=			Use gmp from ports (ENABLE_SYSTEM_GMP)
SYSTEM_JSONCPP_DESC=		Use jsoncpp from ports (ENABLE_SYSTEM_JSONCPP)				SYSTEM_JSONCPP_DESC=		Use jsoncpp from ports (ENABLE_SYSTEM_JSONCPP)
SYSTEM_LUAJIT_DESC=			Use or install luajit from ports (instead of bundled lua	SYSTEM_LUAJIT_DESC=			Use or install luajit from ports (instead of bundled lua
#TRACY_DESC=					Build with Tracy frame and sampling profiler --b	#TRACY_DESC=					Build with Tracy frame and sampling profiler --b
UNITTESTS_DESC=				Build unit test sources (BUILD_UNITTESTS)			UNITTESTS_DESC=				Build unit test sources (BUILD_UNITTESTS)

# options helpers											# options helpers
BENCHMARKS_CMAKE_BOOL=		BUILD_BENCHMARKS							BENCHMARKS_CMAKE_BOOL=		BUILD_BENCHMARKS
#TRACY_BUILD_DEPENDS=		tracy>0:devel/tracy							#TRACY_BUILD_DEPENDS=		tracy>0:devel/tracy
#TRACY_CMAKE_BOOL=			BUILD_WITH_TRACY						#TRACY_CMAKE_BOOL=			BUILD_WITH_TRACY
CLIENT_LIB_DEPENDS=			libpng16.so:graphics/png					CLIENT_LIB_DEPENDS=			libpng16.so:graphics/png
CLIENT_USES=				gl xorg jpeg sdl						CLIENT_USES=				gl xorg jpeg sdl
CLIENT_USE=	\											CLIENT_USE=	\
							GL=glu \												GL=glu \
							SDL=sdl2,ttf2 \												SDL=sdl2,ttf2 \
							XORG=ice,sm,x11,xext,xcb,xres,xshmfence,								XORG=ice,sm,x11,xext,xcb,xres,xshmfence,
							xfixes,xft,xinerama,xkbfile,xmu,xpm,xran								xfixes,xft,xinerama,xkbfile,xmu,xpm,xran

CLIENT_CMAKE_BOOL=			BUILD_CLIENT							CLIENT_CMAKE_BOOL=			BUILD_CLIENT
CURL_LIB_DEPENDS=			libcurl.so:ftp/curl						CURL_LIB_DEPENDS=			libcurl.so:ftp/curl
CURL_CMAKE_BOOL=			ENABLE_CURL							CURL_CMAKE_BOOL=			ENABLE_CURL
DEVTEST_CMAKE_BOOL=			INSTALL_DEVTEST							DEVTEST_CMAKE_BOOL=			INSTALL_DEVTEST
DOCS_CMAKE_BOOL=			BUILD_DOCUMENTATION						DOCS_CMAKE_BOOL=			BUILD_DOCUMENTATION
GLES1_USE=					GL+=glesv1						GLES1_USE=					GL+=glesv1
GLES1_CMAKE_BOOL=			ENABLE_GLES1							GLES1_CMAKE_BOOL=			ENABLE_GLES1
GLES2_USE=					GL+=glesv2						GLES2_USE=					GL+=glesv2
GLES2_CMAKE_BOOL=			ENABLE_GLES2							GLES2_CMAKE_BOOL=			ENABLE_GLES2
LEVELDB_LIB_DEPENDS=		libleveldb.so:databases/leveldb						LEVELDB_LIB_DEPENDS=		libleveldb.so:databases/leveldb
LEVELDB_CMAKE_BOOL=			ENABLE_LEVELDB							LEVELDB_CMAKE_BOOL=			ENABLE_LEVELDB
LTO_CMAKE_BOOL=				ENABLE_LTO							LTO_CMAKE_BOOL=				ENABLE_LTO
NCURSES_USES=				ncurses								NCURSES_USES=				ncurses
NCURSES_CMAKE_BOOL=			ENABLE_CURSES							NCURSES_CMAKE_BOOL=			ENABLE_CURSES
NLS_USES=					gettext							NLS_USES=					gettext
NLS_CMAKE_BOOL=				ENABLE_GETTEXT							NLS_CMAKE_BOOL=				ENABLE_GETTEXT
NLS_LDFLAGS=				-L${LOCALBASE}/lib						NLS_LDFLAGS=				-L${LOCALBASE}/lib
OPENGL3_USE=				GL+=gl								OPENGL3_USE=				GL+=gl
OPENGL3_CMAKE_BOOL=			ENABLE_OPENGL3							OPENGL3_CMAKE_BOOL=			ENABLE_OPENGL3
OPENGL_USE=					GL+=gl							OPENGL_USE=					GL+=gl
OPENGL_CMAKE_BOOL=			ENABLE_OPENGL							OPENGL_CMAKE_BOOL=			ENABLE_OPENGL
PGSQL_USES=					pgsql							PGSQL_USES=					pgsql
PGSQL_CMAKE_BOOL=			ENABLE_POSTGRESQL						PGSQL_CMAKE_BOOL=			ENABLE_POSTGRESQL
PROFILING_CMAKE_BOOL=		USE_GPROF								PROFILING_CMAKE_BOOL=		USE_GPROF
PROMETHEUS_CMAKE_BOOL=		ENABLE_PROMETHEUS							PROMETHEUS_CMAKE_BOOL=		ENABLE_PROMETHEUS
REDIS_LIB_DEPENDS=			libhiredis.so:databases/hiredis					REDIS_LIB_DEPENDS=			libhiredis.so:databases/hiredis
REDIS_CMAKE_BOOL=			ENABLE_REDIS							REDIS_CMAKE_BOOL=			ENABLE_REDIS
SERVER_CMAKE_BOOL=			BUILD_SERVER							SERVER_CMAKE_BOOL=			BUILD_SERVER
SOUND_CMAKE_BOOL=			ENABLE_SOUND							SOUND_CMAKE_BOOL=			ENABLE_SOUND
SPATIAL_LIB_DEPENDS=		libspatialindex.so:devel/spatialindex					SPATIAL_LIB_DEPENDS=		libspatialindex.so:devel/spatialindex
SPATIAL_CMAKE_BOOL=			ENABLE_SPATIAL							SPATIAL_CMAKE_BOOL=			ENABLE_SPATIAL
SYSTEM_FONTS_RUN_DEPENDS=	${LOCALBASE}/share/fonts/ChromeOS/Arimo-Bold.ttf:x11-fonts/crosc	SYSTEM_FONTS_RUN_DEPENDS=	${LOCALBASE}/share/fonts/ChromeOS/Arimo-Bold.ttf:x11-fonts/crosc
							${LOCALBASE}/share/fonts/Droid/DroidSans								${LOCALBASE}/share/fonts/Droid/DroidSans
SYSTEM_GMP_LIB_DEPENDS=		libgmp.so:math/gmp							SYSTEM_GMP_LIB_DEPENDS=		libgmp.so:math/gmp
SYSTEM_GMP_CMAKE_BOOL=		ENABLE_SYSTEM_GMP							SYSTEM_GMP_CMAKE_BOOL=		ENABLE_SYSTEM_GMP
SYSTEM_GMP_CMAKE_ON=		-DGMP_INCLUDE_DIR="${PREFIX}/include"					SYSTEM_GMP_CMAKE_ON=		-DGMP_INCLUDE_DIR="${PREFIX}/include"
SYSTEM_JSONCPP_LIB_DEPENDS=	libjsoncpp.so:devel/jsoncpp						SYSTEM_JSONCPP_LIB_DEPENDS=	libjsoncpp.so:devel/jsoncpp
SYSTEM_JSONCPP_CMAKE_BOOL=	ENABLE_SYSTEM_JSONCPP							SYSTEM_JSONCPP_CMAKE_BOOL=	ENABLE_SYSTEM_JSONCPP
SYSTEM_JSONCPP_CMAKE_ON=	-DJSON_INCLUDE_DIR="${PREFIX}/include/jsoncpp"				SYSTEM_JSONCPP_CMAKE_ON=	-DJSON_INCLUDE_DIR="${PREFIX}/include/jsoncpp"
SYSTEM_LUAJIT_USES=			luajit								SYSTEM_LUAJIT_USES=			luajit
SYSTEM_LUAJIT_USE=			luajit								SYSTEM_LUAJIT_USE=			luajit
#SYSTEM_LUAJIT_CMAKE_BOOL=	ENABLE_LUAJIT # Redundant as one of the above includes this		#SYSTEM_LUAJIT_CMAKE_BOOL=	ENABLE_LUAJIT # Redundant as one of the above includes this
UNITTESTS_CMAKE_BOOL=		BUILD_UNITTESTS								UNITTESTS_CMAKE_BOOL=		BUILD_UNITTESTS

.include <bsd.port.options.mk>										.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MCLIENT} && ${PORT_OPTIONS:MSYSTEM_LUAJIT}						.if ${PORT_OPTIONS:MCLIENT} && ${PORT_OPTIONS:MSYSTEM_LUAJIT}
CMAKE_ARGS+=	-DENABLE_LUAJIT="ON" \									CMAKE_ARGS+=	-DENABLE_LUAJIT="ON" \
				-DREQUIRE_LUAJIT="ON"											-DREQUIRE_LUAJIT="ON"
.endif													.endif

# It used to be such that <OPTION>_USE= GL+=gl,opengl would satisfy, but `make test` does not ag	# It used to be such that <OPTION>_USE= GL+=gl,opengl would satisfy, but `make test` does not ag
.if ${PORT_OPTIONS:MCLIENT} && ${PORT_OPTIONS:MOPENGL}							.if ${PORT_OPTIONS:MCLIENT} && ${PORT_OPTIONS:MOPENGL}
USE_GL+=		glu opengl									USE_GL+=		glu opengl
USE_XORG+=		xi										USE_XORG+=		xi
.endif													.endif

.if ${PORT_OPTIONS:MCLIENT}										.if ${PORT_OPTIONS:MCLIENT}
USE_GL+=		gl										USE_GL+=		gl
.endif													.endif

.if ${PORT_OPTIONS:MCLIENT} && ${PORT_OPTIONS:MSOUND}							.if ${PORT_OPTIONS:MCLIENT} && ${PORT_OPTIONS:MSOUND}
USES+=			openal										USES+=			openal
LIB_DEPENDS+=	libogg.so:audio/libogg libvorbisfile.so:audio/libvorbis					LIB_DEPENDS+=	libogg.so:audio/libogg libvorbisfile.so:audio/libvorbis
.endif													.endif

.if ${PORT_OPTIONS:MSERVER}										.if ${PORT_OPTIONS:MSERVER}
USE_RC_SUBR=	${PORTNAME}									   |	USE_RC_SUBR=	minetest
# When the official /usr/ports/GIDs file is changed, this may be luanti instead of minetest.	   |	USERS=			minetest
# At that time the files/luanti.in will need to be modified for the user and group defined.	   |	GROUPS=			minetest
USERS=			minetest #USERS=			${PORTNAME}			   <
GROUPS=			minetest #GROUPS=		${PORTNAME}				   <
.endif													.endif

# Exactly why this must be done this way eludes me but this works and satisfies the install need	# Exactly why this must be done this way eludes me but this works and satisfies the install need
.if ${PORT_OPTIONS:MSYSTEM_FONTS}									.if ${PORT_OPTIONS:MSYSTEM_FONTS}
pre-install:												pre-install:
	${RM} ${LOCALBASE}/share/luanti/fonts/Arimo-Bold.ttf					   |		${RM} ${LOCALBASE}/share/minetest/fonts/Arimo-Bold.ttf
	${RM} ${LOCALBASE}/share/luanti/fonts/Arimo-BoldItalic.ttf				   |		${RM} ${LOCALBASE}/share/minetest/fonts/Arimo-BoldItalic.ttf
	${RM} ${LOCALBASE}/share/luanti/fonts/Arimo-Italic.ttf					   |		${RM} ${LOCALBASE}/share/minetest/fonts/Arimo-Italic.ttf
	${RM} ${LOCALBASE}/share/luanti/fonts/Cousine-Bold.ttf					   |		${RM} ${LOCALBASE}/share/minetest/fonts/Cousine-Bold.ttf
	${RM} ${LOCALBASE}/share/luanti/fonts/Cousine-BoldItalic.ttf				   |		${RM} ${LOCALBASE}/share/minetest/fonts/Cousine-BoldItalic.ttf
	${RM} ${LOCALBASE}/share/luanti/fonts/Cousine-Italic.ttf				   |		${RM} ${LOCALBASE}/share/minetest/fonts/Cousine-Italic.ttf
	${RM} ${LOCALBASE}/share/luanti/fonts/Cousine-Regular.ttf				   |		${RM} ${LOCALBASE}/share/minetest/fonts/Cousine-Regular.ttf
	${RM} ${LOCALBASE}/share/luanti/fonts/DroidSansFallbackFull.ttf				   |		${RM} ${LOCALBASE}/share/minetest/fonts/DroidSansFallbackFull.ttf
	${MKDIR} ${LOCALBASE}/share/luanti/fonts						   |		${MKDIR} ${LOCALBASE}/share/minetest/fonts
	${LN} -s ${LOCALBASE}/share/fonts/ChromeOS/Arimo-Bold.ttf ${LOCALBASE}/share/luanti/font   |		${LN} -s ${LOCALBASE}/share/fonts/ChromeOS/Arimo-Bold.ttf ${LOCALBASE}/share/minetest/fo
	${LN} -s ${LOCALBASE}/share/fonts/ChromeOS/Arimo-BoldItalic.ttf ${LOCALBASE}/share/luant   |		${LN} -s ${LOCALBASE}/share/fonts/ChromeOS/Arimo-BoldItalic.ttf ${LOCALBASE}/share/minet
	${LN} -s ${LOCALBASE}/share/fonts/ChromeOS/Arimo-Italic.ttf ${LOCALBASE}/share/luanti/fo   |		${LN} -s ${LOCALBASE}/share/fonts/ChromeOS/Arimo-Italic.ttf ${LOCALBASE}/share/minetest/
	${LN} -s ${LOCALBASE}/share/fonts/ChromeOS/Cousine-Bold.ttf ${LOCALBASE}/share/luanti/fo   |		${LN} -s ${LOCALBASE}/share/fonts/ChromeOS/Cousine-Bold.ttf ${LOCALBASE}/share/minetest/
	${LN} -s ${LOCALBASE}/share/fonts/ChromeOS/Cousine-BoldItalic.ttf ${LOCALBASE}/share/lua   |		${LN} -s ${LOCALBASE}/share/fonts/ChromeOS/Cousine-BoldItalic.ttf ${LOCALBASE}/share/min
	${LN} -s ${LOCALBASE}/share/fonts/ChromeOS/Cousine-Italic.ttf ${LOCALBASE}/share/luanti/   |		${LN} -s ${LOCALBASE}/share/fonts/ChromeOS/Cousine-Italic.ttf ${LOCALBASE}/share/minetes
	${LN} -s ${LOCALBASE}/share/fonts/ChromeOS/Cousine-Regular.ttf ${LOCALBASE}/share/luanti   |		${LN} -s ${LOCALBASE}/share/fonts/ChromeOS/Cousine-Regular.ttf ${LOCALBASE}/share/minete
	${LN} -s ${LOCALBASE}/share/fonts/Droid/DroidSansFallbackFull.ttf ${LOCALBASE}/share/lua   |		${LN} -s ${LOCALBASE}/share/fonts/Droid/DroidSansFallbackFull.ttf ${LOCALBASE}/share/min
.endif													.endif
												   <
# These are temporary links which might only be useful for transition and a blind update, when u   <
post-stage:											   <
	${RM} ${STAGEDIR}${LOCALBASE}/bin/minetest						   <
	${RM} ${STAGEDIR}${LOCALBASE}/bin/minetestserver					   <
												   <

post-install:												post-install:
	@${ECHO_MSG} " "											@${ECHO_MSG} " "
	@${ECHO_MSG} "-->  "${PREFIX}/etc/"minetest.conf.example explains options and gives thei		@${ECHO_MSG} "-->  "${PREFIX}/etc/"minetest.conf.example explains options and gives thei
	@${ECHO_MSG} " "											@${ECHO_MSG} " "
	@${ECHO_MSG} "-->  Local network issues could cause singleplayer to fail. "				@${ECHO_MSG} "-->  Local network issues could cause singleplayer to fail. "
	@${ECHO_MSG} " "											@${ECHO_MSG} " "
	@${ECHO_MSG} "-->  Alternate graphics driver may be set in client config, must be set to		@${ECHO_MSG} "-->  Alternate graphics driver may be set in client config, must be set to
	@${ECHO_MSG} "     -- One in minetest config, opengles likely needs sdl option built wit		@${ECHO_MSG} "     -- One in minetest config, opengles likely needs sdl option built wit
	@${ECHO_MSG} " "											@${ECHO_MSG} " "
	@${ECHO_MSG} " "											@${ECHO_MSG} " "

#----------------------------------------------------------------------					#----------------------------------------------------------------------
# Warning: you might not need LIB_DEPENDS on libGL.so							# Warning: you might not need LIB_DEPENDS on libGL.so
# Warning: you might not need LIB_DEPENDS on libSDL2.so							# Warning: you might not need LIB_DEPENDS on libSDL2.so
# Warning: you might not need LIB_DEPENDS on libSDL2_ttf.so						# Warning: you might not need LIB_DEPENDS on libSDL2_ttf.so
# Warning: you might not need LIB_DEPENDS on libopenal.so.1						# Warning: you might not need LIB_DEPENDS on libopenal.so.1
#----------------------------------------------------------------------					#----------------------------------------------------------------------
#----------------------------------------------------------------------					#----------------------------------------------------------------------
#CMake Warning:												#CMake Warning:
#  Manually-specified variables were not used by the project:						#  Manually-specified variables were not used by the project:
#													#
#    CMAKE_MODULE_LINKER_FLAGS										#    CMAKE_MODULE_LINKER_FLAGS
#    CMAKE_SHARED_LINKER_FLAGS										#    CMAKE_SHARED_LINKER_FLAGS
#    CMAKE_VERBOSE_MAKEFILE										#    CMAKE_VERBOSE_MAKEFILE
#    FETCHCONTENT_FULLY_DISCONNECTED									#    FETCHCONTENT_FULLY_DISCONNECTED
#    ICONV_INCLUDE_DIR											#    ICONV_INCLUDE_DIR
#    ICONV_LIBRARIES											#    ICONV_LIBRARIES
#    LIBICONV_INCLUDE_DIR										#    LIBICONV_INCLUDE_DIR
#    LIBICONV_LIBRARIES											#    LIBICONV_LIBRARIES
#    LIBICONV_LIBRARY											#    LIBICONV_LIBRARY
#----------------------------------------------------------------------					#----------------------------------------------------------------------

.include <bsd.port.mk>											.include <bsd.port.mk>

I automate some pkg-plist adjustments with a simple script I modify for each significant 'unofficial port' that I make.  It speeds the process of making sure that everything is accurate and consistent between rebuilds and new commits to my repo based upon upstream changes.  All the places in the script where it now has luanti had once been minetest.

plist-fix
#!/bin/sh
rm /var/tmp/luanti-dev_pkg-plist 2>/dev/null
rm /var/tmp/luanti-dev_pkg-plist-fixed 2>/dev/null
cp ../pkg-plist /var/tmp/luanti-dev_pkg-plist

echo "adding conditional list tags"

cat /var/tmp/minetest-dev_pkg-plist | \
sed \
-e 's#^\/you\/have\/to\/check\/what\/makeplist\/gives\/you##' \
-e '/^$/d' \
-e 's#^share\/locale#\%\%CLIENT\%\%\%\%NLS\%\%share\/locale#g' \
-e 's#^\%\%PORT#\%\%#g' \
-e 's#^bin/luantiserver#\%\%SERVER\%\%bin/luantiserver#1' \
-e 's#^bin/luanti#\%\%CLIENT\%\%bin/luanti#1' \
-e 's#^\%\%ETCDIR\%\%.conf.example#@sample\ etc/minetest.conf.example\ etc/minetest.conf#' \
-e 's#^\%\%ETCDIR\%\%.conf.example#@sample\ etc/luanti.conf.example\ etc/luanti.conf#' \
-e 's#^etc/rc.d/minetest#\%\%SERVER\%\%etc/rc.d/minetest#1' \
-e 's#^etc/rc.d/luanti#\%\%SERVER\%\%etc/rc.d/luanti#1' \
-e 's#^share/man/man6/luanti.6.gz#\%\%CLIENT\%\%share/man/man6/luanti.6.gz#1' \
-e 's#^share/man/man6/luantiserver.6.gz#\%\%SERVER\%\%share/man/man6/luantiserver.6.gz#1' \
-e 's#^\%\%DATADIR\%\%/client#\%\%CLIENT\%\%\%\%DATADIR\%\%/client#g' \
-e 's#^\%\%DATADIR\%\%/fonts#\%\%CLIENT\%\%\%\%DATADIR\%\%/fonts#g' \
-e 's#^\%\%DATADIR\%\%/textures#\%\%CLIENT\%\%\%\%DATADIR\%\%/textures#g' \
-e 's#^\%\%DATADIR\%\%/games/devtest#\%\%DEVTEST\%\%\%\%DATADIR\%\%/games/devtest#g' \
> /var/tmp/luanti-dev_pkg-plist-fixed
cp /var/tmp/luanti-dev_pkg-plist-fixed ../pkg-plist

The options config has changed somewhat, organized a little nicer.  The touch option was moved into the luanti config itself, and my method to use system fonts instead of bundled fonts can still be toggled.

┌────────────────────────────────────────┤luanti-dev-g20241102├─────────────────────────────────────────┐
│ 'F1' for Ports Collection help.                                                                       │
│ ┌───────────────────────────────────────────────────────────────────────────────────────────────────┐ │
│ │──────────────────────────────────────── Admin/Dev needs ──────────────────────────────────────────│ │
│ │[X] BENCHMARKS     Build benchmarks (Adds some benchmark chat commands)                            │ │
│ │[X] DEVTEST        Install Development Test game also (INSTALL_DEVTEST)                            │ │
│ │[X] DOCS           Build and install documentation (via doxygen)                                   │ │
│ │[X] NCURSES        Enables server side terminal (cli option: --terminal) (ENABLE_CURSES)           │ │
│ │[X] PROFILING      Use gprof for profiling (USE_GPROF)                                             │ │
│ │[X] PROMETHEUS     Build with Prometheus metrics exporter                                          │ │
│ │[X] UNITTESTS      Build unit test sources (BUILD_UNITTESTS)                                       │ │
│ │──────────────────────────────────────── Database support ─────────────────────────────────────────│ │
│ │[ ] LEVELDB        Enable LevelDB backend --broken - build fails--                                 │ │
│ │[ ] PGSQL          Enable PostgreSQL map backend                                                   │ │
│ │[ ] REDIS          Enable Redis backend                                                            │ │
│ │───────────────────────────────────────── Other options ───────────────────────────────────────────│ │
│ │[X] LTO            Build with IPO/LTO optimizations (smaller and more efficient than regular build)│ │
│ │─────────────────────────────────────── Client essentials ─────────────────────────────────────────│ │
│ │[X] CURL           Enable cURL support for fetching media: contentdb                               │ │
│ │[X] NLS            Native Language Support (ENABLE_GETTEXT)                                        │ │
│ │[X] SOUND          Enable sound via openal-soft                                                    │ │
│ │[X] SPATIAL        Enable SpatialIndex (Speeds up AreaStores)                                      │ │
│ │─────────────────────────────────────── System subsitutes ─────────────────────────────────────────│ │
│ │[X] SYSTEM_FONTS   Use or install default fonts from ports                                         │ │
│ │[X] SYSTEM_GMP     Use gmp from ports (ENABLE_SYSTEM_GMP)                                          │ │
│ │[X] SYSTEM_JSONCPP Use jsoncpp from ports (ENABLE_SYSTEM_JSONCPP)                                  │ │
│ │[X] SYSTEM_LUAJIT  Use or install luajit from ports (instead of bundled lua)                       │ │
│ │──────────────────────────── Software components [select at least one] ────────────────────────────│ │
│ │[X] CLIENT         Build client, add graphics and sdl2 support, dependencies                       │ │
│ │[X] SERVER         Build server                                                                    │ │
│ │───────────────────────────── Graphics support [select at least one] ──────────────────────────────│ │
│ │( ) GLES1          Enable OpenGL ES driver, legacy                                                 │ │
│ │( ) GLES2          Enable OpenGL ES 2+ driver                                                      │ │
│ │(*) OPENGL         Enable OpenGL driver                                                            │ │
│ │( ) OPENGL3        Enable OpenGL 3+ driver (likely needs sdl2 built with OPENGLES)                 │ │
│ └───────────────────────────────────────────────────────────────────────────────────────────────────┘ │
├───────────────────────────────────────────────────────────────────────────────────────────────────────┤
│                                         [  OK  ]     [Cancel]                                         │
└───────────────────────────────────────────────────────────────────────────────────────────────────────┘

If you had used minetest in the past, one other change is rather visible.  I toggled off the clouds in the luanti config which makes it much more game agnostic.

Luanti start screen GUI

At the moment this is the only way you can use the very most current Lunati client for minetest games and for your game engine needs.  Eventually the ports committer for games/minetest will have to go through much of the same work I finished above to create games/luanti.  Their task is delayed for public consumption even if they have done the work on their local machine because they track releases rather than upstream commits as I do.

Repo url:

Thursday, March 28, 2024

Streamlining minetest

Not long ago the upstream minetest developers made a commit which would fold irrlichtMt back into minetest.  The minetest devs split the two apart quite a long time ago so they could focus on what they needed to strip out of irrlicht and what needed to be customized for their own needs.  With this recent commit it seems as though much of that effort has been accomplished and further improvements would be made with it more integral to minetest once more.  I was not ready to make this overhaul of my own Makefile but I knew I would soon enough.

The first thing I did was to revise the minetest Makefile for the recent commit date and hash, then I changed directory into /usr/home/tigersharke/Ported_Software/games/minetest-dev/work/minetest-6a7a613741fe32fa14897a4f780d7382105a103c/ so that I could check the cmake options via the command
cmake -L | awk '{if(f)print} /-- Cache values/{f=1}' > ../../cmake_options_new
with a diff.  Since I had the previous cmake_options gathered in the same fashion, I could take a diff to see how things changed.  This would also prove to me that nearly all of the Makefile options from irrlicht-minetest would be shifted into minetest-dev.
diff -y -W 120 cmake_opts cmake_opts_new | more

diff
APPLY_LOCALE_BLACKLIST:BOOL=ON                                  APPLY_LOCALE_BLACKLIST:BOOL=ON
BUILD_BENCHMARKS:BOOL=FALSE                                     BUILD_BENCHMARKS:BOOL=FALSE
BUILD_CLIENT:BOOL=TRUE                                          BUILD_CLIENT:BOOL=TRUE
BUILD_DOCUMENTATION:BOOL=TRUE                                   BUILD_DOCUMENTATION:BOOL=TRUE
                                                           >    BUILD_EXAMPLES:BOOL=OFF
BUILD_SERVER:BOOL=FALSE                                         BUILD_SERVER:BOOL=FALSE
BUILD_UNITTESTS:BOOL=TRUE                                       BUILD_UNITTESTS:BOOL=TRUE
CMAKE_BUILD_TYPE:STRING=Release                                 CMAKE_BUILD_TYPE:STRING=Release
CMAKE_INSTALL_PREFIX:PATH=/usr/local                            CMAKE_INSTALL_PREFIX:PATH=/usr/local
CUSTOM_BINDIR:STRING=                                           CUSTOM_BINDIR:STRING=
CUSTOM_DOCDIR:STRING=                                           CUSTOM_DOCDIR:STRING=
CUSTOM_EXAMPLE_CONF_DIR:STRING=                                 CUSTOM_EXAMPLE_CONF_DIR:STRING=
CUSTOM_ICONDIR:STRING=                                          CUSTOM_ICONDIR:STRING=
CUSTOM_LOCALEDIR:STRING=                                        CUSTOM_LOCALEDIR:STRING=
CUSTOM_MANDIR:STRING=                                           CUSTOM_MANDIR:STRING=
CUSTOM_SHAREDIR:STRING=                                         CUSTOM_SHAREDIR:STRING=
CUSTOM_XDG_APPS_DIR:STRING=                                     CUSTOM_XDG_APPS_DIR:STRING=
ENABLE_CURL:BOOL=ON                                             ENABLE_CURL:BOOL=ON
ENABLE_CURSES:BOOL=ON                                           ENABLE_CURSES:BOOL=ON
ENABLE_GETTEXT:BOOL=ON                                          ENABLE_GETTEXT:BOOL=ON
                                                           >    ENABLE_GLES1:BOOL=OFF
                                                           >    ENABLE_GLES2:BOOL=OFF
ENABLE_LEVELDB:BOOL=ON                                          ENABLE_LEVELDB:BOOL=ON
ENABLE_LTO:BOOL=TRUE                                            ENABLE_LTO:BOOL=TRUE
ENABLE_LUAJIT:BOOL=ON                                           ENABLE_LUAJIT:BOOL=ON
                                                           >    ENABLE_OPENGL:BOOL=ON
                                                           >    ENABLE_OPENGL3:BOOL=ON
ENABLE_POSTGRESQL:BOOL=ON                                       ENABLE_POSTGRESQL:BOOL=ON
ENABLE_PROMETHEUS:BOOL=OFF                                      ENABLE_PROMETHEUS:BOOL=OFF
ENABLE_REDIS:BOOL=ON                                            ENABLE_REDIS:BOOL=ON
ENABLE_SOUND:BOOL=ON                                            ENABLE_SOUND:BOOL=ON
ENABLE_SPATIAL:BOOL=ON                                          ENABLE_SPATIAL:BOOL=ON
ENABLE_SYSTEM_GMP:BOOL=ON                                       ENABLE_SYSTEM_GMP:BOOL=ON
ENABLE_SYSTEM_JSONCPP:BOOL=ON                                   ENABLE_SYSTEM_JSONCPP:BOOL=ON
ENABLE_TOUCH:BOOL=OFF                                           ENABLE_TOUCH:BOOL=OFF
ENABLE_UPDATE_CHECKER:BOOL=(;NOT;TRUE;)                         ENABLE_UPDATE_CHECKER:BOOL=(;NOT;TRUE;)
GETTEXT_MSGFMT:FILEPATH=/usr/local/bin/msgfmt                   GETTEXT_MSGFMT:FILEPATH=/usr/local/bin/msgfmt
INSTALL_DEVTEST:BOOL=FALSE                                      INSTALL_DEVTEST:BOOL=FALSE
IRRLICHTMT_BUILD_DIR:PATH=                                 <
IrrlichtMt_DIR:PATH=/usr/local/lib/cmake/IrrlichtMt        <
LEVELDB_INCLUDE_DIR:PATH=/usr/include                           LEVELDB_INCLUDE_DIR:PATH=/usr/include
LEVELDB_LIBRARY:FILEPATH=LEVELDB_LIBRARY-NOTFOUND               LEVELDB_LIBRARY:FILEPATH=LEVELDB_LIBRARY-NOTFOUND
REDIS_INCLUDE_DIR:PATH=REDIS_INCLUDE_DIR-NOTFOUND               REDIS_INCLUDE_DIR:PATH=REDIS_INCLUDE_DIR-NOTFOUND
REDIS_LIBRARY:FILEPATH=REDIS_LIBRARY-NOTFOUND                   REDIS_LIBRARY:FILEPATH=REDIS_LIBRARY-NOTFOUND
REQUIRE_LUAJIT:BOOL=OFF                                         REQUIRE_LUAJIT:BOOL=OFF
RUN_IN_PLACE:BOOL=FALSE                                         RUN_IN_PLACE:BOOL=FALSE
                                                           >    SDL2_DIR:PATH=/usr/local/lib/cmake/SDL2
SPATIAL_INCLUDE_DIR:PATH=/usr/local/include                     SPATIAL_INCLUDE_DIR:PATH=/usr/local/include
SPATIAL_LIBRARY:FILEPATH=/usr/local/lib/libspatialindex.        SPATIAL_LIBRARY:FILEPATH=/usr/local/lib/libspatialindex.
USE_GPROF:BOOL=FALSE                                            USE_GPROF:BOOL=FALSE
                                                           >    USE_SDL2:BOOL=ON
VERSION_EXTRA:STRING=                                           VERSION_EXTRA:STRING=
WARN_ALL:BOOL=TRUE                                              WARN_ALL:BOOL=TRUE

Before I began the attempted reinstall, I removed irrlichtMt that was installed which also caused minetest to be removed.  This way I can know whether the newly incorporated irrlichtMt will satisfy the minetest build.  Output of the build seems to indicate that I might have a few things to adjust, although most do not seem to be critical issues I suppose I will need to add the jpeg to USES.  These warnings get generated due to developer="YES" in my /etc/make.conf file.

====> Compressing man pages (compress-man)
===> Staging rc.d startup script(s)
====> Running Q/A tests (stage-qa)
Error: /usr/local/bin/minetest is linked to /usr/local/lib/libjpeg.so.8 from graphics/jpeg-turbo but it is not declared as a dependency
Warning: you need USES+=jpeg
Warning: you might not need LIB_DEPENDS on libpng.so
Warning: you might not need LIB_DEPENDS on liblua-5.4.so
Warning: you might not need LIB_DEPENDS on libSDL2.so
Warning: you might not need LIB_DEPENDS on libSDL2_ttf.so
Warning: you might not need LIB_DEPENDS on libGL.so
Warning: you might not need LIB_DEPENDS on libopenal.so.1
===>  Installing for minetest-dev-g20240326
===>  Checking if minetest-dev is already installed
===>   Registering installation for minetest-dev-g20240326
pkg-static: duplicate file listing: /usr/local/etc/rc.d/minetest, ignoring
Installing minetest-dev-g20240326...
===> Creating groups.
Using existing group 'minetest'.
===> Creating users
Using existing user 'minetest'.
==> Running trigger: desktop-file-utils.ucl
Building cache database of MIME types
==> Running trigger: gtk-update-icon-cache.ucl
Generating GTK icon cache for /usr/local/share/icons/hicolor
===> SECURITY REPORT:
      This port has installed the following files which may act as network
      servers and may therefore pose a remote security risk to the system.
/usr/local/bin/minetestserver
/usr/local/bin/minetest

      This port has installed the following startup scripts which may cause
      these network services to be started at boot time.
/usr/local/etc/rc.d/minetest

      If there are vulnerabilities in these programs there may be a security
      risk to the system. FreeBSD makes no guarantee about the security of
      ports included in the Ports Collection. Please type 'make deinstall'
      to deinstall the port if this is a concern.

      For more information, and contact details about the security
      status of this software, see the following webpage:
https://www.minetest.net/
root@ichigo:/usr/home/tigersharke/Ported_Software/games/minetest-dev #

A quick test proved that everything runs well enough to show the main menu and access a server, so at least with most of the usual options selected for test builds-- I don't use touch option for my client nor most or any in the Admin/Dev section, it built fine.

┌───────────────────────────────────────┤minetest-dev-g20240326├────────────────────────────────────────┐
│ 'F1' for Ports Collection help.                                                                       │
│ ┌───────────────────────────────────────────────────────────────────────────────────────────────────┐ │
│ │──────────────────────────────────────── Database support ─────────────────────────────────────────│ │
│ │[ ] LEVELDB        Enable LevelDB backend                                                          │ │
│ │[ ] PGSQL          Enable PostgreSQL map backend                                                   │ │
│ │[ ] REDIS          Enable Redis backend                                                            │ │
│ │──────────────────────────────────────── Admin/Dev needs ──────────────────────────────────────────│ │
│ │[X] BENCHMARKS     Build benchmarks (Adds some benchmark chat commands)                            │ │
│ │[X] DEVTEST        Install Development Test game also (INSTALL_DEVTEST)                            │ │
│ │[X] DOCS           Build and install documentation (via doxygen)                                   │ │
│ │[X] EXAMPLES       BUILD_EXAMPLES                                                                  │ │
│ │[X] NCURSES        Enables server side terminal (cli option: --terminal)                           │ │
│ │[X] PROFILING      Use gprof for profiling                                                         │ │
│ │[X] PROMETHEUS     Build with Prometheus metrics exporter                                          │ │
│ │[X] TOUCH          Build with touch interface support (to test on amd64)                           │ │
│ │[X] UNITTESTS      Build unit test sources (BUILD_UNITTESTS)                                       │ │
│ │─────────────────────────────────────── Client essentials ─────────────────────────────────────────│ │
│ │[X] CURL           Enable cURL support for fetching media: contentdb                               │ │
│ │[X] FREETYPE       Support for TrueType fonts with unicode                                         │ │
│ │[X] NLS            Native Language Support (ENABLE_GETTEXT)                                        │ │
│ │[X] SOUND          Enable sound via openal-soft                                                    │ │
│ │[X] SPATIAL        Enable SpatialIndex (Speeds up AreaStores)                                      │ │
│ │───────────────────────────────────────── Other options ───────────────────────────────────────────│ │
│ │[X] LTO            Build with IPO/LTO optimizations (smaller and more efficient than regular build)│ │
│ │─────────────────────────────────────── System subsitutes ─────────────────────────────────────────│ │
│ │[X] SYSTEM_FONTS   Use or install default fonts from ports                                         │ │
│ │[X] SYSTEM_GMP     Use gmp from ports (ENABLE_SYSTEM_GMP)                                          │ │
│ │[X] SYSTEM_JSONCPP Use jsoncpp from ports (ENABLE_SYSTEM_JSONCPP)                                  │ │
│ │[X] SYSTEM_LUAJIT  Use or install luajit-openresty from ports                                      │ │
│ │──────────────────────────── Software components [select at least one] ────────────────────────────│ │
│ │[X] CLIENT         Build client and add graphics support, dependency                               │ │
│ │[X] SERVER         Build server                                                                    │ │
│ │───────────────────────────── Graphics support [select at least one] ──────────────────────────────│ │
│ │( ) GLES1          Enable GLES1 (testing)                                                          │ │
│ │( ) GLES2          Enable GLES2 (testing)                                                          │ │
│ │(*) OPENGL         Support OPENGL (<3.x)                                                           │ │
│ │( ) OPENGL3        Support OPENGL3 --Builds but seems incomplete--                                 │ │
│ └───────────────────────────────────────────────────────────────────────────────────────────────────┘ │
├───────────────────────────────────────────────────────────────────────────────────────────────────────┤
│                                         [  OK  ]     [Cancel]                                         │
└───────────────────────────────────────────────────────────────────────────────────────────────────────┘

I can add the jpeg item to the Makefile and now future minetest-dev builds will be one process.  Testing the gles1 option tells me that I cannot include SDL and so will need to adjust the options a bit more.  The jpeg item was actually a typo, having added it the wrong way in the wrong place.  There were a few other adjustments and one I cannot solve right now.  The git diff is how it looks now:

# git diff
diff --git a/Makefile b/Makefile
index e20fedc..176fcbb 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 # Portname block
 PORTNAME=              minetest
-DISTVERSION=   g20240324
+DISTVERSION=   g20240326
 CATEGORIES=            games
 PKGNAMESUFFIX= -dev
 DISTNAME=              ${PORTNAME}-${GH_TAGNAME}
@@ -15,15 +15,14 @@ WWW=                        https://www.minetest.net/
 LICENSE=               LGPL21+

 # dependencies
-LIB_DEPENDS=   libIrrlichtMt.so:x11-toolkits/irrlicht-minetest libzstd.so:archivers/zstd
+LIB_DEPENDS=   libzstd.so:archivers/zstd

 # uses block
-USES=                  cmake iconv:wchar_t sqlite lua luajit ninja:make llvm:min=16 pkgconfig:build sdl
+USES=                  cmake iconv:wchar_t sqlite lua luajit ninja:make llvm:min=16 pkgconfig:build
 USE_GITHUB=     nodefault
 GH_ACCOUNT=     minetest
 GH_PROJECT=     minetest
-GH_TAGNAME=            a7908da968bba82129f60c9601c9cefabd36a389
-USE_SDL=               sdl2 ttf2
+GH_TAGNAME=            6a7a613741fe32fa14897a4f780d7382105a103c

 # uses=cmake related variables
 CMAKE_ARGS=            -DCMAKE_BUILD_TYPE="MinSizeRel" \
@@ -31,7 +30,7 @@ CMAKE_ARGS=           -DCMAKE_BUILD_TYPE="MinSizeRel" \
                                -DCMAKE_CXX_FLAGS="-stdlib=libc++"

 # conflicts
-CONFLICTS=             minetest
+CONFLICTS=             minetest irrlichtMt irrlicht-minetest

 # wrksrc block
 WRKSRC=                        ${WRKDIR}/${PORTNAME}-${GH_TAGNAME}
@@ -43,7 +42,7 @@ WRKSRC=                       ${WRKDIR}/${PORTNAME}-${GH_TAGNAME}
 # FATAL: Makefile: PORTDOCS appears in plist but DOCS is not listed in OPTIONS_DEFINE.

 # options definitions
-OPTIONS_DEFAULT=                       CURL DOCS FREETYPE LTO LUAJIT SOUND SPATIAL SYSTEM_FONTS SYSTEM_GMP SYSTEM_JSONCPP CLIENT GLVND
+OPTIONS_DEFAULT=                       CURL DOCS FREETYPE LTO LUAJIT SOUND SPATIAL SYSTEM_FONTS SYSTEM_GMP SYSTEM_JSONCPP CLIENT OPENGL
 OPTIONS_GROUP=                         DATABASE BUILD NEEDS MISC SYSTEM
 OPTIONS_GROUP_BUILD=           BENCHMARKS DEVTEST DOCS EXAMPLES NCURSES PROFILING PROMETHEUS TOUCH UNITTESTS
 OPTIONS_GROUP_DATABASE=                LEVELDB PGSQL REDIS
@@ -52,13 +51,13 @@ OPTIONS_GROUP_NEEDS=                CURL FREETYPE NLS SOUND SPATIAL
 OPTIONS_GROUP_SYSTEM=          SYSTEM_FONTS SYSTEM_GMP SYSTEM_JSONCPP SYSTEM_LUAJIT
 OPTIONS_MULTI=                         SOFTWARE
 OPTIONS_MULTI_SOFTWARE=                CLIENT SERVER
-#OPTIONS_SINGLE=                       GRAPHICS  # Graphics buried option GLVND/LEGACY stuff obsoleted log ago, likely did nothing.
-#OPTIONS_SINGLE_GRAPHICS=      GLVND LEGACY
+OPTIONS_SINGLE=                                GRAPHICS
+OPTIONS_SINGLE_GRAPHICS=       GLES1 GLES2 OPENGL OPENGL3
 OPTIONS_SUB=                           yes

 # options descriptions
-BUILD_DESC=                                    Admin/Dev needs
 BENCHMARKS_DESC=                       Build benchmarks (Adds some benchmark chat commands)
+BUILD_DESC=                                    Admin/Dev needs
 CLIENT_DESC=                           Build client and add graphics support, dependency
 CURL_DESC=                                     Enable cURL support for fetching media: contentdb
 DATABASE_DESC=                         Database support
@@ -66,19 +65,22 @@ DEVTEST_DESC=                               Install Development Test game also (INSTALL_DEVTEST)
 DOCS_DESC=                                     Build and install documentation (via doxygen)
 EXAMPLES_DESC=                         BUILD_EXAMPLES
 FREETYPE_DESC=                         Support for TrueType fonts with unicode
-#GLVND_DESC=                                   Use libOpenGL or libGLX
-#GRAPHICS_DESC=                                Graphics support
-#LEGACY_DESC=                          Use libGL - where GLVND may be broken on nvidia
+GLES1_DESC=                                    Enable GLES1 --broken due to SDL--
+GLES2_DESC=                                    Enable GLES2
+GRAPHICS_DESC=                         Graphics support
 LEVELDB_DESC=                          Enable LevelDB backend
 LTO_DESC=                                      Build with IPO/LTO optimizations (smaller and more efficient than regular build)
 MISC_DESC=                                     Other options
 NCURSES_DESC=                          Enables server side terminal (cli option: --terminal)
 NEEDS_DESC=                                    Client essentials
 NLS_DESC=                                      Native Language Support (ENABLE_GETTEXT)
+OPENGL3_DESC=                          Support OPENGL3 --Builds but seems incomplete--
+OPENGL_DESC=                           Support OPENGL (<3.x)
 PGSQL_DESC=                                    Enable PostgreSQL map backend
 PROFILING_DESC=                                Use gprof for profiling
 PROMETHEUS_DESC=                       Build with Prometheus metrics exporter
 REDIS_DESC=                                    Enable Redis backend
+#SDL_DESC=                                     Use SDL
 SERVER_DESC=                           Build server
 SOFTWARE_DESC=                         Software components
 SOUND_DESC=                                    Enable sound via openal-soft
@@ -93,9 +95,9 @@ UNITTESTS_DESC=                               Build unit test sources (BUILD_UNITTESTS)

 # options helpers
 BENCHMARKS_CMAKE_BOOL=         BUILD_BENCHMARKS
-CLIENT_LIB_DEPENDS=                    libIrrlichtMt.so:x11-toolkits/irrlicht-minetest libpng.so:graphics/png
-CLIENT_USES=                           gl xorg
-CLIENT_USE=                                    jpeg GL=gl,glu \
+CLIENT_LIB_DEPENDS=                    libpng.so:graphics/png
+CLIENT_USES=                           gl xorg jpeg
+CLIENT_USE=                                    GL=gl,glu \
                                                        XORG=ice,sm,x11,xext,xcb,xres,xshmfence,xau,xaw,xcomposite,xcursor,xdamage,xdmcp,\
                                                        xfixes,xft,xi,xinerama,xkbfile,xmu,xpm,xrandr,xrender,xscreensaver,xt,xtst,xv,xxf86vm
 CLIENT_CMAKE_ON=                       BUILD_CLIENT REQUIRE_LUAJIT ENABLE_LUAJIT
@@ -107,13 +109,10 @@ DOCS_CMAKE_BOOL=                  BUILD_DOCUMENTATION
 EXAMPLES_CMAKE_BOOL=           BUILD_EXAMPLES
 FREETYPE_LIB_DEPENDS=          libfreetype.so:print/freetype2
 FREETYPE_CMAKE_BOOL=           ENABLE_FREETYPE
-#GLVND_LIB_DEPENDS=                    libOpenGL.so:graphics/libglvnd
-#GLVND_USE=                                    GL+=opengl
-#GLVND_CMAKE_BOOL=                     ENABLE_GLVND
-#GLVND_CMAKE_ON=                               -DOPENGL_GL_PREFERENCE="GLVND" -DOPENGL_xmesa_INCLUDE_DIR="${PREFIX}/lib"
-#LEGACY_USE=                                   GL+=opengl
-#LEGACY_CMAKE_BOOL=                    ENABLE_LEGACY
-#LEGACY_CMAKE_ON=                      -DOPENGL_GL_PREFERENCE="LEGACY" -DOPENGL_xmesa_INCLUDE_DIR="${PREFIX}/lib"
+GLES1_USE=                                     GL+=glesv1
+GLES1_CMAKE_BOOL=                      ENABLE_GLES1
+GLES2_USE=GL+=                         glesv2
+GLES2_CMAKE_BOOL=                      ENABLE_GLES2
 LEVELDB_LIB_DEPENDS=           libleveldb.so:databases/leveldb
 LEVELDB_CMAKE_BOOL=                    ENABLE_LEVELDB
 LTO_CMAKE_BOOL=                                ENABLE_LTO
@@ -122,12 +121,18 @@ NCURSES_CMAKE_BOOL=                       ENABLE_CURSES
 NLS_USES=                                      gettext
 NLS_CMAKE_BOOL=                                ENABLE_GETTEXT
 NLS_LDFLAGS=                           -L${LOCALBASE}/lib
+OPENGL3_USE=                           GL+=gl
+OPENGL3_CMAKE_BOOL=                    ENABLE_OPENGL3
+OPENGL3_CMAKE_ON=                      USE_SDL
+OPENGL_USE=                                    GL+=gl
+OPENGL_CMAKE_BOOL=                     ENABLE_OPENGL
 PGSQL_USES=                                    pgsql
 PGSQL_CMAKE_BOOL=                      ENABLE_POSTGRESQL
 PROFILING_CMAKE_ON=                    USE_GPROF
 PROMETHEUS_CMAKE_BOOL=         ENABLE_PROMETHEUS
 REDIS_LIB_DEPENDS=                     libhiredis.so:databases/hiredis
 REDIS_CMAKE_BOOL=                      ENABLE_REDIS
+#SDL_CMAKE_ON=                         USE_SDL2
 SERVER_CMAKE_BOOL=                     BUILD_SERVER
 SOUND_CMAKE_BOOL=                      ENABLE_SOUND
 SPATIAL_LIB_DEPENDS=           libspatialindex.so:devel/spatialindex
@@ -144,13 +149,19 @@ SYSTEM_LUAJIT_USES=                       luajit:luajit-openresty
 TOUCH_CMAKE_BOOL=                      ENABLE_TOUCH
 UNITTESTS_CMAKE_BOOL=          BUILD_UNITTESTS

+# SDL cannot be used with GLES1 but having it installed causes a fail without enabled in Makefile?
+
 .include 

+.if ${PORT_OPTIONS:MCLIENT} && ${PORT_OPTIONS:MOPENGL}
+USES+=                 sdl
+USE_SDL=               sdl2 ttf2
+SDL_CMAKE_ON=  USE_SDL2=ON
+.endif
+
 .if ${PORT_OPTIONS:MCLIENT} && ${PORT_OPTIONS:MSOUND}
 USES+=                 openal
-LIB_DEPENDS+=  libogg.so:audio/libogg \
-                               libvorbis.so:audio/libvorbis \
-                               libvorbisfile.so:audio/libvorbis
+LIB_DEPENDS+=  libogg.so:audio/libogg libvorbisfile.so:audio/libvorbis
 .endif

 .if ${PORT_OPTIONS:MSERVER}
diff --git a/distinfo b/distinfo
index f485f6f..d444723 100644
--- a/distinfo
+++ b/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1711406948
-SHA256 (minetest-dev/minetest-a7908da968bba82129f60c9601c9cefabd36a389.tar.gz) = f2431461c2307c5111cabf6c0c360e7d2e516942b7cc407ca9aaeae25843bb92
-SIZE (minetest-dev/minetest-a7908da968bba82129f60c9601c9cefabd36a389.tar.gz) = 10477004
+TIMESTAMP = 1711653177
+SHA256 (minetest-dev/minetest-6a7a613741fe32fa14897a4f780d7382105a103c.tar.gz) = 74a3c9b5038541ce4375d583d1b60ef4bb5e6e2345b8f7a5610b1ed1222020e5
+SIZE (minetest-dev/minetest-6a7a613741fe32fa14897a4f780d7382105a103c.tar.gz) = 11276813

The pkg-plist did not change, which means irrlichtMt is very integrated into the minetest build so that it is not a distinct install any longer.  It might possibly be a bit more time to compile since irrlichtMt is built also, but it will only be one thing to maintain instead of two.  It will be easier for consumers to keep updated since they will only need to look in one place, install one thing not including external dependencies.

Sunday, March 10, 2024

Portclippy minetest finesse

I recently discovered another option that I left out of the exposed config for my unofficial minetest-dev port.  It is not much of a task to add another option but in the process of doing it I re-read some porter's handbook documentation about testing.  I was wondering how to test for correctness and whether all my dependencies were included.  I haven't had issues with building from my Makefile, although it warns that I may be including too many dependencies, things that it might not link to anyway.  These are only warnings, they could remain as is, though why not fix them, and I noticed mention of portclippy which is installed by ports-mgmt/portfmt.

I've used portlint (installed by ports-mgmt/porttools) frequently and its direction has helped me correct flaws, including the most annoying "wrong linetype" issue when I copy-paste something and it converts from tabs to spaces.  This tool, portclippy is much more visual and makes the needed adjustments much more obvious.  Below is the output I had when I ran it on the minetest-dev Makefile.  The manpage describes "The output of portclippy is inspired by unified diff(1) output.  Here RUN_DEPENDS is in the wrong position (marked with -) and should be moved to before USES (marked with +)." which means there are a lot of line moves to do.

/usr/home/tigersharke/Ported_Software/games/minetest-dev # portclippy Makefile
# PORTNAME block
PORTNAME
DISTVERSION
CATEGORIES
PKGNAMESUFFIX
DISTNAME
DIST_SUBDIR

# Maintainer block
MAINTAINER
COMMENT
WWW

# License block
LICENSE

# Dependencies
LIB_DEPENDS

# USES block
USES

-CONFLICTS

USE_GITHUB
GH_ACCOUNT
GH_PROJECT
GH_TAGNAME
+USE_SDL

# USES=cmake related variables
CMAKE_ARGS

-USE_SDL
# Conflicts
+CONFLICTS

# WRKSRC block
WRKSRC

# Packaging list block
PORTDATA
PORTDOCS

# Options definitions
OPTIONS_DEFAULT
OPTIONS_GROUP
-OPTIONS_SINGLE
-OPTIONS_MULTI

-MISC_DESC

+OPTIONS_GROUP_BUILD
+OPTIONS_GROUP_DATABASE
OPTIONS_GROUP_MISC

-NEEDS_DESC

OPTIONS_GROUP_NEEDS

-SYSTEM_DESC

OPTIONS_GROUP_SYSTEM

-SOFTWARE_DESC

+OPTIONS_MULTI
OPTIONS_MULTI_SOFTWARE
+OPTIONS_SINGLE
+OPTIONS_SINGLE_GRAPHICS
+OPTIONS_SUB

# Options descriptions
+BUILD_DESC
+CLIENT_DESC
+CURL_DESC
+DATABASE_DESC
+DEVTEST_DESC
+DOCS_DESC
+EXAMPLES_DESC
+FREETYPE_DESC
+GLVND_DESC
+GRAPHICS_DESC
+LEGACY_DESC
+LEVELDB_DESC
+LTO_DESC
+MISC_DESC
+NCURSES_DESC
+NEEDS_DESC
+NLS_DESC
+PGSQL_DESC
+PROFILING_DESC
+PROMETHEUS_DESC
+REDIS_DESC
+SERVER_DESC
+SOFTWARE_DESC
+SOUND_DESC
+SPATIAL_DESC
+SYSTEM_DESC
+SYSTEM_FONTS_DESC
SYSTEM_GMP_DESC

-SYSTEM_GMP_CMAKE_BOOL
-SYSTEM_GMP_CMAKE_ON
-SYSTEM_GMP_LIB_DEPENDS

SYSTEM_JSONCPP_DESC

-SYSTEM_JSONCPP_CMAKE_BOOL
-SYSTEM_JSONCPP_CMAKE_ON
-SYSTEM_JSONCPP_LIB_DEPENDS

SYSTEM_LUAJIT_DESC

-SYSTEM_LUAJIT_USES

-SYSTEM_FONTS_DESC

-SYSTEM_FONTS_RUN_DEPENDS

-BUILD_DESC

-OPTIONS_GROUP_BUILD

-EXAMPLES_DESC

-EXAMPLES_CMAKE_BOOL

-DEVTEST_DESC

-DEVTEST_CMAKE_BOOL

+TOUCH_DESC
UNITTESTS_DESC

# Options helpers
-UNITTESTS_CMAKE_BOOL

-OPTIONS_SINGLE_GRAPHICS

-GRAPHICS_DESC
-GLVND_DESC

-GLVND_CMAKE_BOOL
-GLVND_CMAKE_ON
-GLVND_USE
-GLVND_LIB_DEPENDS

-LEGACY_DESC

-LEGACY_CMAKE_BOOL
-LEGACY_CMAKE_ON
-LEGACY_USE

-DATABASE_DESC

-OPTIONS_GROUP_DATABASE
-OPTIONS_SUB

-CLIENT_DESC

-CLIENT_CMAKE_BOOL_ON

CLIENT_LIB_DEPENDS
CLIENT_USES
CLIENT_USE

-SERVER_DESC

-SERVER_CMAKE_BOOL

-CURL_DESC

-CURL_CMAKE_BOOL
CURL_LIB_DEPENDS

-SOUND_DESC

-SOUND_CMAKE_BOOL

-DOCS_DESC

+CURL_CMAKE_BOOL
+DEVTEST_CMAKE_BOOL
DOCS_CMAKE_BOOL

-FREETYPE_DESC

-FREETYPE_CMAKE_BOOL
+EXAMPLES_CMAKE_BOOL
FREETYPE_LIB_DEPENDS

-NCURSES_DESC

-NCURSES_CMAKE_BOOL
-NCURSES_USES

-LEVELDB_DESC

-LEVELDB_CMAKE_BOOL
+FREETYPE_CMAKE_BOOL
+GLVND_LIB_DEPENDS
+GLVND_USE
+GLVND_CMAKE_BOOL
+GLVND_CMAKE_ON
+LEGACY_USE
+LEGACY_CMAKE_BOOL
+LEGACY_CMAKE_ON
LEVELDB_LIB_DEPENDS

-PGSQL_DESC

+LEVELDB_CMAKE_BOOL
+LTO_CMAKE_BOOL
+NCURSES_USES
+NCURSES_CMAKE_BOOL
+NLS_USES
+NLS_CMAKE_BOOL
+NLS_LDFLAGS
PGSQL_USES
PGSQL_CMAKE_BOOL

-REDIS_DESC

-REDIS_CMAKE_BOOL
+PROFILING_CMAKE_BOOL
+PROMETHEUS_CMAKE_BOOL
REDIS_LIB_DEPENDS

-SPATIAL_DESC

+REDIS_CMAKE_BOOL
+SERVER_CMAKE_BOOL
+SOUND_CMAKE_BOOL
SPATIAL_LIB_DEPENDS
SPATIAL_CMAKE_BOOL

-NLS_DESC

-NLS_CMAKE_BOOL
-NLS_USES
-NLS_LDFLAGS

-TOUCH_DESC

+SYSTEM_FONTS_RUN_DEPENDS
+SYSTEM_GMP_LIB_DEPENDS
+SYSTEM_GMP_CMAKE_BOOL
+SYSTEM_GMP_CMAKE_ON
+SYSTEM_JSONCPP_LIB_DEPENDS
+SYSTEM_JSONCPP_CMAKE_BOOL
+SYSTEM_JSONCPP_CMAKE_ON
+SYSTEM_LUAJIT_USES
TOUCH_CMAKE_BOOL
+UNITTESTS_CMAKE_BOOL

-PROMETHEUS_DESC

-PROMETHEUS_CMAKE_BOOL

-PROFILING_DESC

-PROFILING_CMAKE_BOOL

-LTO_DESC

-LTO_CMAKE_BOOL
# Unknown variables
# WARNING:
# The following variables were not recognized.
# They could just be typos or Portclippy needs to be made aware of them.
# Please double check them.
#
# Prefix them with an _ or wrap in '.ifnmake portclippy' to tell
# Portclippy to ignore them.
#
# If in doubt please report this on portfmt's bug tracker:
# https://codeberg.org/tobik/portfmt/issues
+CLIENT_CMAKE_BOOL_ON
/usr/home/tigersharke/Ported_Software/games/minetest-dev #

So it looks like I will need to scroll down to the first group of lines with the "-" prefix, and move them where the matching lines with the "+" prefix are in the file.  After quite a bit of cut and paste using vi, I have re-run portclippy for the results below.

/usr/home/tigersharke/Ported_Software/games/minetest-dev # portclippy Makefile
# PORTNAME block
PORTNAME
DISTVERSION
CATEGORIES
PKGNAMESUFFIX
DISTNAME
DIST_SUBDIR

# Maintainer block
MAINTAINER
COMMENT
WWW

# License block
LICENSE

# Dependencies
LIB_DEPENDS

# USES block
USES
USE_GITHUB
GH_ACCOUNT
GH_PROJECT
GH_TAGNAME
USE_SDL

# USES=cmake related variables
CMAKE_ARGS

# Conflicts
CONFLICTS

# WRKSRC block
WRKSRC

# Packaging list block
PORTDATA
PORTDOCS

# Options definitions
OPTIONS_DEFAULT
OPTIONS_GROUP
OPTIONS_GROUP_BUILD
OPTIONS_GROUP_DATABASE
OPTIONS_GROUP_MISC
OPTIONS_GROUP_NEEDS
OPTIONS_GROUP_SYSTEM
OPTIONS_MULTI
OPTIONS_MULTI_SOFTWARE
+OPTIONS_SINGLE
+OPTIONS_SINGLE_GRAPHICS
+OPTIONS_SUB

# Options descriptions
BUILD_DESC
CLIENT_DESC
CURL_DESC
DATABASE_DESC
DEVTEST_DESC
DOCS_DESC
EXAMPLES_DESC
FREETYPE_DESC
GLVND_DESC
GRAPHICS_DESC
LEGACY_DESC
LEVELDB_DESC
LTO_DESC
MISC_DESC
NCURSES_DESC
NEEDS_DESC
NLS_DESC
PGSQL_DESC
PROFILING_DESC
PROMETHEUS_DESC
REDIS_DESC
SERVER_DESC
SOFTWARE_DESC
SOUND_DESC
SPATIAL_DESC
SYSTEM_DESC
SYSTEM_FONTS_DESC
SYSTEM_GMP_DESC
SYSTEM_JSONCPP_DESC
SYSTEM_LUAJIT_DESC
TOUCH_DESC
UNITTESTS_DESC

# Options helpers
CLIENT_LIB_DEPENDS
CLIENT_USES
CLIENT_USE
CLIENT_CMAKE_ON
CURL_LIB_DEPENDS
CURL_CMAKE_BOOL
DEVTEST_CMAKE_BOOL
DOCS_CMAKE_BOOL
EXAMPLES_CMAKE_BOOL
FREETYPE_LIB_DEPENDS
FREETYPE_CMAKE_BOOL
GLVND_LIB_DEPENDS
GLVND_USE
GLVND_CMAKE_BOOL
GLVND_CMAKE_ON
LEGACY_USE
LEGACY_CMAKE_BOOL
LEGACY_CMAKE_ON
LEVELDB_LIB_DEPENDS
LEVELDB_CMAKE_BOOL
LTO_CMAKE_BOOL
NCURSES_USES
NCURSES_CMAKE_BOOL
NLS_USES
NLS_CMAKE_BOOL
NLS_LDFLAGS
PGSQL_USES
PGSQL_CMAKE_BOOL
PROFILING_CMAKE_ON
PROMETHEUS_CMAKE_BOOL
REDIS_LIB_DEPENDS
REDIS_CMAKE_BOOL
SERVER_CMAKE_BOOL
SOUND_CMAKE_BOOL
SPATIAL_LIB_DEPENDS
SPATIAL_CMAKE_BOOL
SYSTEM_FONTS_RUN_DEPENDS
SYSTEM_GMP_LIB_DEPENDS
SYSTEM_GMP_CMAKE_BOOL
SYSTEM_GMP_CMAKE_ON
SYSTEM_JSONCPP_LIB_DEPENDS
SYSTEM_JSONCPP_CMAKE_BOOL
SYSTEM_JSONCPP_CMAKE_ON
SYSTEM_LUAJIT_USES
TOUCH_CMAKE_BOOL
UNITTESTS_CMAKE_BOOL

-OPTIONS_SINGLE
-OPTIONS_SINGLE_GRAPHICS
-OPTIONS_SUB
/usr/home/tigersharke/Ported_Software/games/minetest-dev #

I have a small personal objection to how the options are ordered, since I like to group them together with all parts for any config option.  This way I am more sure not to miss something and for me its easier to read.  Above is the portclippy output after I complied with all but three lines of its instruction, the comments are generated by the tool, any comments actually in the Makefile are ignored.  I added similar comments as this is my first time doing this and it may help me with other ports I attempt.  If I complied 100% with what portclippy wanted changed, it would not provide any output, no feedback needed.

This is a nice tool, it very visually helps get the Makefile organized for official ports, so it will help those new to the process perfect their skills with this part of the job.  I am not sure whether I would revert the options order to what I prefer.  I could pre-add incompletely filled lines (leave out the assigned values part) of any new option for all of the different sections even if some remain unused (or might not be filled) as a way to avoid missing any.

Sunday, September 3, 2023

Revised minetest-dev: fonts!

Anyone watching my git repo for minetest-dev or any of the others will know that I have expanded a bit on what I attempt to maintain in a reasonably timely manner.  Not too long ago, during a period when my FreeBSD install was functioning without hiccups, I eventually figured out another improvement to the minetest-dev Makefile.  I also have done a little cleanup for the options exposed to those who wish to install it.

Something I have wanted to do but hadn't the motivation or free time simultaneously is to have a way for the fonts installed on the system to be used by minetest, instead of duplicating them.  The solution I worked out is definitely not the best and actually begs upstream developers to include a proper mechanism to do this properly.  I understand that the minetest client should be guaranteed to have fonts it expects but without a mechanism within its build structure or configuration, we are stuck with a duplication of files for no real purpose.

minetest-dev:

PORTNAME=       minetest
DISTVERSION=    g20230902
CATEGORIES=     games
PKGNAMESUFFIX=  -dev
DISTNAME=       ${PORTNAME}-${GH_TAGNAME}
DIST_SUBDIR=    ${PORTNAME}${PKGNAMESUFFIX}

MAINTAINER=     nope@nothere
COMMENT=        Near-infinite-world block sandbox game
WWW=            https://www.minetest.net/

LICENSE=        LGPL21+

LIB_DEPENDS=    libIrrlichtMt.so:x11-toolkits/irrlicht-minetest libzstd.so:archivers/zstd

USES=           cmake compiler:c++14-lang iconv:wchar_t sqlite luajit
# Upstream requires Clang 3.5+ which for our criteria matches c++14-lang
# since https://en.cppreference.com/w/cpp/compiler_support
# lists "C++14 library support status (complete as of 3.5)"
# All other dependency version numbers are more direct and obvious, and surpass requirement.

CONFLICTS=      minetest

USE_GITHUB=     nodefault
GH_ACCOUNT=     minetest
GH_PROJECT=     minetest
GH_TAGNAME=     83b85ba16aaab7bddc479beada4ca3af9fa54a1b

CMAKE_ARGS=     -DCMAKE_BUILD_TYPE="MinSizeRel" \
                -DCUSTOM_EXAMPLE_CONF_DIR="${PREFIX}/etc" \
                -DCUSTOM_MANDIR="${PREFIX}/man"

WRKSRC=         ${WRKDIR}/${PORTNAME}-${GH_TAGNAME}

OPTIONS_DEFINE=                 CURL DOCS FREETYPE LUAJIT NCURSES NLS SOUND SPATIAL TOUCH PROMETHEUS
OPTIONS_DEFAULT=                CURL DOCS FREETYPE LUAJIT SOUND SPATIAL SYSTEM_FONTS SYSTEM_GMP SYSTEM_JSONCPP CLIENT GLVND

OPTIONS_SINGLE=                 GRAPHICS
OPTIONS_MULTI=                  SYSTEM COMP
OPTIONS_GROUP=                  BUILD DATABASE

COMP_DESC=                      Software components
OPTIONS_MULTI_COMP=             CLIENT SERVER

SYSTEM_DESC=                    System subsitutes
OPTIONS_MULTI_SYSTEM=           SYSTEM_GMP SYSTEM_JSONCPP SYSTEM_FONTS

SYSTEM_GMP_DESC=                Use gmp from ports (ENABLE_SYSTEM_GMP)
SYSTEM_GMP_CMAKE_BOOL=          ENABLE_SYSTEM_GMP
SYSTEM_GMP_CMAKE_ON=            -DGMP_INCLUDE_DIR="${PREFIX}/include"
SYSTEM_GMP_LIB_DEPENDS=         libgmp.so:math/gmp

SYSTEM_JSONCPP_DESC=            Use jsoncpp from ports (ENABLE_SYSTEM_JSONCPP)
SYSTEM_JSONCPP_CMAKE_BOOL=      ENABLE_SYSTEM_JSONCPP
SYSTEM_JSONCPP_CMAKE_ON=        -DJSON_INCLUDE_DIR="${PREFIX}/include/jsoncpp"
SYSTEM_JSONCPP_LIB_DEPENDS=     libjsoncpp.so:devel/jsoncpp

SYSTEM_FONTS_DESC=              Use or install default fonts from ports
SYSTEM_FONTS_RUN_DEPENDS=       ${LOCALBASE}/share/fonts/ChromeOS/Arimo-Bold.ttf:x11-fonts/croscorefonts-fonts-ttf \
                                ${LOCALBASE}/share/fonts/Droid/DroidSans.ttf:x11-fonts/droid-fonts-ttf

BUILD_DESC=                     Dev Build options
OPTIONS_GROUP_BUILD=            BENCHMARKS EXAMPLES UNITTESTS DEVTEST

BENCHMARKS_DESC=                Build benchmark sources (BUILD_BENCHMARKS)
BENCHMARKS_CMAKE_BOOL=          BUILD_BENCHMARKS
EXAMPLES_DESC=                  BUILD_EXAMPLES
EXAMPLES_CMAKE_BOOL=            BUILD_EXAMPLES
DEVTEST_DESC=                   Install Development Test game also (INSTALL_DEVTEST)
DEVTEST_CMAKE_BOOL=             INSTALL_DEVTEST
UNITTESTS_DESC=                 Build unittest sources (BUILD_UNITTESTS)
UNITTESTS_CMAKE_BOOL=           BUILD_UNITTESTS

OPTIONS_SINGLE_GRAPHICS=        GLVND LEGACY
GRAPHICS_DESC=                  Graphics support

GLVND_DESC=                     Use libOpenGL or libGLX
GLVND_CMAKE_BOOL=               ENABLE_GLVND
GLVND_CMAKE_ON=                 -DOPENGL_GL_PREFERENCE="GLVND" -DOPENGL_xmesa_INCLUDE_DIR="${PREFIX}/lib"
GLVND_USE=                      GL+=opengl

LEGACY_DESC=                    Use libGL - where GLVND may be broken on nvidia
LEGACY_CMAKE_BOOL=              ENABLE_LEGACY
LEGACY_CMAKE_ON=                -DOPENGL_GL_PREFERENCE="LEGACY" -DOPENGL_xmesa_INCLUDE_DIR="${PREFIX}/lib"
LEGACY_USE=                     GL+=opengl

DATABASE_DESC=                  Database support
OPTIONS_GROUP_DATABASE=         LEVELDB PGSQL REDIS

OPTIONS_SUB=                    yes

CLIENT_DESC=                    Build client
CLIENT_CMAKE_BOOL=              BUILD_CLIENT
CLIENT_LIB_DEPENDS=             libIrrlichtMt.so:x11-toolkits/irrlicht-minetest \
                                libpng.so:graphics/png

CLIENT_USES=                    gl xorg
CLIENT_USE=                     jpeg GL=gl,glu \
                                XORG=ice,sm,x11,xext,xcb,xres,xshmfence,xau,xaw,xcomposite,xcursor,xdamage,xdmcp,\
                                xfixes,xft,xi,xinerama,xkbfile,xmu,xpm,xrandr,xrender,xscreensaver,xt,xtst,xv,xxf86vm

SERVER_DESC=                    Build server
SERVER_CMAKE_BOOL=              BUILD_SERVER

CURL_DESC=                      Enable cURL support for fetching media
CURL_CMAKE_BOOL=                ENABLE_CURL
CURL_LIB_DEPENDS=               libcurl.so:ftp/curl

SOUND_DESC=                     Enable sound via openal-soft
SOUND_CMAKE_BOOL=               ENABLE_SOUND

FREETYPE_DESC=                  Support for TrueType fonts with unicode
FREETYPE_CMAKE_BOOL=            ENABLE_FREETYPE
FREETYPE_LIB_DEPENDS=           libfreetype.so:print/freetype2

NCURSES_DESC=                   Enables server side terminal (cli option: --terminal)
NCURSES_CMAKE_BOOL=             ENABLE_CURSES
NCURSES_USES=                   ncurses

# This option is becoming uncertain, though it does something, is it useful?
LUAJIT_DESC=                    Require LUAJIT (always enabled)
LUAJIT_CMAKE_BOOL_ON=           REQUIRE_LUAJIT
LUAJIT_CMAKE_BOOL_OFF=          ENABLE_LUAJIT

LEVELDB_DESC=                   Enable LevelDB backend
LEVELDB_CMAKE_BOOL=             ENABLE_LEVELDB
LEVELDB_LIB_DEPENDS=            libleveldb.so:databases/leveldb

PGSQL_DESC=                     Enable PostgreSQL map backend
PGSQL_USES=                     pgsql
PGSQL_CMAKE_BOOL=               ENABLE_POSTGRESQL

REDIS_DESC=                     Enable Redis backend
REDIS_CMAKE_BOOL=               ENABLE_REDIS
REDIS_LIB_DEPENDS=              libhiredis.so:databases/hiredis

SPATIAL_DESC=                   Enable SpatialIndex (Speeds up AreaStores)
SPATIAL_LIB_DEPENDS=            libspatialindex.so:devel/spatialindex
SPATIAL_CMAKE_BOOL=             ENABLE_SPATIAL

NLS_DESC=                       Native Language Support (ENABLE_GETTEXT)
NLS_CMAKE_BOOL=                 ENABLE_GETTEXT
NLS_USES=                       gettext
NLS_LDFLAGS=                    -L${LOCALBASE}/lib

TOUCH_DESC=                     Build with touch interface support
TOUCH_CMAKE_BOOL=               ENABLE_TOUCH
# dependency?

PROMETHEUS_DESC=                Build with Prometheus metrics exporter
PROMETHEUS_CMAKE_BOOL=          ENABLE_PROMETHEUS
# dependency?

.include 

.if ${PORT_OPTIONS:MCLIENT} && ${PORT_OPTIONS:MSOUND}
USES+=                  openal
LIB_DEPENDS+=           libogg.so:audio/libogg \
                        libvorbis.so:audio/libvorbis \
                        libvorbisfile.so:audio/libvorbis
.endif

.if ${PORT_OPTIONS:MSERVER}
#USE_RC_SUBR=   ${PORTNAME}
#USERS=         ${PORTNAME}
#GROUPS=        ${PORTNAME}
#USE_RC_SUBR=           minetest/ERX
USE_RC_SUBR=            minetest
USERS=                  minetest
GROUPS=                 minetest
.endif

# Exactly why this must be done this way eludes me but this works and satisfies the install needs.
.if ${PORT_OPTIONS:MSYSTEM_FONTS}
pre-install:
        ${MKDIR} ${LOCALBASE}/share/minetest/fonts
        ${RM} ${LOCALBASE}/share/minetest/fonts/Arimo-Bold.ttf
        ${RM} ${LOCALBASE}/share/minetest/fonts/Arimo-BoldItalic.ttf
        ${RM} ${LOCALBASE}/share/minetest/fonts/Arimo-Italic.ttf
        ${RM} ${LOCALBASE}/share/minetest/fonts/Cousine-Bold.ttf
        ${RM} ${LOCALBASE}/share/minetest/fonts/Cousine-BoldItalic.ttf
        ${RM} ${LOCALBASE}/share/minetest/fonts/Cousine-Italic.ttf
        ${RM} ${LOCALBASE}/share/minetest/fonts/Cousine-Regular.ttf
        ${RM} ${LOCALBASE}/share/minetest/fonts/DroidSansFallbackFull.ttf
        ${MKDIR} ${LOCALBASE}/share/minetest/fonts
        ${LN} -s ${LOCALBASE}/share/fonts/ChromeOS/Arimo-Bold.ttf ${LOCALBASE}/share/minetest/fonts/Arimo-Bold.ttf
        ${LN} -s ${LOCALBASE}/share/fonts/ChromeOS/Arimo-BoldItalic.ttf ${LOCALBASE}/share/minetest/fonts/Arimo-BoldItalic.ttf
        ${LN} -s ${LOCALBASE}/share/fonts/ChromeOS/Arimo-Italic.ttf ${LOCALBASE}/share/minetest/fonts/Arimo-Italic.ttf
        ${LN} -s ${LOCALBASE}/share/fonts/ChromeOS/Cousine-Bold.ttf ${LOCALBASE}/share/minetest/fonts/Cousine-Bold.ttf
        ${LN} -s ${LOCALBASE}/share/fonts/ChromeOS/Cousine-BoldItalic.ttf ${LOCALBASE}/share/minetest/fonts/Cousine-BoldItalic.ttf
        ${LN} -s ${LOCALBASE}/share/fonts/ChromeOS/Cousine-Italic.ttf ${LOCALBASE}/share/minetest/fonts/Cousine-Italic.ttf
        ${LN} -s ${LOCALBASE}/share/fonts/ChromeOS/Cousine-Regular.ttf ${LOCALBASE}/share/minetest/fonts/Cousine-Regular.ttf
        ${LN} -s ${LOCALBASE}/share/fonts/Droid/DroidSansFallbackFull.ttf ${LOCALBASE}/share/minetest/fonts/DroidSansFallbackFull.ttf
.endif

post-install:
        @${ECHO_MSG} " "
        @${ECHO_MSG} "-->  "${PREFIX}/etc/"minetest.conf.example explains options and gives their default values. "
        @${ECHO_MSG} " "
        @${ECHO_MSG} "-->  Local network issues could cause singleplayer to fail. "
        @${ECHO_MSG} " "
        @${ECHO_MSG} "-->  Alternate graphics driver may be set in client config, must be set to get used."
        @${ECHO_MSG} " "
        @${ECHO_MSG} " "

# hacky way to not bring irrlicht and X11 depends for server only
#.if ! ${PORT_OPTIONS:MCLIENT} && ${PORT_OPTIONS:MSERVER}
#BROKEN= server only hack fails for irrlicht fork
#.endif
# From wiki:
#  Building without Irrlicht / X dependency
# You can build the Minetest server without library dependencies to Irrlicht or any graphical stuff.
# You still need the Irrlicht headers for this, so first, download the irrlicht source to somewhere.
#
# When invoking CMake, use -DBUILD_CLIENT=0 -DIRRLICHT_SOURCE_DIR=/wherever/you/unzipped/the/source.

#----------------------------------------------------------------------
#
# Strangely network issues can prevent singleplayer from functioning.
# GCC           7.5+    or Clang 6.0+
# CMake         3.5+
# IrrlichtMt    -       Custom version of Irrlicht, see https://github.com/minetest/irrlicht
# Freetype      2.0+
# SQLite3       3+
# Zstd          1.0+
# LuaJIT        2.0+    Bundled Lua 5.1 is used if not present
# GMP           5.0.0+  Bundled mini-GMP is used if not present
# JsonCPP       1.0.0+  Bundled JsonCPP is used if not present
# Curl          7.56.0+ Optional
# gettext       -       Optional
#----------------------------------------------------------------------
.include 

The post-install message is there for information which I believe an official port wouldn't even place within a pkg-message file, and why must I bother with another file if this remains the same much of the time. It would be one more file to track and possibly update.

Once more: I am not an official port maintainer of official ports, and although I may have based my initial Makefiles upon prior works, these are different, unique, and likely never to be annointed in their format or style or technique.  Use them as you choose, the risk is yours regardless of whether they seem safe and effective on my system, caveat emptor for both and all.  I will attempt to keep both updated nearly as frequently as I discover new commits.

Repo urls:

Maintaining these unofficial ports (tree leaf contents files) is an enjoyable hobby which ensures that I also have the very most current software.  The process to do this officially or not is not particularly difficult but it can certainly be a challenge.  I have yet to completely beat dbeaver into utter submission, but the datestamp solution is less than obvious even with a partial answer I am uncertain how to adapt it.  You will never know how you could succeed if you never attempt it.  If there is ANYTHING out there in the Linux world which you want to have for yourself, you can try to port it.  Read the porter's handbook, my own blog posts relate my experiences.

UPDATE:
The attempt to have symbolic links to fonts installed on the system: if it worked when this post was written, it fails with newer luanti and possibly newer make mechanisms.  Regardless, the Makefile and any files that change due to it have been adjusted to eliminate the SYSTEM_FONTS option until some future date when luanti makes it a real option or something else changes.

Monday, April 5, 2021

Getting minetest-dev built

Here I go again.  I had recently finished making a substantial revision to the minetest makefile and I wrote about it in a blog post which I updated a short time ago.  I decided to attempt to make the unreleased development version of minetest buildable on my system.  The added wrinkle with this is that the minetest developers decided to fork irrlicht in order to have it work better with minetest.  So you may conclude that I now have two ports to successfully build.

Starting with my own rococo Makefile in a new port directory, games/minetest-dev, I worked at attempting to get the source and have the build succeed.  It took a bit of time to manipulate the Makefile for this unique situation which technically has no source tarball, though the master branch can be downloaded as a .zip file.  I could have used the github shortcut option in my Makefile but at least initially the arrangement is unique and not quite as described in the porter's handbook.

After a while, I finally was able to get the .zip file, unpack it and begin to build which stopped at the point that it discovered irrlicht on my system was not the forked version it needed.  This meant that I needed to begin my efforts on getting the irrlicht fork to build.  Similarly to my build of minetest-dev, I began with the irrlicht port that already exists in the tree by copying it all to another directory, x11-toolkits/irrlicht-minetest.  It didn't take long to discover that it seemed as though this fork was built differently than the original irrlicht port which makes some sense as it is being modified by other developers and we all know different developers often prefer different tools.

As I am nearly finished with the irrlichtMt port except for installation, I now need to generate a package list for it.  This is one step I have not done often enough to remember it, like I can for make makesum so I have to look up what it is, a successful search confirms that it is make makeplist > pkg-plist but of course I will need to look over the generated file and edit out the top line.  While I had believed I was nearly finished, in fact my Makefile still had some flaws.  My solution was to simplify it by commenting out some lines until I finally happened upon the right combination which permitted me a successful build.  Once that was accomplished I could make the pkg-plist, edit it to remove the top line and call it done for now.

Back to the games/minetest-dev port to see if an install of irrlichtMt is found by it and then it will progress further in its build, hopefully to completion.  It seemed to build fine but failed on install I believe due to an old pkg-plist and the mechanism attempting to honor it.  Another clean build without that file so I can re-create it should solve this small issue.  It turns out that was not the issue, but my removal of the files directory which is usually used for patches, but also had something named minetest.in that was needed though how it is identified as a requirement I do not know.  I just copied the file from the minetest game port.  The remaining error messages seem to be caused by the lack of pkg-plist file but as the build was otherwise successful, it was easily created.  Of course, after all of this, I get the last inescapable complaint, that this version of minetest conflicts with the minetest already installed.

This was a rather pleasant experience even though there were moments when I was confused as to how to solve an issue with either port.  I can count these as my first successful ported software with mostly proper Makefiles and procedures, even if I had a bit of a head start with already existing Makefiles.  The main things which cause them to be less than proper is that I do not use any version numbers for distfiles as both are very generic .zip files direct from github.  If I discover how to solve that, or in the near future when the minetest project has cut a release for either of them, that issue can be solved.  Another minetest developer (of mods primarily) warned me that this dev version is somewhat of a mess, but I just installed it and have tested by playing the same minetest server games online which I usually do, and it seemed fine.  Maybe an earlier version was not as good but maybe I happened to grab a zip file of a coherent version that works, at least on FreeBSD.

For those who are curious, the two initially successful Makefiles are found at the repo links while more accurate (more recent) and complete ones are below.  I have realized that one way to maintain these port directories is to use a symbolic link into the ports tree for each of them if necessary while the actual content can reside on another account home directory in its own directory appropriately named (Ported_Software) containing them and any future port I manage to accomplish.  I chose to re-create the necessary subset of the ports tree, meaning that I made both hierarchies Ported_Software/x11-toolkits/irrlicht-minetest and Ported_Software/games/minetest-dev which will be easier to handle than any other variation and will be very much less cluttered until I make a very substantial number of ports.

PORTNAME=	minetest-dev
DISTVERSION=	g20210612
CATEGORIES=	games
PKGNAMESUFFIX=	-dev
DISTNAME=	master
DIST_SUBDIR=	${PORTNAME}${PKGNAMESUFFIX}

MAINTAINER=	nope@nothere
COMMENT=	Near-infinite-world block sandbox game

LICENSE=	LGPL21+

LIB_DEPENDS=	libIrrlichtMt.so:x11-toolkits/irrlicht-minetest

USES=		cmake compiler:c11 iconv:wchar_t sqlite

CONFLICTS=	minetest

USE_GITHUB=     nodefault
GH_ACCOUNT=     minetest
GH_PROJECT=     minetest
GH_TAGNAME=	dc165fe942bcc48d7dea0a7b722886937d9c6914

CMAKE_ARGS=	-DBUILD_UNITTESTS="FALSE" \
		-DCMAKE_BUILD_TYPE="MinSizeRel" \
		-DCUSTOM_EXAMPLE_CONF_DIR="${PREFIX}/etc" \
		-DCUSTOM_MANDIR="${PREFIX}/man"
WRKSRC=	${WRKDIR}/minetest-${GH_TAGNAME}

LDFLAGS_i386=	-Wl,-znotext

#PORTDATA=	*
#PORTDOCS=	*

OPTIONS_DEFINE=	CURL DOCS EXAMPLES FREETYPE GLES LUAJIT NCURSES NLS SOUND SYSTEM_GMP \
		SYSTEM_JSONCPP PROMETHEUS
OPTIONS_MULTI=	COMP
OPTIONS_RADIO=	GRAPHICS
OPTIONS_GROUP=	DATABASE

COMP_DESC=		Software components
OPTIONS_MULTI_COMP=	CLIENT SERVER

OPTIONS_RADIO_GRAPHICS=	GLVND LEGACY

SYSTEM_GMP_DESC=		Use gmp from ports (ENABLE_SYSTEM_GMP)
SYSTEM_GMP_CMAKE_BOOL=		ENABLE_SYSTEM_GMP
SYSTEM_GMP_CMAKE_ON=		-DGMP_INCLUDE_DIR="${PREFIX}/include"
SYSTEM_GMP_LIB_DEPENDS=		libgmp.so:math/gmp

SYSTEM_JSONCPP_DESC=		Use jsoncpp from ports (ENABLE_SYSTEM_JSONCPP)
SYSTEM_JSONCPP_CMAKE_BOOL=	ENABLE_SYSTEM_JSONCPP
SYSTEM_JSONCPP_CMAKE_ON=	-DJSON_INCLUDE_DIR="${PREFIX}/include/jsoncpp"
SYSTEM_JSONCPP_LIB_DEPENDS=	libjsoncpp.so:devel/jsoncpp

GRAPHICS_DESC=			Graphics support
GLVND_DESC=			Use libOpenGL or libGLX
LEGACY_DESC=			Use libGL - where GLVND may be broken on nvidia
GLES_DESC=			Use libOpenGLES instead of libOpenGL

GLVND_CMAKE_ON=			-DOPENGL_GL_PREFERENCE="GLVND"
LEGACY_CMAKE_ON=		-DOPENGL_GL_PREFERENCE="LEGACY"
GLES_CMAKE_BOOL=		ENABLE_GLES

DATABASE_DESC=			Database support
OPTIONS_GROUP_DATABASE=		LEVELDB REDIS SPATIAL
#OPTIONS_GROUP_DATABASE=	LEVELDB PGSQL REDIS SPATIAL

OPTIONS_DEFAULT=		CLIENT CURL DOCS FREETYPE GLVND LUAJIT NCURSES SOUND \
				SYSTEM_GMP SYSTEM_JSONCPP
OPTIONS_SUB=			yes

CLIENT_DESC=			Build client
CLIENT_CMAKE_BOOL=		BUILD_CLIENT
CLIENT_LIB_DEPENDS=		libIrrlichtMt.so:x11-toolkits/irrlicht-minetest \
				libpng.so:graphics/png
CLIENT_USES=			gl jpeg xorg
CLIENT_USE=			GL=gl,glu \
				XORG=ice,sm,x11,xext,xxf86vm
SERVER_DESC=			Build server
SERVER_CMAKE_BOOL=		BUILD_SERVER

CURL_DESC=			Enable cURL support for fetching media
CURL_CMAKE_BOOL=		ENABLE_CURL
CURL_LIB_DEPENDS=		libcurl.so:ftp/curl
SOUND_DESC=			Enable sound via openal-soft
SOUND_CMAKE_BOOL=		ENABLE_SOUND
FREETYPE_DESC=			Support for TrueType fonts with unicode
FREETYPE_CMAKE_BOOL=		ENABLE_FREETYPE
FREETYPE_LIB_DEPENDS=		libfreetype.so:print/freetype2
NCURSES_DESC=			Enable ncurses console
NCURSES_CMAKE_BOOL=		ENABLE_CURSES
NCURSES_USES=			ncurses

LUAJIT_DESC=			LuaJIT support (lang/luajit-openresty)
LUAJIT_CMAKE_BOOL=		ENABLE_LUAJIT REQUIRE_LUAJIT
LUAJIT_LIB_DEPENDS=		libluajit-5.1.so:lang/luajit-openresty

PGSQL_USES=			pgsql
PGSQL_CMAKE_BOOL=		ENABLE_POSTGRESQL
#PGSQL_LIB_DEPENDS=		libsqlite3.so:databases/sqlite3  # probable depend - check when this pgsql builds
LEVELDB_DESC=			Enable LevelDB backend
LEVELDB_CMAKE_BOOL=		ENABLE_LEVELDB
LEVELDB_LIB_DEPENDS=		libleveldb.so:databases/leveldb
REDIS_DESC=			Enable Redis backend
REDIS_CMAKE_BOOL=		ENABLE_REDIS
REDIS_LIB_DEPENDS=		libhiredis.so:databases/hiredis
SPATIAL_DESC=			Enable SpatialIndex AreaStore backend
SPATIAL_LIB_DEPENDS=		libspatialindex.so:devel/spatialindex
SPATIAL_CMAKE_BOOL=		ENABLE_SPATIAL

NLS_DESC=			Native Language Support (ENABLE_GETTEXT)
NLS_CMAKE_BOOL=			ENABLE_GETTEXT
NLS_USES=			gettext
NLS_LDFLAGS=			-L${LOCALBASE}/lib

PROMETHEUS_DESC=		Build with Prometheus metrics exporter
PROMETHEUS_CMAKE_BOOL=		ENABLE_PROMETHEUS
#PROMETHEUS_USES=		gettext

.include 

.if ${PORT_OPTIONS:MCLIENT} && ${PORT_OPTIONS:MSOUND}
USES+=		openal
LIB_DEPENDS+=	libogg.so:audio/libogg \
		libvorbis.so:audio/libvorbis \
		libvorbisfile.so:audio/libvorbis
.endif

.if ${PORT_OPTIONS:MSERVER}
#USE_RC_SUBR=	${PORTNAME}
#USERS=		${PORTNAME}
#GROUPS=	${PORTNAME}
USE_RC_SUBR=	minetest
USERS=		minetest
GROUPS=		minetest
.endif

# hacky way to not bring irrlicht and X11 depends for server only
.if ! ${PORT_OPTIONS:MCLIENT} && ${PORT_OPTIONS:MSERVER}
BROKEN= server only hack fails for irrlicht fork
.endif
# From wiki:
#  Building without Irrlicht / X dependency
# You can build the Minetest server without library dependencies to Irrlicht or any graphical stuff.
# You still need the Irrlicht headers for this, so first, download the irrlicht source to somewhere.
#
# When invoking CMake, use -DBUILD_CLIENT=0 -DIRRLICHT_SOURCE_DIR=/wherever/you/unzipped/the/source.

#post-patch:
#	@${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|' \
#		${WRKSRC}/cmake/Modules/*.cmake

.include 

The Makefile for the newly added irrlicht fork for minetest.

PORTNAME=	irrlichtMt
DISTVERSION=	g20210524
CATEGORIES=	x11-toolkits graphics
DISTNAME=	master
DIST_SUBDIR=	${PORTNAME}

MAINTAINER=	nope@nothere
COMMENT=	High performance realtime 3D engine - minetest fork

LICENSE=	ZLIB

LIB_DEPENDS=	libpng.so:graphics/png

USES=		alias cmake compiler:c11 dos2unix jpeg gl xorg

DOS2UNIX_GLOB=	*.cpp *.h *.txt Makefile

USE_GITHUB=	nodefault
GH_ACCOUNT=	minetest
GH_PROJECT=	irrlicht
GH_TAGNAME=	393793f28afa15641533f687f3a242e32a052fbc

CMAKE_ARGS=	-DCMAKE_BUILD_TYPE="MinSizeRel" \
		-DCUSTOM_MANDIR="${PREFIX}/man"

USE_GL=		gl glu
USE_XORG=	x11 xxf86vm
USE_LDCONFIG=	yes

WRKSRC=		${WRKDIR}/irrlicht-${GH_TAGNAME}

#OPTIONS_DEFINE= EXAMPLES

#EXAMPLES_CMAKE_BOOL=	BUILD_EXAMPLES
#Provided in directory below, right after make (prior to install), so need more mechanism to build and install them
#x11-toolkits/irrlicht-minetest/work/irrlicht-master/examples

.include 

Playing with the built port a bit more, it seems there are some items in the configuration panels in minetest itself which may lead to a crash, but other than fiddling with any of those I do not see any major issues.  The executable also seems to be smaller than the former minetest even with the same options ticked, so either those options do nothing in the dev version or a bit of bloat was removed.  One other thing, after I had to rebuild both due to moving these dev port directories into my home, and a minor issue with gitup caused by branch names on github, I found that a few details were not as perfected.  The lines CMAKE_SOURCE_PATH=${WRKDIR}/irrlicht-master
or
WRKSRC=${WRKDIR}/irrlicht-master
needed to be added after too much trial-and-error and documentation chasing.  I also realized that there are conditional lines in any pkg-plist which relate to the options of the Makefile.  Any lines which have %%OPTION%% prefix will only be in effect when that OPTION is chosen in the configuration when it is built.

I am fairly certain that aside from the glaring issue of grabbing a master.zip file direct from github, though using wget since it doesn't seem to work automatically with the make process, and then revising the distinfo (make makesum) after, both which still need to be fixed if possible, this endeavor seems to finally actually complete.  Since my philosophy to expose things to the user, which allows them to make their own choices even if bad, and my methods are different than the maintainer, I will keep this Makefile as my own private project.  It may not ever be adopted as is, officially, although anyone might still be able to use it since I am making it available here.

Since all but the automated fetch of distribution source functions pretty well, this is the part I need to iron out.  This is much more of a challenge than it should be.  As usual, documentation gives some vaguely specific examples which of course are not near enough to what I seem to need.  That means there is likely room for improvement in the porter's handbook.  The portlint and portfmt tools are helpful to make a reasonably coherent and consistent Makefile.  I use them at the very least because I have not edited thousands nor constructed my own script for doing so, and do not usually know the exact order of items in the Makefile.  Since both ports need to be obtained similarly, once I solved it for one port I could adapt the same changes to the other one.  As I have finally completed the entire porting of minetest-dev and irrlicht-minetest (irrlichtMt) and created some github repos for them, if you so choose you can try them out as well.

I am not a port maintainer and although I may have based my Makefiles upon prior works, these are different, unique, and likely never to be official in their format or style or technique.  Use them as you choose, the risk is yours regardlessof whether they seem safe and effective on my system I can do no more than suggest caveat emptor for both and all.  I will attempt to keep both updated nearly as frequently as I discover new commits.

Repo urls:

Anyone who tried the minetest-dev Makefile immediately after it was initially provided by my repo may have had a fetch issue.  This, oddly, was caused by the subdirectory for the distinfo file not being named minetest-dev.  This has now been corrected, and updated to the April 5th commit (see the distversion which means github 2021 April 5th), the pkg-plist also adjusted since some tests are now eliminated by upstream it seems.  Please note that until I can figure out some way for those distinfo version strings to be synchronized between minetest-dev and irrlicht-minetest, that if minetest-dev is updated, then you should update irrlichtMt also.

I have just corrected another oversight.  If you had built both ports there should have been no adverse effect, the devel version of minetest would seek and find libIrrlichtMt, but the minetest-dev Makefile had the former libIrrlicht as a dependency and so would not automatically cause it to be built.  The repo has been updated to fix this, the included Makefile has been updated for this blog post.  Future updates to the repo will not be updated here unless to correct any fundamental flaw as has been done previously.  If you wish to view the most current Makefile, please visit the appropriate repo.

Wednesday, March 31, 2021

Minetest better

minetest game example screenshot

This post has been revisited a couple times but I feel it is in its final form as I chose to continue with the development version instead of worrying about something I cannot control.

October 2020

There is a game in our ports collection which I spent far too many hours playing due to being temporarily out of work (but not jobless) beyond my control beginning mid March 2020.  It gave me something to do, to fill the empty, and I played it from a vanilla ports install.  When I say "vanilla ports install" what I mean is that I did not modify anything about it except for the configuration exposed by the person who ported it to FreeBSD.  This 'vanilla install' became customized when I saw that a newer version was available to the wider gamer community but had not yet been updated for FreeBSD.

I did my best to get it to work but discovered that some of the patches automatically applied did not need to be used, they failed to be applied to the newer version.  This was just the beginning of my tinkering to get minetest to function as well as possible.  I am sure that using a bundled, abbreviated, adequately functional component would be less efficient than to use the full version which may be available from ports.  I discovered this by investigating the various exposed options I could tick to know what they were about, and seeing others described by the Linux devs which were not.

The overview of the change, the left is how it appeared on October 3, 2020 at svnweb.freebsd.org and the right is how the Makefile was on my box then, the changes emphasized with highlighting.

diff
# Created by: Dmitry Marakasov <amdmi3@FreeBSD.org>						# Created by: Dmitry Marakasov <amdmi3@FreeBSD.org>
# $FreeBSD$											# $FreeBSD$

PORTNAME=	minetest									PORTNAME=	minetest
PORTVERSION=    5.3.0										PORTVERSION=    5.3.0
CATEGORIES=     games										CATEGORIES=     games

MAINTAINER=	amdmi3@FreeB									MAINTAINER=	amdmi3@FreeBSD.org
COMMENT=	Near-infinite-world block sandbox game						COMMENT=	Near-infinite-world block sandbox game

LICENSE=	LGPL21+										LICENSE=	LGPL21+
LICENSE_FILE=	${WRKSRC}/doc/lgpl-2.1.txt							LICENSE_FILE=	${WRKSRC}/doc/lgpl-2.1.txt

LIB_DEPENDS=	libsqlite3.so:databases/sqlite3 \						LIB_DEPENDS=	libsqlite3.so:databases/sqlite3 \
		libgmp.so:math/gmp				|       					libgmp.so:math/gmp \
								>       					libjsoncpp.so:devel/jsoncpp

USE_GITHUB=	yes										USE_GITHUB=	yes
GH_ACCOUNT=	minetest									GH_ACCOUNT=	minetest

USES=		cmake compiler:c11 iconv:wchar_t						USES=		cmake compiler:c11 iconv:wchar_t
CMAKE_ARGS=	-DCUSTOM_MANDIR="${PREFIX}/man" \						CMAKE_ARGS=	-DCUSTOM_MANDIR="${PREFIX}/man" \
		-DCUSTOM_EXAMPLE_CONF_DIR="${PREFIX}/etc"	|       					-DCUSTOM_EXAMPLE_CONF_DIR="${PREFIX}/etc" \
								>       					-DENABLE_SYSTEM_JSONCPP=ON \
								>       					-DJSON_INCLUDE_DIR=/usr/local/include/json \
								>       					-DCMAKE_BUILD_TYPE=MinSizeRel \
								>       					-DOPENGL_GL_PREFERENCE=LEGACY \
								>       					-DENABLE_SYSTEM_GMP=ON

LDFLAGS_i386=	-Wl,-znotext									LDFLAGS_i386=	-Wl,-znotext

PORTDATA=	*										PORTDATA=	*
PORTDOCS=	*										PORTDOCS=	*

OPTIONS_DEFINE=	CURL SOUND FREETYPE NCURSES LUAJIT \						OPTIONS_DEFINE=	CURL SOUND FREETYPE NCURSES LUAJIT \
		DOCS EXAMPLES NLS										DOCS EXAMPLES NLS
OPTIONS_MULTI=	COMP										OPTIONS_MULTI=	COMP
OPTIONS_GROUP=	DATABASE									OPTIONS_GROUP=	DATABASE

COMP_DESC=		Software components							COMP_DESC=		Software components
OPTIONS_MULTI_COMP=	CLIENT SERVER								OPTIONS_MULTI_COMP=	CLIENT SERVER

DATABASE_DESC=		Database support							DATABASE_DESC=		Database support
OPTIONS_GROUP_DATABASE=	PGSQL LEVELDB REDIS SPATIAL						OPTIONS_GROUP_DATABASE=	PGSQL LEVELDB REDIS SPATIAL

OPTIONS_DEFAULT=	CLIENT SERVER \								OPTIONS_DEFAULT=	CLIENT SERVER \
			CURL SOUND FREETYPE NCURSES LUAJIT								CURL SOUND FREETYPE NCURSES LUAJIT
OPTIONS_EXCLUDE_powerpc64=	LUAJIT								OPTIONS_EXCLUDE_powerpc64=	LUAJIT
OPTIONS_SUB=		yes									OPTIONS_SUB=		yes

CLIENT_DESC=		Build client								CLIENT_DESC=		Build client
CLIENT_CMAKE_BOOL=	BUILD_CLIENT								CLIENT_CMAKE_BOOL=	BUILD_CLIENT
CLIENT_LIB_DEPENDS=	libpng.so:graphics/png \						CLIENT_LIB_DEPENDS=	libpng.so:graphics/png \
			libIrrlicht.so:x11-toolkits/irrlicht					libIrrlicht.so:x11-toolkits/irrlicht
CLIENT_USES=		gl jpeg xorg								CLIENT_USES=		gl jpeg xorg
CLIENT_USE=		GL=gl XORG=x11,xext,xxf86vm						CLIENT_USE=		GL=gl XORG=x11,xext,xxf86vm
SERVER_DESC=		Build server								SERVER_DESC=		Build server
SERVER_CMAKE_BOOL=	BUILD_SERVER								SERVER_CMAKE_BOOL=	BUILD_SERVER

CURL_DESC=		Enable cURL support for fetching media					CURL_DESC=		Enable cURL support for fetching media
CURL_CMAKE_BOOL=	ENABLE_CURL								CURL_CMAKE_BOOL=	ENABLE_CURL
CURL_LIB_DEPENDS=	libcurl.so:ftp/curl							CURL_LIB_DEPENDS=	libcurl.so:ftp/curl
SOUND_DESC=		Enable sound								SOUND_DESC=		Enable sound
SOUND_CMAKE_BOOL=	ENABLE_SOUND								SOUND_CMAKE_BOOL=	ENABLE_SOUND
FREETYPE_DESC=		Support for TrueType fonts with unicode					FREETYPE_DESC=		Support for TrueType fonts with unicode
FREETYPE_CMAKE_BOOL=	ENABLE_FREETYPE								FREETYPE_CMAKE_BOOL=	ENABLE_FREETYPE
FREETYPE_LIB_DEPENDS=	libfreetype.so:print/freetype2						FREETYPE_LIB_DEPENDS=	libfreetype.so:print/freetype2
NCURSES_DESC=		Enable ncurses console							NCURSES_DESC=		Enable ncurses console
NCURSES_CMAKE_BOOL=	ENABLE_CURSES								NCURSES_CMAKE_BOOL=	ENABLE_CURSES
NCURSES_USES=		ncurses									NCURSES_USES=		ncurses

LUAJIT_DESC=		LuaJIT support								LUAJIT_DESC=		LuaJIT support
LUAJIT_CMAKE_BOOL=	ENABLE_LUAJIT REQUIRE_LUAJIT						LUAJIT_CMAKE_BOOL=	ENABLE_LUAJIT REQUIRE_LUAJIT
LUAJIT_LIB_DEPENDS=	libluajit-5.1.so:lang/luajit						LUAJIT_LIB_DEPENDS=	libluajit-5.1.so:lang/luajit

PGSQL_USES=		pgsql									PGSQL_USES=		pgsql
PGSQL_CMAKE_BOOL=	ENABLE_POSTGRESQL							PGSQL_CMAKE_BOOL=	ENABLE_POSTGRESQL
LEVELDB_DESC=		Enable LevelDB backend							LEVELDB_DESC=		Enable LevelDB backend
LEVELDB_CMAKE_BOOL=	ENABLE_LEVELDB								LEVELDB_CMAKE_BOOL=	ENABLE_LEVELDB
LEVELDB_LIB_DEPENDS=	libleveldb.so:databases/leveldb						LEVELDB_CMAKE_BOOL=	ENABLE_LEVELDB
REDIS_DESC=		Enable Redis backend							REDIS_DESC=		Enable Redis backend
REDIS_CMAKE_BOOL=	ENABLE_REDIS								REDIS_CMAKE_BOOL=	ENABLE_REDIS
REDIS_LIB_DEPENDS=	libhiredis.so:databases/hiredis						REDIS_LIB_DEPENDS=	libhiredis.so:databases/hiredis
SPATIAL_DESC=		Enable SpatialIndex AreaStore backend					SPATIAL_DESC=		Enable SpatialIndex AreaStore backend
SPATIAL_LIB_DEPENDS=	libspatialindex.so:devel/spatialindex					SPATIAL_LIB_DEPENDS=	libspatialindex.so:devel/spatialindex
SPATIAL_CMAKE_BOOL=	ENABLE_SPATIAL								SPATIAL_CMAKE_BOOL=	ENABLE_SPATIAL

NLS_CMAKE_BOOL=		ENABLE_GETTEXT								NLS_CMAKE_BOOL=		ENABLE_GETTEXT
NLS_USES=		gettext									NLS_USES=		gettext
NLS_LDFLAGS=		-L${LOCALBASE}/lib							NLS_LDFLAGS=		-L${LOCALBASE}/lib

.include <bsd.port.options.mk>									.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MCLIENT} && ${PORT_OPTIONS:MSOUND}						.if ${PORT_OPTIONS:MCLIENT} && ${PORT_OPTIONS:MSOUND}
USES+=		openal										USES+=		openal
LIB_DEPENDS+=	libvorbis.so:audio/libvorbis \							LIB_DEPENDS+=	libvorbis.so:audio/libvorbis \
		libogg.so:audio/libogg										libogg.so:audio/libogg
.endif												.endif

.if ${PORT_OPTIONS:MSERVER}									.if ${PORT_OPTIONS:MSERVER}
USE_RC_SUBR=	${PORTNAME}									USE_RC_SUBR=	${PORTNAME}
USERS=		${PORTNAME}									USERS=		${PORTNAME}
GROUPS=		${PORTNAME}									GROUPS=		${PORTNAME}
.endif												.endif

# hacky way to not bring irrlicht and X11 depends for server only				# hacky way to not bring irrlicht and X11 depends for server only
.if ! ${PORT_OPTIONS:MCLIENT} && ${PORT_OPTIONS:MSERVER}					.if ! ${PORT_OPTIONS:MCLIENT} && ${PORT_OPTIONS:MSERVER}
BUILD_DEPENDS+=	${NONEXISTENT}:x11-toolkits/irrlicht:patch					BUILD_DEPENDS+=	${NONEXISTENT}:x11-toolkits/irrlicht:patch
IRRLICHT_INCLUDE_DIR=	`${MAKE} -C ${PORTSDIR}/x11-toolkits/irrlicht -V WRKSRC`/include	IRRLICHT_INCLUDE_DIR=	`${MAKE} -C ${PORTSDIR}/x11-toolkits/irrlicht -V WRKSRC`/include
CMAKE_ARGS+=	-DIRRLICHT_INCLUDE_DIR:STRING="${IRRLICHT_INCLUDE_DIR}"				CMAKE_ARGS+=	-DIRRLICHT_INCLUDE_DIR:STRING="${IRRLICHT_INCLUDE_DIR}"
EXTRA_PATCHES+=	${FILESDIR}/extra-patch-irrlichtdepend						EXTRA_PATCHES+=	${FILESDIR}/extra-patch-irrlichtdepend
.endif												.endif

post-extract:											post-extract:
# make sure no bundled gmp is used								# make sure no bundled gmp is used
	@${RM} -rf ${WRKSRC}/lib/gmp									@${RM} -rf ${WRKSRC}/lib/gmp
# bundled jsoncpp is OK, see comment in cmake/Modules/FindJson.cmake				# bundled jsoncpp is OK, see comment in cmake/Modules/FindJson.cmake
#	(not sure if it affects FreeBSD, but too lazy to investigate)				#	(not sure if it affects FreeBSD, but too lazy to investigate)
# bundled lua is OK, there's no option to use system one					# bundled lua is OK, there's no option to use system one

post-patch:											post-patch:
	@${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|' \						@${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|' \
		${WRKSRC}/cmake/Modules/*.cmake									${WRKSRC}/cmake/Modules/*.cmake

.include <bsd.port.mk>										.include <bsd.port.mk>

In addition to the above adjustments to the Makefile, there may be a patch file which must be removed or hidden in order for my modified build to succeed.  The file is /usr/ports/games/files/patch-src_CMakeLists.txt

As you can see, my preference is for those things installed within the system as opposed to those which may be bundled as part of the tarball.  As yet I have not absolutely verified or conclusively tested whether the changes I made actually result in a speedier or more efficient minetest executable.  Take the above as you wish, choose to use it as described but I suggest caution if you further adjust the modifications.  Specifically, the LIB_DEPENDS should in most cases have a matching CMAKE_ARGS equivalent.

I believe the iconv:wchar_t which I removed relates to languages which would need wide characters, and this allows for conversions which may be necessary for that situation.  I will not be needing wide characters for my singleplayer or client gameplay, so that is safe for me to excise.  I do not know exactly how the cmake compiler:c++11-lang definition changes the way it is built but it is the one that works for me and my other adjustments.  The other CMAKE_ARGS item, -DCMAKE_BUILD_TYPE=MinSizeRel is there because I believe it is an improvement, it builds with it but I do not know exactly what its function or change is.

I would like to make a proper comparison between the vanilla install and my modification but this needs a bit more research and possibly additional software tools for testing.

Had I used portlint in the minetest directory at any time during my modification, I would have discovered a mistake in the original Makefile.  A report from portlint indicates that the USES= line should appear before any USE_ lines which in this specific example is USE_GITHUB=yes so if poudriere is used with portlint=yes, it may deny building.  Change this in the Makefile unless it gets fixed by the port maintainer first, but then make note that my Makefile had the flaw and so do not restore that flaw by copying it from above.

Update - March 2021

The port maintainer has since adopted some changes with recent updates to minetest by upstream causing this port to be reexamined.  I have also decided to look over my changes and how they relate to the current Makefile and try to make any possible improvements for myself which would enhance performance.  I am also going to submit a few bug reports for this port so that my changes can be affected officially.  The primary one being that the patch I remove is not necessary because it can be accomplished properly by cmake arguements.  I may have missed some things or made slightly incorrect adjustments my first time through, even though the changes may have been appropriate and correct aside from syntax. So lets see how the current modified Makefile looks as the comparison below illustrates today, March 30, 2021.

First the hard-coded default method which is similar to my previous modification from back in October.

diff
# Created by: Dmitry Marakasov <amdmi3@FreeBSD.org>						# Created by: Dmitry Marakasov <amdmi3@FreeBSD.org>
# $FreeBSD$												# $FreeBSD$

PORTNAME=	minetest										PORTNAME=	minetest
PORTVERSION=	5.4.0											PORTVERSION=	5.4.0
PORTREVISION=	1											PORTREVISION=	1
CATEGORIES=	games											CATEGORIES=	games

MAINTAINER=	amdmi3@FreeBSD.org									MAINTAINER=	amdmi3@FreeBSD.org
COMMENT=	Near-infinite-world block sandbox game							COMMENT=	Near-infinite-world block sandbox game

LICENSE=	LGPL21+											LICENSE=	LGPL21+
LICENSE_FILE=	${WRKSRC}/doc/lgpl-2.1.txt								LICENSE_FILE=	${WRKSRC}/doc/lgpl-2.1.txt

LIB_DEPENDS=	libsqlite3.so:databases/sqlite3 \						|       LIB_DEPENDS=	libgmp.so:math/gmp \
		libgmp.so:math/gmp \								|       		libjsoncpp.so:devel/jsoncpp \
		libjsoncpp.so:devel/jsoncpp							|       		libsqlite3.so:databases/sqlite3

USE_GITHUB=	yes										<
GH_ACCOUNT=	minetest									<
												<
USES=		cmake compiler:c11 iconv:wchar_t							USES=		cmake compiler:c11 iconv:wchar_t
CMAKE_ARGS=	-DCUSTOM_MANDIR="${PREFIX}/man" \						|       CMAKE_ARGS=	-DBUILD_UNITTESTS="FALSE" \
												>       		-DCMAKE_BUILD_TYPE="MinSizeRel" \
		-DCUSTOM_EXAMPLE_CONF_DIR="${PREFIX}/etc" \								-DCUSTOM_EXAMPLE_CONF_DIR="${PREFIX}/etc" \
		-DENABLE_SYSTEM_JSONCPP=ON							|       		-DCUSTOM_MANDIR="${PREFIX}/man" \
												>       		-DENABLE_SYSTEM_GMP="ON" \
												>       		-DENABLE_SYSTEM_JSONCPP="ON" \
												>       		-DJSON_INCLUDE_DIR="${PREFIX}/include/jsoncpp" \
												>       		-DOPENGL_GL_PREFERENCE="GLVND" \
												>       		-DREQUIRE_LUAJIT="ON"
												>       #		-DVERSION_EXTRA="_${PORTREVISION}"
												>       # OpenGL_GL_PREFERENCE Allowed values are 'GLVND' and 'LEGACY'
												>       # See CMake Policy CMP0072 for reference. GLVND is broken on some nvidia setups, so use LEGACY instead.

												>       USE_GITHUB=	yes
												>       GH_ACCOUNT=	minetest
												>
LDFLAGS_i386=	-Wl,-znotext										LDFLAGS_i386=	-Wl,-znotext

PORTDATA=	*											PORTDATA=	*
PORTDOCS=	*											PORTDOCS=	*

OPTIONS_DEFINE=	CURL SOUND FREETYPE NCURSES LUAJIT \						|       OPTIONS_DEFINE=	CURL DOCS EXAMPLES FREETYPE LUAJIT NCURSES NLS SOUND
		DOCS EXAMPLES NLS								<
OPTIONS_MULTI=	COMP											OPTIONS_MULTI=	COMP
OPTIONS_GROUP=	DATABASE										OPTIONS_GROUP=	DATABASE

COMP_DESC=		Software components								COMP_DESC=		Software components
OPTIONS_MULTI_COMP=	CLIENT SERVER									OPTIONS_MULTI_COMP=	CLIENT SERVER

DATABASE_DESC=		Database support								DATABASE_DESC=		Database support
OPTIONS_GROUP_DATABASE=	PGSQL LEVELDB REDIS SPATIAL						|       OPTIONS_GROUP_DATABASE=	LEVELDB PGSQL REDIS SPATIAL

OPTIONS_DEFAULT=	CLIENT SERVER \								|       OPTIONS_DEFAULT=	CLIENT CURL FREETYPE LUAJIT NCURSES SERVER SOUND
			CURL SOUND FREETYPE NCURSES LUAJIT					<
OPTIONS_SUB=		yes										OPTIONS_SUB=		yes

CLIENT_DESC=		Build client									CLIENT_DESC=		Build client
CLIENT_CMAKE_BOOL=	BUILD_CLIENT									CLIENT_CMAKE_BOOL=	BUILD_CLIENT
CLIENT_LIB_DEPENDS=	libpng.so:graphics/png \						|       CLIENT_LIB_DEPENDS=	libIrrlicht.so:x11-toolkits/irrlicht \
			libIrrlicht.so:x11-toolkits/irrlicht					|       			libpng.so:graphics/png
CLIENT_USES=		gl jpeg xorg									CLIENT_USES=		gl jpeg xorg
CLIENT_USE=		GL=gl XORG=x11,xext,xxf86vm						|       CLIENT_USE=		GL=gl \
												>       			XORG=x11,xext,xxf86vm
SERVER_DESC=		Build server									SERVER_DESC=		Build server
SERVER_CMAKE_BOOL=	BUILD_SERVER									SERVER_CMAKE_BOOL=	BUILD_SERVER

CURL_DESC=		Enable cURL support for fetching media						CURL_DESC=		Enable cURL support for fetching media
CURL_CMAKE_BOOL=	ENABLE_CURL									CURL_CMAKE_BOOL=	ENABLE_CURL
CURL_LIB_DEPENDS=	libcurl.so:ftp/curl								CURL_LIB_DEPENDS=	libcurl.so:ftp/curl
SOUND_DESC=		Enable sound									SOUND_DESC=		Enable sound
SOUND_CMAKE_BOOL=	ENABLE_SOUND									SOUND_CMAKE_BOOL=	ENABLE_SOUND
FREETYPE_DESC=		Support for TrueType fonts with unicode						FREETYPE_DESC=		Support for TrueType fonts with unicode
FREETYPE_CMAKE_BOOL=	ENABLE_FREETYPE									FREETYPE_CMAKE_BOOL=	ENABLE_FREETYPE
FREETYPE_LIB_DEPENDS=	libfreetype.so:print/freetype2							FREETYPE_LIB_DEPENDS=	libfreetype.so:print/freetype2
NCURSES_DESC=		Enable ncurses console								NCURSES_DESC=		Enable ncurses console
NCURSES_CMAKE_BOOL=	ENABLE_CURSES									NCURSES_CMAKE_BOOL=	ENABLE_CURSES
NCURSES_USES=		ncurses										NCURSES_USES=		ncurses

LUAJIT_DESC=		LuaJIT support									LUAJIT_DESC=		LuaJIT support
LUAJIT_CMAKE_BOOL=	ENABLE_LUAJIT REQUIRE_LUAJIT							LUAJIT_CMAKE_BOOL=	ENABLE_LUAJIT REQUIRE_LUAJIT
LUAJIT_LIB_DEPENDS=	libluajit-5.1.so:lang/luajit-openresty						LUAJIT_LIB_DEPENDS=	libluajit-5.1.so:lang/luajit-openresty

PGSQL_USES=		pgsql										PGSQL_USES=		pgsql
PGSQL_CMAKE_BOOL=	ENABLE_POSTGRESQL								PGSQL_CMAKE_BOOL=	ENABLE_POSTGRESQL
LEVELDB_DESC=		Enable LevelDB backend								LEVELDB_DESC=		Enable LevelDB backend
LEVELDB_CMAKE_BOOL=	ENABLE_LEVELDB									LEVELDB_CMAKE_BOOL=	ENABLE_LEVELDB
LEVELDB_LIB_DEPENDS=	libleveldb.so:databases/leveldb							LEVELDB_LIB_DEPENDS=	libleveldb.so:databases/leveldb
REDIS_DESC=		Enable Redis backend								REDIS_DESC=		Enable Redis backend
REDIS_CMAKE_BOOL=	ENABLE_REDIS									REDIS_CMAKE_BOOL=	ENABLE_REDIS
REDIS_LIB_DEPENDS=	libhiredis.so:databases/hiredis							REDIS_LIB_DEPENDS=	libhiredis.so:databases/hiredis
SPATIAL_DESC=		Enable SpatialIndex AreaStore backend						SPATIAL_DESC=		Enable SpatialIndex AreaStore backend
SPATIAL_LIB_DEPENDS=	libspatialindex.so:devel/spatialindex						SPATIAL_LIB_DEPENDS=	libspatialindex.so:devel/spatialindex
SPATIAL_CMAKE_BOOL=	ENABLE_SPATIAL									SPATIAL_CMAKE_BOOL=	ENABLE_SPATIAL

NLS_CMAKE_BOOL=		ENABLE_GETTEXT								|       NLS_CMAKE_BOOL=	ENABLE_GETTEXT
NLS_USES=		gettext									|       NLS_USES=	gettext
NLS_LDFLAGS=		-L${LOCALBASE}/lib							|       NLS_LDFLAGS=	-L${LOCALBASE}/lib

.include <bsd.port.options.mk>										.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MCLIENT} && ${PORT_OPTIONS:MSOUND}							.if ${PORT_OPTIONS:MCLIENT} && ${PORT_OPTIONS:MSOUND}
USES+=		openal											USES+=		openal
LIB_DEPENDS+=	libvorbis.so:audio/libvorbis \							|       LIB_DEPENDS+=	libogg.so:audio/libogg \
		libogg.so:audio/libogg								|       		libvorbis.so:audio/libvorbis
.endif													.endif

.if ${PORT_OPTIONS:MSERVER}										.if ${PORT_OPTIONS:MSERVER}
USE_RC_SUBR=	${PORTNAME}										USE_RC_SUBR=	${PORTNAME}
USERS=		${PORTNAME}										USERS=		${PORTNAME}
GROUPS=		${PORTNAME}										GROUPS=		${PORTNAME}
.endif													.endif

# hacky way to not bring irrlicht and X11 depends for server only					# hacky way to not bring irrlicht and X11 depends for server only
.if ! ${PORT_OPTIONS:MCLIENT} && ${PORT_OPTIONS:MSERVER}						.if ! ${PORT_OPTIONS:MCLIENT} && ${PORT_OPTIONS:MSERVER}
BUILD_DEPENDS+=	${NONEXISTENT}:x11-toolkits/irrlicht:patch					|       BUILD_DEPENDS+=		${NONEXISTENT}:x11-toolkits/irrlicht:patch
IRRLICHT_INCLUDE_DIR=	`${MAKE} -C ${PORTSDIR}/x11-toolkits/irrlicht -V WRKSRC`/include		IRRLICHT_INCLUDE_DIR=	`${MAKE} -C ${PORTSDIR}/x11-toolkits/irrlicht -V WRKSRC`/include
CMAKE_ARGS+=	-DIRRLICHT_INCLUDE_DIR:STRING="${IRRLICHT_INCLUDE_DIR}"				|       CMAKE_ARGS+=		-DIRRLICHT_INCLUDE_DIR:STRING="${IRRLICHT_INCLUDE_DIR}"
EXTRA_PATCHES+=	${FILESDIR}/extra-patch-irrlichtdepend						|       EXTRA_PATCHES+=		${FILESDIR}/extra-patch-irrlichtdepend
.endif													.endif

post-extract:												post-extract:
# make sure no bundled gmp is used									# make sure no bundled gmp is used
	@${RM} -rf ${WRKSRC}/lib/gmp ${WRKSRC}/lib/jsoncpp							@${RM} -rf ${WRKSRC}/lib/gmp ${WRKSRC}/lib/jsoncpp
# bundled lua is OK, there's no option to use system one						# bundled lua is OK, there's no option to use system one

post-patch:												post-patch:
	@${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|' \							@${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|' \
		${WRKSRC}/cmake/Modules/*.cmake										${WRKSRC}/cmake/Modules/*.cmake

.include <bsd.port.mk>											.include <bsd.port.mk>

Sometime after deciding that the above was perfected, I realized that if I am to eventually submit a bug report to the maintainer for improvement, that I might attempt a more rococo version which will have all the option configs that interest me exposed to the light of day rather than hiding in the shadows of a developer's documentation.  This much more complex version will take a bit of effort to perfect and I still may flub something.  My makefile (below) permits the user to choose bundled gmp or jsoncpp rather than deciding that either is not desirable.

diff
# Created by: Dmitry Marakasov <amdmi3@FreeBSD.org>							# Created by: Dmitry Marakasov <amdmi3@FreeBSD.org>
# $FreeBSD$												# $FreeBSD$

PORTNAME=	minetest										PORTNAME=	minetest
PORTVERSION=	5.4.0											PORTVERSION=	5.4.0
PORTREVISION=	1											PORTREVISION=	1
CATEGORIES=	games											CATEGORIES=	games

MAINTAINER=	amdmi3@FreeBSD.org									MAINTAINER=	amdmi3@FreeBSD.org
COMMENT=	Near-infinite-world block sandbox game							COMMENT=	Near-infinite-world block sandbox game

LICENSE=	LGPL21+											LICENSE=	LGPL21+
LICENSE_FILE=	${WRKSRC}/doc/lgpl-2.1.txt								LICENSE_FILE=	${WRKSRC}/doc/lgpl-2.1.txt

LIB_DEPENDS=	libsqlite3.so:databases/sqlite3 \						|       LIB_DEPENDS=	libsqlite3.so:databases/sqlite3
		libgmp.so:math/gmp \								<
		libjsoncpp.so:devel/jsoncpp							<

USE_GITHUB=	yes										<
GH_ACCOUNT=	minetest									<
												<
USES=		cmake compiler:c11 iconv:wchar_t							USES=		cmake compiler:c11 iconv:wchar_t
CMAKE_ARGS=	-DCUSTOM_MANDIR="${PREFIX}/man" \						|       CMAKE_ARGS=	-DBUILD_UNITTESTS="FALSE" \
												>       		-DCMAKE_BUILD_TYPE="MinSizeRel" \
		-DCUSTOM_EXAMPLE_CONF_DIR="${PREFIX}/etc" \								-DCUSTOM_EXAMPLE_CONF_DIR="${PREFIX}/etc" \
		-DENABLE_SYSTEM_JSONCPP=ON							|       		-DCUSTOM_MANDIR="${PREFIX}/man"
												>       #               -DVERSION_EXTRA="_${PORTREVISION}"  # Except that there is an automatic added dash seperator.
												>       # OpenGL_GL_PREFERENCE Allowed values are 'GLVND' and 'LEGACY'
												>       # See CMake Policy CMP0072 for reference: cmake --help-policy CMP0072. GLVND is broken on some nvidia setups, so use LEGACY instead.

												>       USE_GITHUB=	yes
												>       GH_ACCOUNT=	minetest
												>
LDFLAGS_i386=	-Wl,-znotext										LDFLAGS_i386=	-Wl,-znotext

PORTDATA=	*											PORTDATA=	*
PORTDOCS=	*											PORTDOCS=	*

OPTIONS_DEFINE=	CURL SOUND FREETYPE NCURSES LUAJIT \						|       OPTIONS_DEFINE=	CURL DOCS EXAMPLES FREETYPE LUAJIT NCURSES NLS SOUND SYSTEM_GMP \
		DOCS EXAMPLES NLS								|       		SYSTEM_JSONCPP
OPTIONS_MULTI=	COMP											OPTIONS_MULTI=	COMP
												>       OPTIONS_RADIO=	GRAPHICS
OPTIONS_GROUP=	DATABASE										OPTIONS_GROUP=	DATABASE

COMP_DESC=		Software components								COMP_DESC=		Software components
OPTIONS_MULTI_COMP=	CLIENT SERVER									OPTIONS_MULTI_COMP=	CLIENT SERVER

												>       OPTIONS_RADIO_GRAPHICS=	GLVND LEGACY
												>
												>       SYSTEM_GMP_DESC=		Use gmp from ports (ENABLE_SYSTEM_GMP)
												>       SYSTEM_GMP_CMAKE_BOOL=		ENABLE_SYSTEM_GMP
												>       SYSTEM_GMP_CMAKE_ON=		-DGMP_INCLUDE_DIR="${PREFIX}/include"
												>       SYSTEM_GMP_LIB_DEPENDS=		libgmp.so:math/gmp
												>
												>       SYSTEM_JSONCPP_DESC=		Use jsoncpp from ports (ENABLE_SYSTEM_JSONCPP)
												>       SYSTEM_JSONCPP_CMAKE_BOOL=	ENABLE_SYSTEM_JSONCPP
												>       SYSTEM_JSONCPP_CMAKE_ON=	-DJSON_INCLUDE_DIR="${PREFIX}/include/jsoncpp"
												>       SYSTEM_JSONCPP_LIB_DEPENDS=	libjsoncpp.so:devel/jsoncpp
												>
												>       GRAPHICS_DESC=		Graphics support
												>       GLVND_DESC=		Use libOpenGL or libGLX
												>       LEGACY_DESC=		Use libGL - where GLVND may be broken on nvidia
												>
												>       GLVND_CMAKE_ON=		-DOPENGL_GL_PREFERENCE="GLVND"
												>       LEGACY_CMAKE_ON=	-DOPENGL_GL_PREFERENCE="LEGACY"
												>
DATABASE_DESC=		Database support								DATABASE_DESC=		Database support
OPTIONS_GROUP_DATABASE=	PGSQL LEVELDB REDIS SPATIAL						|       OPTIONS_GROUP_DATABASE=	LEVELDB PGSQL REDIS SPATIAL

OPTIONS_DEFAULT=	CLIENT SERVER \								|       OPTIONS_DEFAULT=	CLIENT CURL FREETYPE GLVND LUAJIT NCURSES SERVER SOUND \
			CURL SOUND FREETYPE NCURSES LUAJIT					|       			SYSTEM_GMP SYSTEM_JSONCPP
OPTIONS_SUB=		yes										OPTIONS_SUB=		yes

CLIENT_DESC=		Build client									CLIENT_DESC=		Build client
CLIENT_CMAKE_BOOL=	BUILD_CLIENT									CLIENT_CMAKE_BOOL=	BUILD_CLIENT
CLIENT_LIB_DEPENDS=	libpng.so:graphics/png \						|       CLIENT_LIB_DEPENDS=	libIrrlicht.so:x11-toolkits/irrlicht \
			libIrrlicht.so:x11-toolkits/irrlicht					|       			libpng.so:graphics/png
CLIENT_USES=		gl jpeg xorg									CLIENT_USES=		gl jpeg xorg
CLIENT_USE=		GL=gl XORG=x11,xext,xxf86vm						|       CLIENT_USE=		GL=gl \
												>       			XORG=x11,xext,xxf86vm
SERVER_DESC=		Build server									SERVER_DESC=		Build server
SERVER_CMAKE_BOOL=	BUILD_SERVER									SERVER_CMAKE_BOOL=	BUILD_SERVER

CURL_DESC=		Enable cURL support for fetching media						CURL_DESC=		Enable cURL support for fetching media
CURL_CMAKE_BOOL=	ENABLE_CURL									CURL_CMAKE_BOOL=	ENABLE_CURL
CURL_LIB_DEPENDS=	libcurl.so:ftp/curl								CURL_LIB_DEPENDS=	libcurl.so:ftp/curl
SOUND_DESC=		Enable sound									SOUND_DESC=		Enable sound
SOUND_CMAKE_BOOL=	ENABLE_SOUND									SOUND_CMAKE_BOOL=	ENABLE_SOUND
FREETYPE_DESC=		Support for TrueType fonts with unicode						FREETYPE_DESC=		Support for TrueType fonts with unicode
FREETYPE_CMAKE_BOOL=	ENABLE_FREETYPE									FREETYPE_CMAKE_BOOL=	ENABLE_FREETYPE
FREETYPE_LIB_DEPENDS=	libfreetype.so:print/freetype2							FREETYPE_LIB_DEPENDS=	libfreetype.so:print/freetype2
NCURSES_DESC=		Enable ncurses console								NCURSES_DESC=		Enable ncurses console
NCURSES_CMAKE_BOOL=	ENABLE_CURSES									NCURSES_CMAKE_BOOL=	ENABLE_CURSES
NCURSES_USES=		ncurses										NCURSES_USES=		ncurses

LUAJIT_DESC=		LuaJIT support									LUAJIT_DESC=		LuaJIT support
LUAJIT_CMAKE_BOOL=	ENABLE_LUAJIT REQUIRE_LUAJIT							LUAJIT_CMAKE_BOOL=	ENABLE_LUAJIT REQUIRE_LUAJIT
LUAJIT_LIB_DEPENDS=	libluajit-5.1.so:lang/luajit-openresty						LUAJIT_LIB_DEPENDS=	libluajit-5.1.so:lang/luajit-openresty

PGSQL_USES=		pgsql										PGSQL_USES=		pgsql
PGSQL_CMAKE_BOOL=	ENABLE_POSTGRESQL								PGSQL_CMAKE_BOOL=	ENABLE_POSTGRESQL
LEVELDB_DESC=		Enable LevelDB backend								LEVELDB_DESC=		Enable LevelDB backend
LEVELDB_CMAKE_BOOL=	ENABLE_LEVELDB									LEVELDB_CMAKE_BOOL=	ENABLE_LEVELDB
LEVELDB_LIB_DEPENDS=	libleveldb.so:databases/leveldb							LEVELDB_LIB_DEPENDS=	libleveldb.so:databases/leveldb
REDIS_DESC=		Enable Redis backend								REDIS_DESC=		Enable Redis backend
REDIS_CMAKE_BOOL=	ENABLE_REDIS									REDIS_CMAKE_BOOL=	ENABLE_REDIS
REDIS_LIB_DEPENDS=	libhiredis.so:databases/hiredis							REDIS_LIB_DEPENDS=	libhiredis.so:databases/hiredis
SPATIAL_DESC=		Enable SpatialIndex AreaStore backend						SPATIAL_DESC=		Enable SpatialIndex AreaStore backend
SPATIAL_LIB_DEPENDS=	libspatialindex.so:devel/spatialindex						SPATIAL_LIB_DEPENDS=	libspatialindex.so:devel/spatialindex
SPATIAL_CMAKE_BOOL=	ENABLE_SPATIAL									SPATIAL_CMAKE_BOOL=	ENABLE_SPATIAL

NLS_CMAKE_BOOL=		ENABLE_GETTEXT								|       NLS_CMAKE_BOOL=	ENABLE_GETTEXT
NLS_USES=		gettext									|       NLS_USES=	gettext
NLS_LDFLAGS=		-L${LOCALBASE}/lib							|       NLS_LDFLAGS=	-L${LOCALBASE}/lib

.include <bsd.port.options.mk>										.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MCLIENT} && ${PORT_OPTIONS:MSOUND}							.if ${PORT_OPTIONS:MCLIENT} && ${PORT_OPTIONS:MSOUND}
USES+=		openal											USES+=		openal
LIB_DEPENDS+=	libvorbis.so:audio/libvorbis \							|       LIB_DEPENDS+=	libogg.so:audio/libogg \
		libogg.so:audio/libogg								|       		libvorbis.so:audio/libvorbis
.endif													.endif

.if ${PORT_OPTIONS:MSERVER}										.if ${PORT_OPTIONS:MSERVER}
USE_RC_SUBR=	${PORTNAME}										USE_RC_SUBR=	${PORTNAME}
USERS=		${PORTNAME}										USERS=		${PORTNAME}
GROUPS=		${PORTNAME}										GROUPS=		${PORTNAME}
.endif													.endif

# hacky way to not bring irrlicht and X11 depends for server only					# hacky way to not bring irrlicht and X11 depends for server only
.if ! ${PORT_OPTIONS:MCLIENT} && ${PORT_OPTIONS:MSERVER}						.if ! ${PORT_OPTIONS:MCLIENT} && ${PORT_OPTIONS:MSERVER}
BUILD_DEPENDS+=	${NONEXISTENT}:x11-toolkits/irrlicht:patch					|       BUILD_DEPENDS+=		${NONEXISTENT}:x11-toolkits/irrlicht:patch
IRRLICHT_INCLUDE_DIR=	`${MAKE} -C ${PORTSDIR}/x11-toolkits/irrlicht -V WRKSRC`/include		IRRLICHT_INCLUDE_DIR=	`${MAKE} -C ${PORTSDIR}/x11-toolkits/irrlicht -V WRKSRC`/include
CMAKE_ARGS+=	-DIRRLICHT_INCLUDE_DIR:STRING="${IRRLICHT_INCLUDE_DIR}"				|       CMAKE_ARGS+=		-DIRRLICHT_INCLUDE_DIR:STRING="${IRRLICHT_INCLUDE_DIR}"
EXTRA_PATCHES+=	${FILESDIR}/extra-patch-irrlichtdepend						|       EXTRA_PATCHES+=		${FILESDIR}/extra-patch-irrlichtdepend
.endif													.endif
												>       # From wiki:
												>       #  Building without Irrlicht / X dependency
												>       # You can build the Minetest server without library dependencies to Irrlicht or any graphical stuff.
												>       # You still need the Irrlicht headers for this, so first, download the irrlicht source to somewhere.
												>       #
												>       # When invoking CMake, use -DBUILD_CLIENT=0 -DIRRLICHT_SOURCE_DIR=/wherever/you/unzipped/the/source.

post-extract:											|       #post-extract:
# make sure no bundled gmp is used									# make sure no bundled gmp is used
	@${RM} -rf ${WRKSRC}/lib/gmp ${WRKSRC}/lib/jsoncpp					|       #	@${RM} -rf ${WRKSRC}/lib/gmp ${WRKSRC}/lib/jsoncpp
# bundled lua is OK, there's no option to use system one						# bundled lua is OK, there's no option to use system one

post-patch:												post-patch:
	@${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|' \							@${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|' \
		${WRKSRC}/cmake/Modules/*.cmake										${WRKSRC}/cmake/Modules/*.cmake

.include <bsd.port.mk>											.include <bsd.port.mk>

As before and with any of my modifications above, in addition to the above adjustments to the Makefile, there may be a patch file which must be removed or hidden in order for my modified build to succeed.  The file is /usr/ports/games/files/patch-src_CMakeLists.txt.  The final result comparison of the ncurses configuration menu for default (as it is in ports now) on the left and my new rococo version on the right.

 

It should be noted that while these modifications are not yet made official (and I cannot say for certain if they will be since my philosophy/understanding may be different than the maintainer) this port is also not set to be built locally by poudriere.  Poudriere handles updates to the ports tree in a manner which any local changes would become an extra hassle as it wishes to maintain an exact duplicate, and so instead I will be adding games/minetest to the blacklist, keeping it out of the poudriere repo.

I will build it "manually" from ports and use gitup to keep a seperate /usr/ports tree updated without repairing (wiping out) my changes or at least not complaining when it does so.  This seems to be the most reasonable method to have local modified Makefiles for any relatively small subset of ports.  I thought I might periodically revisit this port for any improvements I can make to its Makefile which meant this blog post could become rather long over time and be re-published but have since decided against this.

Some links relating to this post:

Frequently viewed this week