Warning: there may be occasional oddness due to css and blog edits. **KNOWN ISSUE: possible hidden text**
Showing posts with label modification. Show all posts
Showing posts with label modification. 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.

Sunday, February 21, 2021

Kerberos ain't average

The average home user is unlikely to have need of the special security capabilities of kerberos, heimdal, or the various GSSAPI options.  We who will have no need of it, can exclude it from our kernel and world configurations, and also deny any options from ports which require or use it.  This is a rather easy adjustment in general, but the complete process includes rebuilding your kernel. For those who would rather avoid customizing their kernel away from default, a customized make.conf which avoids all things kerberos will be at least as useful as the whole enchilada.

The make.conf adjustments I will provide first, as it is the minimum effective action to eliminate the unneeded security tool and any complications it causes.  The adjustments for a custom kernel will be after, with a reminder section on rebuilding the kernel.  Add the following lines to your /etc/make.conf as general configuration option overrides.

OPTIONS_UNSET+=KERBEROS HEIMDAL MIT HEIMDAL_BASE KERB_GSSAPI GSSAPI_BASE GSSAPI_MIT GSSAPI_HEIMDAL
OPTIONS_SET+=GSSAPI_NONE

In my opinion the port option MIT should instead be MIT_KERB to make it a bit more specific and obvious, as presently away from specific ports it has no context to clarify it which could be problematic.

A list of ports which are in some way tied to kerberos as a dependency.  I have this in my poudriere blacklist but you can remove or avoid building them.

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# kerberos or heimdal or gssapi stuff not needed        #
#_______________________________________________________#
net-mgmt/nagstamon
net/rubygem-omniauth-kerberos
security/cyrus-sasl2-gssapi
security/heimdal
security/krb5-appl
security/krb5-devel
security/p5-Authen-Krb5
security/p5-Authen-Krb5-Simple
security/p5-Authen-Simple-Kerberos
security/p5-GSSAPI
security/p5-Heimdal-Kadm5
security/pam_krb5
security/py-flask-kerberos
security/py-gssapi
security/py-kerberos
security/py-pywinrm
security/py-requests-kerberos
security/rubygem-gssapi
www/gitlab-ce
www/mod_auth_gssapi
www/mod_auth_kerb2

A list of ports that you may need to rebuild because they have options which by default tie them to GSSAPI which is related to kerberos and by our adjustments will no longer be needed, will not function.

benchmarks/polygraph
comms/conserver-com
devel/cvs-devel
devel/rudiments
dns/bind9-devel
dns/bind911
dns/samba-nsupdate
editors/libreoffice
ftp/curl
mail/cyrus-imapd23
mail/cyrus-imapd24
mail/cyrus-imapd25
mail/cyrus-imapd30
mail/dovecot
mail/dovecot-pigeonhole
mail/fetchmail
mail/mailutils
mail/mutt
net/nss_ldap
net/ocserv
net/openldap24-server
net/wireshark
net-mgmt/adcli
news/inn
print/cups
security/cyrus-sasl2
security/cyrus-sasl2-saslauthd
security/ipsec-tools
security/libssh
security/openssh-portable
security/p5-Authen-SASL
security/putty
security/racoon2
security/sssd
sysutils/msktutil
sysutils/rsyslog8
sysutils/rubygem-winrm
www/lighttpd
www/neon
www/nginx
www/nginx-devel
www/serf
www/squid
www/squid-devel

Making adjustments to /etc/src.conf is another way to customize your kernel or world.  These type of adjustments are listed in man 5 src.conf and the build process is described in man 7 build if you would like to learn more.  The specific lines we will add are below, you could place values after the equal sign but those are not necessary.

WITHOUT_KERBEROS=
WITHOUT_KERBEROS_SUPPORT=
WITHOUT_GSSAPI=

The next steps are the same as for any kernel and world build, and reinstall.  It would be a good idea to update your /usr/src so that you can take care of two things with one rebuild and reinstall but that is up to you.  However, you will certainly need to obtain the source code for your present version of the operating system before attempting only this kerberos excisement operation.  Look at the distilled page for updating kernel and world for the steps needed to rebuild.

Thursday, February 4, 2021

Configuring ports: an extensive make.conf

