Warning: there may be occasional oddness due to css and blog edits. **KNOWN ISSUE: possible hidden text**
Showing posts with label Games. Show all posts
Showing posts with label Games. Show all posts

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.

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 otherwaise 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 game 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 sucessful 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.

minetest-dev:

PORTNAME=	minetest
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 

irrlichtMt:

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 CMAKE_SOURCE_PATH=${WRKDIR}/irrlicht-master or WRKSRC=${WRKDIR}/irrlicht-master lines 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 regardless of 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
Minetest gallery pic

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.

# 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 canbe 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.

# 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.

# 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.  Bug report for games/minetest to propose my revised Makefile.

Frequently viewed this week