I may have mentioned before that I favor configuring my ports by maintaining a rather elaborate and extensive /etc/make.conf file.  It is always a good idea to include comments in any configuration file if there is a capability to have null or parser-ignored lines because this helps document for your future self or for sharing with others.  It is helpful to include any source url where the tip was found, including explanatory comments from other files such as those in the /usr/ports/Mk directory.  As this is fairly self-explanatory and my make.conf is heavily commented, I'll simply paste it below for your perusal.  With regard to the build process, the verbose make.conf will override any defaults given by the port Makefile which means that make rmconfig will revert the configuration options to those defined by the make.conf file instead of port defaults.  Long lines might not be nice for everyone but not an issue from an xterm window on my desktop, some options are grouped alphabetically for easier elimination of duplicates.

### make.conf
###############################################################################################################################################################################################################################################################
# There are a number of things you can do to reduce the size and number of files in /boot/kernel.
#
# Possibly the best space saving is to be had by setting WITHOUT_KERNEL_SYMBOLS in /etc/src.conf 
# (if this file doesn't already exist, just create it), and the next time you installkernel, the
# debug symbol files won't be installed. It's safe to delete them now, if you need the space 
# immediately (rm /boot/kernel/*.symbols)
#
# There are a few make.conf settings that control what modules are built:
#
#    NO_MODULES - disable building of modules completely
#    MODULES_OVERRIDE - specify the modules you want to build
#    WITHOUT_MODULES - list of modules that should not be built
#
# The NO_MODULES option is probably a bit too heavy-handed, so a judicious combination of the 
# other two is a better choice. If you know exactly which modules you want, you can simply set 
# them in MODULES_OVERRIDE. Note that WITHOUT_MODULES is evaluated after MODULES_OVERRIDE, so 
# any module named in both lists will not be built.
#
# If you really want to suppress building of all modules, you can use NO_MODULES, and ensure 
# that all required drivers and modules are statically compiled into the kernel. Each driver's 
# manpage shows the appropriate lines to add to your kernel config file, so you should be able 
# to figure out what you need.
###############################################################################################################################################################################################################################################################

#ALLOW_UNSUPPORTED_SYSTEM=true 
#DISABLE_VULNERABILITIES=yes

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# FreeBSD 13.x has many debugging features turned on, in both the kernel        #
# and userland.  These features attempt to detect incorrect use of              #
# system primitives, and encourage loud failure through extra sanity            #
# checking and fail stop semantics.  They also substantially impact             #
# system performance.  If you want to do performance measurement,               #
# benchmarking, and optimization, you'll want to turn them off.  This           #
# includes various WITNESS- related kernel options, INVARIANTS, malloc          #
# debugging flags in userland, and various verbose features in the              #
# kernel.  Many developers choose to disable these features on build            #
# machines to maximize performance.  (To completely disable malloc              #
# debugging, define MALLOC_PRODUCTION in /etc/make.conf                         #
#                                                                               #
# From /usr/src/UPDATING, #20200912:                                            #
#     The make.conf(5) MALLOC_PRODUCTION variable, used for disabling and       #
#     enabling assertions and statistics gathering in malloc(3), has been       #
#     migrated to a src.conf(5) WITH/WITHOUT_MALLOC_PRODUCTION option.          #
#                                                                               #
#     On stable branches, WITH_MALLOC_PRODUCTION is set by default, which       #
#     means that malloc(3) has assertions and statistics gathering disabled,    #
#     for improved performance.                                                 #
#                                                                               #
#     For backwards compatibility, the make.conf(5) MALLOC_PRODUCTION is still  #
#     honored, but it is now deprecated and undocumented.                       #
#MALLOC_PRODUCTION=yes								#
#_______________________________________________________________________________#


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# Use ccache for builds					#
#_______________________________________________________#

WITH_CCACHE_BUILD=yes

.if ${.CURDIR:M^/usr/src/}
CCACHE_DIR=/var/cache/base/ccache
.else
CCACHE_DIR=/var/cache/ccache
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
#WITH_DEBUG_PORTS+=editors/openoffice-devel		#
#WITH_DEBUG_PORTS+=editors/openoffice-4			#
#_______________________________________________________#


###############################################################################################################################################################################################################################################################

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# Universal DEFAULT versions					#
#_______________________________________________________________#

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# Prefer libressl for all things, build ports against security/libressl		#
# libressl-devel is often too new for rust-nightly etc				#
#_______________________________________________________________________________#
OPENSSL_PORT=           security/libressl
DEFAULT_VERSIONS+=SSL=libressl

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# Possible values: 60, 70, 80, 90, 10, 11, -devel 	#
# (to be used when non-base compiler is required)	#
#							#
# LLVM=10 may work but some ports struggle with it.	#
#_______________________________________________________#
DEFAULT_VERSIONS+=LLVM=11

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# Default python versions  -- there is NO python 3.5	#
# and 3.7 was too new for devel/ninja			#
# Possible values: 2.7, 3.6, 3.7, 3.8, 3.9		#
#							#
# Below as of 1-12-21					#
#PYTHON_DEFAULT?=        3.7				#
# Possible values: 2.7					#
#PYTHON2_DEFAULT?=       2.7				#
# Possible values: 3.6, 3.7, 3.8, 3.9			#
#PYTHON3_DEFAULT?=       3.9				#
#_______________________________________________________#
DEFAULT_VERSIONS+=python3=3.9
DEFAULT_VERSIONS+=python=3.9

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# Rust 							#
# While it may make some sense to have -nightly the 	#
# default, it is build fail prone or too new.		#
# Possible values: rust, rust-nightly			#
#_______________________________________________________#
DEFAULT_VERSIONS+=RUST=rust

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# Lua							#
# Possible values: 5.1, 5.2, 5.3, 5.4			#
#_______________________________________________________#
DEFAULT_VERSIONS+=LUA=5.4

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# make Linux infrastructure ports install mixed amd64/i386 CentOS 6 packages	#
#_______________________________________________________________________________#
DEFAULT_VERSIONS+=LINUX=c7

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
#  The graphics/jpeg port has been removed in favor of graphics/jpeg-turbo.	#
#  The former port was vulnerable and used an outdated ABI and API.		#
#										#
#  Please check your make configuration for JPEG_PORT and remove it or		#
#  set it to "jpeg-turbo" if it is currently set to "jpeg".			#
#_______________________________________________________________________________#
JPEG_PORT=graphics/jpeg-turbo

###############################################################################################################################################################################################################################################################
 
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# Changes in general to config toggles			#
#_______________________________________________________#

OPTIONS_UNSET+=A4 APE APPLEDEV ARCHDEF ATLAS AVX AVX2 
OPTIONS_UNSET+=BASH BONMIN BOOTSTRAP
OPTIONS_UNSET+=CCL CHEESE CHINESE CHROMECAST CMUCL CPACK CPU_CLIP
OPTIONS_UNSET+=DEBUG DEVD DTRACE 
OPTIONS_UNSET+=ECL EMACS_KEYS ENCODINGS ETERSOFT
OPTIONS_UNSET+=FAM FREERDP FRENCH 
OPTIONS_UNSET+=GCRYPT GEOCLUE GEOIP GEOLOC GLX GNOMEUI GNOMEVFS GPERFTOOLS GPOD GPS GPSD GRAPHITE GVFS 
OPTIONS_UNSET+=HAL HALD 
OPTIONS_UNSET+=IMOBILE INOTIFY INTEGER_SAMPLES IPOD IPOPT
OPTIONS_UNSET+=JACK JAPANESE
OPTIONS_UNSET+=KOREAN 
OPTIONS_UNSET+=LAPACK LDAP LIBBLURAY LIBEXECINFO LIBJTE LIBSIGSEGV LIRC LOCALE_DE LOCALE_RU 
OPTIONS_UNSET+=MARS MDNS MDNSRESPONDER METRIC MHASH MTPFS MTPZ MUPDF 
OPTIONS_UNSET+=NLS NTSC NVIDIA NVIT NVTHREADS 
OPTIONS_UNSET+=OPENBLAS OPENCV 
OPTIONS_UNSET+=PAL PERL_64BITINT PGSQL PSGHOSTSCRIPT PSHYBRID PULSEAUDIO PURPOSE 
OPTIONS_UNSET+=Q8BIT QPOASES QTWEBENGINE 
OPTIONS_UNSET+=RCC READLINE RUNROOT RUSSIAN RETEXTURE_FULL
OPTIONS_UNSET+=SAGE SAMBA SASL SCFB SMB SKYDRIVE SNDIO SPEECHD SPEED STATIC 
OPTIONS_UNSET+=TEST TOMCAT85 TOMCAT9 TPM
OPTIONS_UNSET+=UPNP 
OPTIONS_UNSET+=V4L 
OPTIONS_UNSET+=WEBENGINE WIIMOTEDEV WIKI_PUBLISHER 
OPTIONS_UNSET+=XBACKLIGHT 
OPTIONS_UNSET+=ZSH


OPTIONS_SET+=3DNOW 7ZIP 
OPTIONS_SET+=A52 AALIB AAC ALLSTAGES ALSA ANY2DJVU AOM API APNG ARMOR ASM ASS AUDIO AUDIOCD AVAHI
OPTIONS_SET+=BABEL BE_AMDGPU BEATPORT BE_NATIVE BOOST BROTLI BUNDLED_READLINE BZIP2
OPTIONS_SET+=CA_BUNDLE CACA CAIRO CBLAS CDDA2MP3 CDDA2OGG CDDB CERTS CLANG CLEARTYPE CLIENT COLORD COMPFACE COMPILER_RT COINMP CONFIG CONTRIB CPU_OPTS CRAFTY CRYPTO CRYPTOPP CUPS CURL 
OPTIONS_SET+=DBUS DCA DCRAW DESKTOPFILES DRILL DTS DUNSTIFY DVD DYNAMIC_ARCH DYNSIMD
OPTIONS_SET+=EDITOR EGL ELMUSIC ELSOUND ENCHANT ETCSYMLINK EXAMPLES EXIV EXPAT EXR EXTRAFONTS EXTRAS EYECANDY
OPTIONS_SET+=FAAC FAAD FAIRYMAX FETCHART FFMPEG FFTW FFTW3 FLAC FLANG FLITE FLUID FLUIDSYNTH FONTCONFIG FORTRAN FREETYPE FREI0R FRIBIDI 
OPTIONS_SET+=GAME GECKO GHOSTSCRIPT GIR GLASSFISH GLX GM GMP GNUCHESS GNUPG2 GOEMON GOLD GSL GSTREAMER GST_PLUGINS GUESTADDITIONS 
OPTIONS_SET+=HARFBUZZ HUNSPELL HYPRE 
OPTIONS_SET+=ICONV ICS_VCAL ID3TAG IJS IMAGEMAGICK IO_PTR IPV6 IRRLICHT 
OPTIONS_SET+=JASPER JAVA JPEG2000 JSON 
OPTIONS_SET+=KF5 KNIGHTCAP
OPTIONS_SET+=LADSPA LAME LARGE_STACK LASTFM LAUNCHER LCMS2 LHA LIBEDIT LIBEDIT_DL LIBFFI LIBPAPER LIBPLACEBO LIBPNG LIBRSVG2 LIBSSH2 LIBXML LIBYAML LIT LLD LLDB LLD_LINK LOCALE_EN LUAJIT LV2 LZ4 LZO 
OPTIONS_SET+=MAD MAN MAN3 MANPAGE MANPAGES MATERIALX MFX MIDI MIKMOD MLIR MMX MNG_OPTIMIZE MODPLUG MONO MP3 MP3OGG MPG123 MPEG2 MPI MT32EMU MTP MULTILIB MULTIPLICITY MUSEPACK MUSIC MYSQL 
OPTIONS_SET+=NCURSES NETLIB NETTLE NONFREE NOTIFY NUMPY 
OPTIONS_SET+=OBJC OGG OGRE ONIGURUMA OPENAL OPENAL_DLOPEN OPENCL OPENGL OPENH264 OPENJADE OPENMP OPENMPI OPTIMIZE OPTIMIZED_CFLAGS OPUS OSS 
OPTIONS_SET+=PANGO PANGOCAIRO PARALLEL_MARK PERL_MALLOC PETSC PHALANX PHYSFS PNG POPPLER PSPOPPLER PTHREADS PYCLANG PYGMENTS PYMALLOC PYSTEMMER
OPTIONS_SET+=QT5 QT5AGGBACKEND 
OPTIONS_SET+=RAR RDOFF REALRTSP RELEASE RELRO REMIX1 REMIX2 REMIX3 REMIX4 REPLAYGAIN RETEXTURE RHASH RTCPU RUNTIME 
OPTIONS_SET+=SAMPLERATE SBCL SCHROEDINGER SDL SDL1 SDL2 SDLCLIENT SDLGL SDL_AUDIO SDL_VIDEO SESSION_MGMT SHARED SHOUTCAST SIMD SIPHASH SKINS SLP SLURM SMPEG SNAPPY SOLUTIONS SOUND SOUNDTOUCH SPEEX SQLITE SSE SSE2 SSH STARTUP SUITESPARSE SVG SYSTEM_ZLIB 
OPTIONS_SET+=TAGLIB TAGSOUP TCL THEMES THEORA THREADS TIDYHTML5 TIMIDITYPLUS TKINTER TOC2MP3 TWOLAME TZDATA TZUPDATE 
OPTIONS_SET+=UDEV 
OPTIONS_SET+=VAAPI VALA VDPAU VIDEOREC VIEWER VKD3D VLC VOICE VORBIS VPX VULKAN 
OPTIONS_SET+=WATCHDOG WAVPACK WAYLAND WINEMAKER WXGTK 
OPTIONS_SET+=X11 X264 X265 XCB XGLK XINERAMA 
OPTIONS_SET+=YAML 
OPTIONS_SET+=ZIP ZIPPY ZLIB ZSTD ZVBI
## added for vlc, check if other option elsewhere triggered too.
OPTIONS_SET+=KATE


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
#  * Openblas, Netlib (cblas), and Atlas are all options for math routines.				#
#  * cblas seems to be ovewhelmingly used with games, and by py-numpy.					#
#    therefore set to prefer cblas and netlib								#
#													#
#  * qt-location is problematic and depended upon by qt-webengine					#
#													#
#  * egl purported better and more supported than glx							#
#													#
# libedit is BSD and lighter while readline is gpl/gnu -- better to use bundled readline than as port	#
#													#
#  * rhash is MIT, gcrypt is gnu/gpl, mhash is lgpl							#
#													#
#  * MTPFS and MTPZ are related to accessing mobile devices such as their internal storage.		#
#_______________________________________________________________________________________________________#


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
#  processor instructions support						#
#										#
#   older AMD processors do not have AVX or AVX2				#
#   https://en.wikipedia.org/wiki/Advanced_Vector_Extensions#CPUs_with_AVX2	#
#   AMD does have SSE2								#
#   newer AMD processors do not have 3dNow					#
#_______________________________________________________________________________#


#############################################        #######   #######   #######   ######   ######
####                                     ####      #######   #######   #######   ######   ######  
####  an UNSET always overrides a SET    ####    #######   #######   ######    ######   ######    
####                                     ####      #######   #######   #######   ######   ######  
#############################################        #######   #######   #######   ######   ######


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# Static needed for use with poudriere -- 		#
# revisit the memcached option when not experimental	#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/devel/ccache}
  NO_CCACHE=yes
  WITH_CCACHE_BUILD=no
.endif
.if ${.CURDIR:M*/ports/devel/ccache}
  OPTIONS_UNSET=DOCS
  OPTIONS_SET=CLANGLINK STATIC LLVMLINK
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# force pkg to have default: DOCS			#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/devel/json-glib}
OPTIONS_SET+=DOCS
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# force json-glib proper config for clutter dependency	#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/devel/json-glib}
OPTIONS_SET+=GIR
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# soundtouch - openmp incompatible at present		#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/audio/soundtouch}
  OPTIONS_UNSET+=OPENMP
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# slurm-wlm - trouble with HDF5				#
# fails if hdf5 is enabled and was built with CXX 	#
# circular dependency if hdf5 uses PARALLEL instead	#
# all other options build fine so are set.		#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/sysutils/slurm-wlm}
  OPTIONS_SET+=CURL DOCS GUI HWLOC IPMI MYSQL RRD
  OPTIONS_UNSET+=HDF5
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# hdf5 circular dependency caused by PARALLEL option	#
# radio button so should define both as appropriate	#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/science/hdf5}
  OPTIONS_SET+=CXX
  OPTIONS_UNSET+=PARALLEL
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# fontforge config					#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/print/fontforge}
  OPTIONS_UNSET+=GTK3
  OPTIONS_SET+=READLINE FREETYPE X11
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# freetype2 config					#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/print/freetype2}
  OPTIONS_UNSET+=DEBUG
  OPTIONS_SET+=V38 V40 TABLE_VALIDATION
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# net-snmp config					#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/net-mgmt/net-snmp}
  OPTIONS_SET+=MFD_REWRITES TKMIB
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# ode adjustments					#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/devel/ode}
  OPTIONS_UNSET+=GIMPACT OU
  OPTIONS_SET+=DOUBLE
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# exult radio conflict fix				#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/games/exult}
  OPTIONS_UNSET+=SDL1
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# heretic radio conflict fix				#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/games/heretic}
  OPTIONS_UNSET+=X11 SDL
  OPTIONS_SET+=FASTX11
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# uhexen2 radio conflict fix				#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/games/uhexen2}
  OPTIONS_UNSET+=MAD
.endif

 
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# instead radio conflict fix				#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/games/instead}
  OPTIONS_UNSET+=SDL
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# espeak radio conflict fix				#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/audio/espeak}
  OPTIONS_UNSET+=PORTAUDIO PULSEAUDIO
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# love luajit conflict 					#
#_______________________________________________________#

#.if ${.CURDIR:M*/ports/devel/love}
#  OPTIONS_UNSET+=LUAJIT
#.endif
.if ${.CURDIR:M*/ports/devel/love10}
  OPTIONS_UNSET+=LUAJIT
.endif
#.if ${.CURDIR:M*/ports/devel/love*}
#  OPTIONS_UNSET+=LUAJIT
#.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# openoffice config					#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/editors/openoffice-4}
  OPTIONS_UNSET+=MMEDIA GNOME GNOMEVFS
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# casadi build option failure				#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/math/casadi}
  OPTIONS_UNSET+=CLANG
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# xorg-drivers configuration -- if scfb ticked		#
# this causes scfb dependency and scfb being		#
# available to load which prevents my AMD graphics 	#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/x11-drivers/xorg-drivers}
  OPTIONS_SET+=AMDGPU ATI KEYBOARD LIBINPUT MOUSE VESA
  OPTIONS_UNSET+=NV SCFB
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# If options MANPAGE set requires DOCS too		#
# CPACK is experimental option right now.		#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/devel/cmake}
  OPTIONS_UNSET=CPACK
  OPTIONS_SET=DOCS MANPAGES
.endif
.if ${.CURDIR:M*/ports/devel/kf5-extra-cmake-modules}
  OPTIONS_SET+=DOCS
.endif
.if ${.CURDIR:M*/ports/devel/ncurses}
  OPTIONS_SET+=DOCS PROFILE
.endif
.if ${.CURDIR:M*/ports/graphics/waffle}
  OPTIONS_SET+=DOCS
.endif
.if ${.CURDIR:M*/ports/devel/ocl-icd}
  OPTIONS_SET+=DOCS
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# add some capabilities, all non-defaults, and		#
# test removing fortran option to see what breaks	#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/math/coinmp}
  OPTIONS_SET+=GLPK PARALLEL
  OPTIONS_UNSET+=FORTRAN
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# libressl configuration				#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/security/libressl}
  OPTIONS_SET+=MAN3 NC
.endif
.if ${.CURDIR:M*/ports/security/libressl-devel}
  OPTIONS_SET+=MAN3 NC
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# gkrellm2 configuration -- needs client		#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/sysutils/gkrellm2}
  OPTIONS_UNSET+=DOCS NLS NTLM OPENSSL
  OPTIONS_SET+=CLIENT
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# en-hunspell configuration				#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/textproc/en-hunspell}
  OPTIONS_SET+=CA_LARGE GB_IZE US_STANDARD
  OPTIONS_UNSET+=CA_STANDARD GB_ISE GB_LARGE US_LARGE
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# hplip configuration					#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/print/hplip}
  OPTIONS_SET+=SNMP X11
  OPTIONS_UNSET+=FAX SCAN XSANE
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# chromium-bsu fix radio options			#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/games/chromium-bsu}
  OPTIONS_UNSET+=OPENAL
  OPTIONS_SET+=SDL_MIXER
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# gdb fix radio options					#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/devel/gdb}
  OPTIONS_UNSET+=PORT_READLINE
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# openssh-portable config -- unset insecure option	#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/security/openssh-portable}
  OPTIONS_UNSET+=NONECIPHER
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# sundials add blas support				#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/math/sundials}
  OPTIONS_SET+=BLAS
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# better maxima config					#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/math/maxima}
  OPTIONS_SET+=DOCS EXAMPLES MANPAGES NOUSERINIT TEST XMAXIMA
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# bad option name -- remove samba			#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/net/kdenetwork}
  OPTIONS_UNSET+=FILESHARING
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# fix qtcurve radio selection				#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/x11-themes/qtcurve}
  OPTIONS_SET+=GTK2 KF5
  OPTIONS_UNSET+=QT5
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# bad audio radio selections -- remove audio support	#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/mail/faces}
  OPTIONS_UNSET+=AUDIO NAS RPLAY SOX
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# fix pam conflict					#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/security/sudo}
  OPTIONS_UNSET+=PAM
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# add claws-mail docs					#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/mail/claws-mail}
  OPTIONS_SET+=DOCS
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# radio selector fix pinentry				#
# choose default -- unset other make.conf options	#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/security/pinentry}
  OPTIONS_SET+=TTY
  OPTIONS_UNSET+=NCURSES FLTK GTK2 QT5 GNOME3
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# radio selector fix neon				#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/www/neon}
  OPTIONS_SET+=EXPAT
  OPTIONS_UNSET+=LIBXML
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# radio selector fix claws-mail-bogofilter		#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/mail/claws-mail-bogofilter}
  OPTIONS_SET+=SQLITE
  OPTIONS_UNSET+=BDB TC
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# good zbar defaults					#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/graphics/zbar}
  OPTIONS_SET+=X11 V7
  OPTIONS_UNSET+=GTK2 V4L V6
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# radio selector fix lua				#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/lang/lua5*}
  OPTIONS_UNSET+=LIBEDIT
.endif

.if ${.CURDIR:M*/ports/lang/lua54}
  OPTIONS_UNSET+=LIBEDIT
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# radio selector fix wildmidi				#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/audio/wildmidi}
  OPTIONS_SET+=OSS
  OPTIONS_UNSET+=ALSA OPENAL
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# radio selector fix glfw				#
#_______________________________________________________#
.if ${.CURDIR:M*/ports/graphics/glfw}
  OPTIONS_SET+=WAYLAND
  OPTIONS_UNSET+=X11
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# radio selector fix vkquake				#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/games/vkquake}
  OPTIONS_SET+=MIKMOD
  OPTIONS_UNSET+=MODPLUG XMP
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# rubygem -- take advantage of clang?			#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/devel/rubygem-multi_json}
  OPTIONS_SET+=JSON
  OPTIONS_UNSET+=JSON_PURE YAJL_RUBY
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# nss from mozilla purported faster and more featured than openSSL	#
# https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/FAQ	#
#_______________________________________________________________________#

.if ${.CURDIR:M*/ports/devel/apr}
  OPTIONS_SET+=NSS
  OPTIONS_UNSET+=SSL
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# gimp help might be unique				#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/graphics/gimp}
  OPTIONS_SET+=HELP
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# openSSL here is uncertain -- purports speedier	#
# http://anrieff.net/ucbench/technical_qna.html		#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/archivers/libarchive}
  OPTIONS_SET+=OPENSSL
  OPTIONS_UNSET+=NETTLE
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# Cannot use libressl so second best is bundled.	#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/www/node12}
  OPTIONS_SET+=BUNDLED_SSL
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# radio button conflicts these ports for these options	#
# mpg123 purported to be speedier if given the choice	#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/audio/sdl_mixer}
  OPTIONS_SET+=MIKMOD
  OPTIONS_UNSET+=MODPLUG
.endif

.if ${.CURDIR:M*/ports/audio/sdl2_mixer}
  OPTIONS_SET+=MIKMOD MPG123
  OPTIONS_UNSET+=MODPLUG MAD
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# some odd reason doc causes issues? Weird		#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/sysutils/cdrtools}
  OPTIONS_UNSET+=DOCS
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# Openoffice builds or pkg install; immediately cores.	#
#_______________________________________________________#

#WITH_DEBUG_PORTS+=${PKGORIGIN}

WITH_DEBUG_PORTS+=editors/openoffice-devel
WITH_DEBUG_PORTS+=editors/openoffice-4


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# samba option fails build and hal not needed		#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/devel/gnome-vfs}
  OPTIONS_UNSET+=HAL SAMBA
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# docs fails build, manpages=docs, and bash not needed	#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/security/p11-kit}
  OPTIONS_UNSET+=BASH
  OPTIONS_UNSET+=DOCS
  OPTIONS_UNSET+=MANPAGES
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# I do not use kerberos so none of them are needed      #
# explicitly set GSSAPI_NONE				#
#_______________________________________________________#

OPTIONS_UNSET+=KERBEROS HEIMDAL MIT HEIMDAL_BASE KERB_GSSAPI GSSAPI_BASE GSSAPI_MIT GSSAPI_HEIMDAL
OPTIONS_SET+=GSSAPI_NONE


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# dependents of curl need TLS_SRP for some things?	#
# that option requires openssl or gnutls		#
# choose gnutls but libssh2 option requires openssl	#
# and TPM causes dependency loop due to gnutls		#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/ftp/curl}
  OPTIONS_UNSET+=OPENSSL LIBSSH2
  OPTIONS_SET+=GNUTLS RESOLV
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# some things require gnutls built with P11KIT option	#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/security/gnutls}
  OPTIONS_UNSET+=TPM
  OPTIONS_SET+=P11KIT
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# some things cannot handle libressl			#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/net/krdc}
  OPTIONS_UNSET+=FREERDP
.endif

.if ${.CURDIR:M*/ports/net/remotebox}
  OPTIONS_UNSET+=FREERDP
.endif

.if ${.CURDIR:M*/ports/net/remina-plugins}
  OPTIONS_UNSET+=RDP
.endif

.if ${.CURDIR:M*/ports/net/guacamole-server}
  OPTIONS_UNSET+=RDP
.endif

.if ${.CURDIR:M*/ports/net/vinagre}
  OPTIONS_UNSET+=RDP
.endif

.if ${.CURDIR:M*/ports/www/node}
  OPTIONS_SET+=BUNDLED_SSL
.endif

.if ${.CURDIR:M*/ports/devel/qca}
  OPTIONS_UNSET+=OPENSSL
.endif

.if ${.CURDIR:M*/ports/dns/ldns}
  OPTIONS_UNSET+=DANETAUSAGE GOST
  OPTIONS_SET+=DRILL
.endif

.if ${.CURDIR:M*/ports/dns/unbound}
  OPTIONS_UNSET+=ECDSA GOST EVAPI
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# npm -- node package manager, keep synced with node	#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/www/npm}
  OPTIONS_SET+=NODE
  OPTIONS_UNSET+=NODE10 NODE12
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# This adds samba support that I don't use		#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/net/kdenetwork}
  OPTIONS_UNSET+=FILESHARING
.endif



#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# Optimizing and profiling fails build? and dbus too?	#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/www/firefox}
  OPTIONS_UNSET+=PROFILE OPTIMIZED_CFLAGS DBUS
.endif

 
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# firefox issue with libressl via libevent		#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/devel/libevent}
  OPTIONS_UNSET+=OPENSSL
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# Minetest special adjustments test			#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/games/minetest}
  OPTIONS_SET+=CURL DOCS EXAMPLES LUAJIT SOUND CLIENT SERVER FREETYPE
  OPTIONS_UNSET+=NCURSES NLS PGSQL LEVELDB REDIS SPATIAL
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# override defaults for llvm?				#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/devel/llvm*}
  OPTIONS_UNSET+=BE_FREEBSD BE_STANDARD
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# rust-nightly fails build -- newer libressl causes it	#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/lang/rust-nightly}
  OPTIONS_UNSET+=GDB
## maybe firefox needs webassembly?
  OPTIONS_SET+=WASM
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# match rust-nightly					#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/lang/rust}
  OPTIONS_UNSET+=GDB
## maybe firefox needs webassembly?
  OPTIONS_SET+=WASM
.endif

# python27 (and other things) fails with libressl-devel


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# qscintilla oddness					#
# py-qt4 items needed API unset				#
# defunct -- removed					#
#_______________________________________________________#
 

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# mDNSResponder vs Avahi choose Avahi			#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/net/ntp-devel}
 CONFLICTS+=avahi*
.endif
.if ${.CURDIR:M*/ports/audio/murmur}
 CONFLICTS+=avahi*
.endif

.if ${.CURDIR:M*/ports/devel/android-tools-adb}
  OPTIONS_UNSET+=MDNSRESPONDER
.endif

.if ${.CURDIR:M*/ports/audio/shairplay}
  OPTIONS_UNSET+=MDNSRESPONDER
.endif

.if ${.CURDIR:M*/ports/audio/xmms2}
  OPTIONS_UNSET+=MDNS_APPLE
  OPTIONS_SET+=MDNS_AVAHI
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# Fix circular dependency loops				#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/net/avahi}
  OPTIONS_UNSET+=GTK
.endif

.if ${.CURDIR:M*/ports/print/cups}
  OPTIONS_UNSET+=AVAHI GNUTLS
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# ImageMagick6 vs 7 conflict -- most use V6		#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/graphics/zbar}
  OPTIONS_UNSET+=V7
  OPTIONS_SET+=V6
.endif


#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# damned wayland additions				#
# clearly this is love-hate for the system and have 	#
# flip-flopped on this.					#
#_______________________________________________________#

.if ${.CURDIR:M*/ports/graphics/mesa-dri}
#    OPTIONS_UNSET+=WAYLAND
    OPTIONS_SET+=WAYLAND
.endif
.if ${.CURDIR:M*/ports/graphics/mesa-libs}
#    OPTIONS_UNSET+=WAYLAND
    OPTIONS_SET+=WAYLAND
.endif
.if ${.CURDIR:M*/ports/devel/sdl20}
#    OPTIONS_UNSET+=VIDEO_WAYLAND
    OPTIONS_SET+=VIDEO_WAYLAND
.endif

Frequently viewed this week