Warning: there may be occasional oddness due to css and blog edits. **KNOWN ISSUE: possible hidden text**

Saturday, February 26, 2022

Port breaks kernel breaks port

So many of us chug happpily along without completely realizing or recognizing how some of the present FreeBSD build mechanisms have become a bit more complex.  Those who never have any need of graphics and remain in a text mode commandline interface for the duration of their use of FreeBSD would not know that there is indeed at least one situation, now, which ties a port and the kernel together.  When everything is working perfectly, this would likely never come up, but a relatively small problem inflated itself to cause my kernel build to fail.

During this troubleshooting quest, first I tried the obvious things, re-rebuild world just to be sure it was ok, then rebuild a GENERIC kernel instead of my custom kernconf and that after having re-enabled some possibly related things in that kernconf to no avail.  After beating my figurative head against the wall for quite a while, I went to twitter to see if @FreeBSDHelp had any ideas.

The details and comments on that discussion thread didn't solve my issue as I could not comprehend how our kernel build was now in any way tied to the build of a port, though the comment that was made may not have explicitly indicated this.  So my next thought was, if I could get a different, earlier version of the /usr/src from git in some way, then rebuild kernel from before the error seemed to appear in /usr/src.  I didn't know this was not the path to take to solve this, but I still wasted far too much time trying to go backward with git to an earlier commit.  I am definitely not a particularly big fan of git, and this exertion didn't help me love it any more.

The reason, besides that it had been in excess of 10 days since the last time I rebuilt my kernel and world, was to get virtualbox working which needed bits from the kernel build which I didn't have, and those need to be the same version as the running OS.  This meant my long journey to rebuild my kernel and world (multiple times each) so that I could use Virtualbox to try the game Veloren which due to whatever is different than expected (FVWM3 and Radeon graphics probably, or similar) does build and install but does NOT run.  I am sure that if I could startup Virtualbox, put tinycore Linux in there, and install Veloren for Linux, I would probably succeed where I was prevented otherwise.  I could not install another OS in Virtualbox because I could not boot the iso, and this due to the virtualbox kernel object not having been loaded.  I couldn't load the needed kernel object since it needed to be built, and now you know why I got stuck down this rabbit hole.

It has been some time since setting that whole "Play Veloren in Virtualbox via tinycore Linux" idea on a back burner or in a box on a shelf somewhere.  One of my incomplete projects is to get my port attempt of Reshade rebuilt, which I was attempting and it ran into some conflicts with python items.  The various python things it needed were installed as version 310 while I already had version 39 of those same ports.  The only way forward was to remove each of the python 3.9 ports to let the reshade build then install what it needed as version 3.10.  Among all of the things that were removed as a consequence of this, was vlc and firefox, both I use daily.  So I gave poudriere a gross list of everything I had installed on my system, let it build, and then discovered a number of things that failed.  The graphics/drm-fbsd13-kmod port was among the fairly long list of things that didn't get built, and it was in the smallish group of "lynchpin" ports, meaning that others failed (were skipped) because it failed.

And so, I thought thats not a problem, I'll go investigate what happened with graphics/drm-fbsd13-kmod to make it fail.  I remembered that poudriere keeps logs of all (or most everything) it does, and I just had to find it.  Since I often end up trying to remember where any certain important thing is and its path, I have been keeping a directory of symbolic links with sometimes more descriptive names.  The appropriate one was,

root@ichigo:~ # ls -l Symbolic_Links/p-keg-logs_bulk_13amd64_latest-per-pkg
lrwxr-xr-x  1 root  wheel  66 May  5  2021 Symbolic_Links/p-keg-logs_bulk_13amd64_latest-per-pkg -> /usr/local/poudriere/data/logs/bulk/13amd64-default/latest-per-pkg

and from there I could do

root@ichigo:~ # tail -n 15 Symbolic_Links/p-keg-logs_bulk_13amd64_latest-per-pkg/drm-fbsd13-kmod-5.4.144.g20220223.log
===> Checking for items in STAGEDIR missing from pkg-plist
Error: Orphaned: %%KMODSRC%%/linuxkpi/dummy/include/linux/random.h
Error: Orphaned: %%KMODSRC%%/linuxkpi/dummy/include/linux/suspend.h
===> Checking for items in pkg-plist which are not in STAGEDIR
===> Error: Plist issues found.
*** Error code 1

Stop.
make: stopped in /usr/ports/graphics/drm-fbsd13-kmod
=>> Error: check-plist failures detected
=>> Cleaning up wrkdir
===>  Cleaning for drm-fbsd13-kmod-5.4.144.g20220223
build of graphics/drm-fbsd13-kmod | drm-fbsd13-kmod-5.4.144.g20220223 ended at Sat Feb 26 00:30:21 CST 2022
build time: 00:04:43
!!! build failure encountered !!!

Firstly, the build failure is due to my choice to be a bit more stringent on builds, to test for various things, so it is possible that this might not appear to most users, although it truly should be visible to all the port maintainers and various FreeBSD developers.  It tells me, as did the small highlighted concise reason in the failed build list output from after I ran poudriere, that it is an issue with the pkg-plist.  This I correctly believed was a simple issue, and easy to fix since this process is something I have repeated many times with my own repos for FreeBSD Port Tree Leaf items such as for Minetest-dev which I wrote about in another blog post.

What I needed to do was go to /usr/ports/graphics/drm-fbsd13-kmod and rename the pkg-plist to pkg-plist-old, and then do a fresh build of it.  Once the build completes, I create a fresh pkg-plist by make makeplist > pkg-plist in order to do a comparison between this new fresh list and the old original list.  This is accomplished by diff -y pkg-plist pkg-plist-old | more to step through the output, looking for something that is present or absent in the newly generated pkg-plist as compared to the old one.  Since a pkg-plist that is in the ports tree may have %%text%% type tags which are often not generated by the make makeplist script, I usually modify the pkg-plist-old to match the one freshly generated.  Once the edits are made, I rename the pkg-plist-old to pkg-plist and then rebuild once more to prove no errors related to the file remain.

Now that graphics/drm-fbsd13-kmod successfully builds and installs, I thought from the back of my mind, that I would try to update kernel and world, due to that vague mention of these two things being related.  World builds as expected, so I go on to the kernel, and then it fails.  It complains that kconfig.mk was missing.  I remember that that was one of the things that I had removed from the graphics/drm-fbsd13-kmod pkg-plist for a reason I am already uncertain about now-- and this is being written within hours of having done it.  I go back to that port tree directory and either the pkg-plist-old was still present or I went through the steps to generate fresh and make the needed edits to fix it.  Whatever actually happened seems to have fallen out of my mind but the result was "Hey! graphics/drm-fbsd13-kmod needs to be built in order for the kernel to build, gee that is weird."

I have been writing about all of this within a relatively short period after succeeding to build kernel and world when it had been broken some week(s) ago.  My new kernel has not yet been installed and I have to build the virtualbox thing(s) that are dependent upon the source.  It is nice now to have this mess cleared up and better understood.  I'll be adding this nit to the lists of build issues for kernel or world, and add emphasis on the relationship between this port and the kernel which likely many of us had not known.  The kernel failure meant the virtualbox port for a kernel object couldn't be built, but the kmod graphics port is what broke the kernel.

Wednesday, June 23, 2021

To history no more mergemaster

Just what I love to hear, and you should already guess that is sarcasm, that yet another tool is being retired.  Our old faithful mergemaster is being replaced by etcupdate which I will now have to become a bit more familiar with using.  The former tool is mentioned in my Kernel and world update post and page here, so I will revise those as well.  Also, once more, I run across this news accidentally and rather fortuitously, though my next Kernel and world update is on the horizon.  I only suggest it is good to know about this now primarily because the retirement is imminent, arguably not particularly sudden as the PR for it is from January this year.  Even so, that PR is intended to track the change, so a more precise end of usefulness is not perfectly known (to me).  There is also discussion about this change in a post on the FreeBSD forums which manages not to get heated but does echo a little displeasure at the relative silence until now regarding the change.

According to pieces of the forum posts and the PR, it appears that my decision to update my /usr/src in order to check for a more current /usr/src/UPDATING file, has caused me to lose the easier ways to switch to etcupdate.  I think I can certainly double my builds so that after the first one it will be in sync as it must be for the switch, or I could struggle to cause git to backrack the /usr/src directory to the prior version or whatever version (which I do not know) I used for my system as it is presently built.  It may be that there is another method which is less easy but a halfway between those yet only involves etcupdate.

I am now reading that the etcupdate method will usually mean one extra, it seems, manually initiated step each time, since I know that nearly every Kernel and World build and install process for me has differences between what it wants to do or include in various config files compared to what I have already.  I am not sure yet, not until I have been through the process at least once, or better, twice, quite what to expect.  I am going to assume at least one extra step compared to what I have been doing though for these past many years.

Here is the part of the etcupdate(8) manpage which tells me that I doubled my work:

   Bootstrapping
     The etcupdate utility may need to be bootstrapped before it can be used.
     The diff command will fail with an error about a missing reference tree
     if bootstrapping is needed.

     Bootstrapping etcupdate requires a source tree that matches the currently
     installed world.  The easiest way to ensure this is to bootstrap
     etcupdate before updating the source tree to start the next world upgrade
     cycle.  First, generate a reference tree:

           etcupdate extract

     Second, use the diff command to compare the reference tree to your
     current files in /etc.  Undesired differences should be removed using an
     editor, patch(1), or by copying files from the reference tree (located at
     /var/db/etcupdate/current by default)

     If the tree at /usr/src is already newer than the currently installed
     world, a new tree matching the currently installed world can be checked
     out to a temporary location.  The reference tree for etcupdate can then
     be generated via:

           etcupdate extract -s /path/to/tree

     The diff command can be used as above to remove undesired differences.
     Afterwards, the changes in the tree at /usr/src can be merged via a
     regular merge.

The second part suggests extracting a reference tree but I am not going to fall down into that pit.  Instead I will take my medicine, update and install kernel and world to the version of /usr/src I have now, then bootstrap as described above. After all that, I can do another update when /usr/src is revised with the next git pull (yeah, I don't worry about using gitup for this, but one could).

Somewhat distressingly the etcupdate extract does not itself provide any output or clue that it is doing the job, so shortly after noticing this, I ran htop in another xterm to see  The process was fairly quick so it shouldn't be too much concern but I would guess that futher steps will certainly show whether it did its job to setup for bootstrap or not  The second part, mentioned above is not as clear as I think it should be, not only to say "use the diff command" which I will have to check the manpage to see if it is a sub-command of etcupdate, but that the manpage ought to also show "etcupdate diff" if this is the case.

     etcupdate diff [-d workdir] [-D destdir] [-I patterns] [-L logfile]
   Diff Mode
     The diff mode compares the versions of files in the destination directory
     to the “current” tree and generates a unified format diff of the changes.
     This can be used to determine which files have been locally modified and
     how.  Note that etcupdate does not manage files that are not maintained
     in the source tree such as /etc/fstab and /etc/rc.conf.
So it is as I suspected and would have known if I had read through the whole manpage five or six times, a function of etcupdate but the problem is that without the example, there is no mention of where the default locations are for the extract and what to use for workdir and destdir.  Maybe this information is also "buried" in the manpage in a seperate place, and it turns out that suggesting it was buried is a bit too harsh, BUT, an example which uses the defaults would be much more helpful than "use the diff command" since this bootstrapping must be done right the first time.  These options provide a way to set alternate locations so maybe an example using those defaults would be excessive, but should still show the command as otherwise the mention is a little vague.
     -D destdir         Specify an alternate destination directory as the
                        target of a merge.  This is analogous to the DESTDIR
                        variable used with ‘make installworld’.  The default
                        destination directory is an empty string which results
                        in merges updating /etc on the local machine.

     -d workdir         Specify an alternate directory to use as the work
                        directory.  The work directory is used to store the
                        “current” and “previous” trees as well as unresolved
                        conflicts.  The default work directory is
                        /var/db/etcupdate.

I am going to try simply etcupdate diff and see what it does, maybe it will give feedback on any additional information it might need before it begins.  It just runs and goes through most of the usual files that mergemaster would, to see what has changed from 'stock' according to the output below.

root@ichigo:/usr/src # etcupdate extract
root@ichigo:/usr/src # etcupdate diff
Index: /.cshrc
===================================================================
--- /.cshrc (stock)
+++ /.cshrc (local)
@@ -44,3 +44,4 @@
endif

 endif
+source /root/.cshrc-personal
Index: /root/.cshrc
===================================================================
--- /root/.cshrc (stock)
+++ /root/.cshrc (local)
@@ -44,3 +44,4 @@
endif

 endif
+source /root/.cshrc-personal
Index: /root/.login
===================================================================
--- /root/.login (stock)
+++ /root/.login (local)
@@ -7,6 +7,15 @@

 # Query terminal size; useful for serial lines.
 if ( -x /usr/bin/resizewin ) /usr/bin/resizewin -z
+# -z     Do nothing unless the current kernel terminal size is zero.
+# This is useful when run from a user's profile (shell startup) scripts:
+# querying the window size is required for serial lines, but not when
+# logging in over the network, as protocols like TELNET or SSH already
+# handle the terminal size by themselves.
+setenv MANWIDTH 240
+setenv MANCOLOR yes
+#setenv LC_CTYPE POSIX

 # Uncomment to display a random cookie on each login.
 # if ( -x /usr/bin/fortune ) /usr/bin/fortune -s
+ if ( -x /usr/bin/fortune ) /usr/bin/fortune -s
Index: /etc/master.passwd
===================================================================
--- /etc/master.passwd (stock)
+++ /etc/master.passwd (local)
@@ -1,6 +1,6 @@
 # $FreeBSD$
 #
-root::0:0::0:0:Charlie &:/root:/bin/csh
+root::0:0::0:0:Charlie &:/root:/bin/csh
 toor:*:0:0::0:0:Bourne-again Superuser:/root:
 daemon:*:1:1::0:0:Owner of many system processes:/root:/usr/sbin/nologin
 operator:*:2:5::0:0:System &:/:/usr/sbin/nologin
@@ -27,3 +27,35 @@
 hast:*:845:845::0:0:HAST unprivileged user:/var/empty:/usr/sbin/nologin
 tests:*:977:977::0:0:Unprivileged user for tests:/nonexistent:/usr/sbin/nologin
 nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/usr/sbin/nologin
+tigersharke::1001:1001::0:0:tigersharke:/usr/home/tigersharke:/bin/tcsh
+eviltwin::1002:1002::0:0:My Evil Twin:/usr/home/eviltwin:/bin/tcsh
+messagebus:*:556:556::0:0:D-BUS Daemon User:/nonexistent:/usr/sbin/nologin
+polkitd:*:565565::0:0:Polkit Daemon User:/var/empty:/usr/sbin/nologin
+saned:*:194:194::0:0:SANE Scanner Daemon:/nonexistent:/bin/sh
+squid:*:100:0::0:0:squid caching-proxy pseudo user:/var/squid:/usr/sbin/nologin
+vboxusers:*0:920::0:0:Virtualbox user:/nonexistent:/usr/sbin/nologin
+_ntp:*:2::0:0:NTP Daemon:/var/empty:/usr/sbin/nologin
+cups:*:193:19::0:0:Cups Owner:/nonexistent:/usr/sbin/nologin
+tests:*:977:6534::0:0:Unprivileged user for tests:/nonexistent:/usr/sbin/nologin
+git_daemo64:964::0:0:git daemon:/nonexistent:/usr/sbin/nologin
+polkit:*:5662::0:0:PolicyKit User:/nonexistent:/usr/sbin/nologin
+_tss:*:601::daemon:0:0:TrouSerS user:/var/empty:/usr/sbin/nologin
+avahi:*:558:8::0:0:Avahi Daemon User:/nonexistent:/usr/sbin/nologin
+cyrus:*:60:60:0:0:the cyrus mail server:/nonexistent:/usr/sbin/nologin
+colord:*:970:970::0:0:colord color management daemon:/nonexistent:/usr/sbin/nologin
+clamav:*:1006::0:0:Clamav Antivirus:/nonexistent:/usr/sbin/nologin
+spamd:*:58:58:0:0:SpamAssassin user:/var/spool/spamd:/usr/sbin/nologin
+minetest:*:976:976::0:0:& server:/nonexistent:/usr/sbin/nologin
+_sndio:*:702:702::0:0:sndio privsep:/var/empty:/usr/sbin/nologin
+slurm:*:8::0:0:SLURM Daemon:/nonexistent:/usr/sbin/nologin
+pulse:*:563:563::0:0:PulseAudio System User:/nonexistent:/usr/sbin/nologin
+sddm:*:219:219::0:0:SDDM Display Manager user:/var/lib/sddm:/usr/sbin/nologin
+mysql:*:88:88::0:0:MySQL Daemon:/var/db/mysql:/usr/sbin/nologin
+webcamd:*:145:145::0:0:Webcamd user:/var/empty:/usr/sbin/nologin
+fahclient:*:246:246::0:0:Folding@home User:/nonexistent:/usr/sbin/nologin
+qbittorrent:*:850:850::0:0:qBittorrent Daemon User:/var/db/qbittorrent/conf:/usr/sbin/nologin
+mud:*:97:97::0:0:MUD Owner:/nonexistent:/bin/sh
+bnetd:*:700:700::0:0:Bnetd user:/nonexistent:/usr/sbin/nologin
+wolfpack:*:138:138::0:0:Wolfpack Empire Server:/usr/local/share/wolfpack:/usr/sbin/nologin
+mcserver:*:199:199::0:0:Minecraft Server:/nonexistent:/bin/sh

Removed: /etc/regdomain.xml

Index: /etc/hosts
===================================================================
--- /etc/hosts (stock)
+++ /etc/hosts (local)
@@ -10,8 +10,8 @@
 # not be consulted at all; see /etc/nsswitch.conf for the resolution order.
 #
 #
-::1    localhost localhost.my.domain
-127.0.0.1      localhost localhost.my.domain
+::1    localhost ichigo.underworld
+127.0.0.1      localhost ichigo.underworld
 #
 # Imaginary network.
 #10.0.0.2      myname.my.domain myname
@@ -29,3 +29,8 @@
 # numbers but instead get one from your network provider (if any) or
 # from your regional registry (ARIN, APNIC, LACNIC, RIPE NCC, or AfriNIC.)
 #
+#209.94.190.55 distcache.FreeBSD.org
+#38.109.202.29 www.ixsystems.com
Index: /etc/loin.conf
===================================================================
--- /etc/loconf (stock)
+++ /etc/loconf (local)
@@ -51,6 +5@@
:charset=\
:lang=C.UTF-8:

+
 #
 lle of common class names - forward them all to 'default'
 # (login wou normally do this anyway, but having a class name
@@ -86,6 +87,11 @@
:ignorenol\
:memorylocked=unlimited:\
:tc=defau
+:charset=UT:\
+:lang=en_US.UTF-8:\
+:setenv=LC_LATE=C:
+:setenv=PATHOCALE=/usr/local/lib/X11/locale:\
+:path_locale=/usr/local/lib/X11/locale:\

 #
 # Russians Accounts. Setup proper environment variables.
Index: /etc/nt.conf
=================================================================
--- /etc/ntnf (stock)
+++ /etc/nf (local)
@@ -37,7  @@
 # the nex, and replace CC with the country's abbreviation.
 # Make sure that the hostname resolves to a proper IP address!
 #
-# pool 0.ol.ntp.org iburst
+pool 0.U.ntp.org iburst
+pool 0.freebs.pool.ntp.org iburst
+pool 0.netpool.ntp.org iburst
+pool 0.ope.pool.ntp.org iburst
+pool 0.ope.pool.ntp.org iburst

 #
 # Tonfi a specific server, such as an organization-wide local
Index: /etc/gup
===============================================================
--- /etc/gro(stock)
+++ /etc/group (local)
@@ -1,12 +1,12@@
 # $FreeBS #
-whe:*:
+wheel:*:0:root,tigersharke
 daemon:*:1:  kmem:*:2:
 sys:*:3:
*:4:
-operatoroot
-mail:*:6:
+operator:oot,tigersharke
+mail:*:6:clamav
 bin:*:7:
 news:*:8 man:*:9:
@7,9 +17,12 @@
 smmsp:*:2
 mailnull:*:
 guest:*:31:
-video:*:44:
+audio:*:43:ersharke,minetest
+video:*:44:tigersharke,sddm,root
 bind:*:5
+spamd:*:58
 unbound:*:5
+cyrus:*:60:
 proxy:*:62:
 authpf:*:63
 _pflogd:*:64
@@ -29,9 +32,4 @@
 network:*
 audit:*:77:
 www:*:80:
+mysql:*:8ud:*:97:
+squid:*:100:
+clamav:*:106:
 ntpd:*:123:
+wolfpack:*:138:
+webcamd:*:145:
 _ypldap:*:160:
+cups:*:193:
+saned:*:194:
+mcserver:*:199:
+sddm:*:219:
+_ntp:*:233:
+fahclient:*:246:
+slurm:*:468:
+messagebus:*:556:
+pulse-rt:*:557:
+avahi:*:558:
+polkit:*:562:
+pulse:*:563:
+pulse-access:*:564:
+polkitd:*:565:
+_tss:*:601:
+bnetd:*:700:
+_sndio:*:702:
 hast:*:845:
+qbittorrent:*:850:
+vboxusers:*:920:tigersharke
+git_daemon:*:964:
+colord:*:970:
+minetest:*:976:
 tests:*:977:
+tharald:*:1003:
+plugdev:*:1011:tigersharke,root
+tigersharke:*:1012:tigersharke
 nogroup:*:65533:
 nobody:*:65534:
Index: /etc/devfs.conf
===================================================================
--- /etc/devfs.conf (stock)
+++ /etc/devfs.conf (local)
@@ -41,3 +4 @@
 # Allow ms of group operator to cat things to the speaker
 #own   speaker root:operator
 #perm  speak 0660
+
+# ad A21 2020
+link    acd0   cdrom
+link    acd0   dvd
+perm    acd  0660
+perm    cd0   0660
+perm    pass  0660
+perm    pass  0660
+perm    pass  0660
+perm    pass  0660
+perm    xpt0  0666
root@ichigo:/r/src #

The diff above looks fine to me, although there is one explanatory line in one file I would prefer to keep.  Something with the copy-paste or other manipulation of the xterm to get a complete copy-paste has caused some text damage, but you can get the idea of how the diff result looks anyway.  The manpage paragraph below should provide any sort of example on how one would make an adjustment with patch as suggested, I cannot guess how this wouldbe done, so for bootstrapping I will lose the ntp.conf line "# pool 0.CC.pool.ntp.org iburst" which makes the rest of the comment above it a bit less clear.  Much of the differences between the files which etcupdate scrutinized were not long go cleaned up a bit, to organize and group my changes together and make the default and my revised version match more closely.  Perhaps it has now been enough time that the /usr/src directory can be updated and I can rebuild (world takes 1.5 hours, kernel in 45 minutes I think) and reinstall and try etcupdate after.  I decided to look at /etc/ntp.conf to see what it was like, the line I wanted was gone, so I restored it, then looked at some other settings in the file and made some minor revisions.  I am guessing it should come up in the next etcupdate after the rebuilds and reinstalls, and might expect me to resolve, but I won't know until I do so.

In the place of mergemaster -p I used etcupdate -p which I was reasonably sure about.  After that, I used etcupdate -n and tried etcupdate status but both gave no output, all I could do is bite the bullet and try just etcupdate.  None of it gave any output this time around, so perhaps in a future update to my world and kernel there will be a bit more noise from etcupdate.  So for now, I will stick to the same procedure for that next time, to go ahead with the prepare step and then after installing world, the dry run and finally run of etcupdate.  Until experience proves differently and I must make adjustments this seems reasonable and safe.  This command/tool has been around a while already and except for some tweaks to the manpage, it seems to be a good tool to replace mergemaster.  I look forward to using it in the future, especially the next time or two, to see if it prompts me for anything or provides more output.

How many of you read the title as I humorously intended?  "To history no more" meaning the record of commands, 'history' and also "no more mergemaster" as most obvious it is being retired, there is also the other blatant meaning, just that mergemaster would be relegated to history.  I wasn't sure what title to use until that struck me as perfect.

Monday, May 10, 2021

New FVWM! Transition, initial steps

I have been using FVWM as my primary desktop for most of the last nearly twenty years if it has been around that long.  Within the last few years I have customized more and more of the various menus and other effects of my desktop.  I haven't configured anything too crazy, it doesn't look or act like windows, or any other desktop.  Mostly I made adjustments to how various common programs look, how their window is styled, and setup a number of conveniences in the menus or simple .fvwmrc embedded scripts.

A short time ago, I just saw FVWM3 scroll across my ports tree update output, and so I had to peek at freshports to see what it was about.  From there, I went to the FVWM3 webpage to peruse its change logs and readme files and other prliminary documentaion on the site.  One specific thing made me smile, the inclusion of a FreeBSD originated file somewhere in the mix.  The list of changes and bug fixes is quite impressive.  I have not had significant difficulties with FVWM except for struggling somewhat to include any bit of shortcut automation in the .fvwmrc file, or when any certain game needs vsync but I have no idea how to set that up or do what is needed to satisfy that complaint from the game (Veloren).

I saw mention in the commit message for FVWM3 something about M4 being left behind in favor of Go, but aside from this seeming to be about modules, I couldn't find anything more specific or descriptive about it.  The old (current FVWM2) configuration file and methods will be temporarily grandfathered in, which is very nice for the transition period.  I am mildly hesitant to switch as I have occasionally had drastic troubles with graphics in general in the past.  I can certainly maintain both builds in poudriere, and choose which one to keep installed.  This will leave me a fallback if anything catastrophic happens and I somehow cannot use FVWM3 at all, especially if it is something beyond my direct control.  My other concern is how exactly the new .fvwmrc file will be organized, structured, and how I will setup anew much of what I have now.  What I would be very pleased to see would be a more automated, transparent, or FVWM method to reach the .desktop files or similar, and how I could have any built menu reflect the up to the moment installed applications.  I tend to update software on my system as something to do, with poudriere it is much less invasive or disruptive for the most part.  There are still those rare times when something fails to build, then pkg does only half the job, removing the old but being unable to replace it with the new.  

Now we get ready to put poudriere on task to build this new FVWM3 along with the semi-standard X11 environment software for good measure and also just in case, to have a proper bulk build though quite small in comparison to my usual.  Instead, I decided to get an all-depends-list for FVWM3.  

make -C /usr/ports/x11-wm/fvwm3 all-depends-list > fvwm3-and-dependents

/usr/ports/ports-mgmt/pkg
/usr/ports/textproc/rubygem-asciidoctor
/usr/ports/lang/ruby30
/usr/ports/devel/libffi
/usr/ports/devel/ccache
/usr/ports/print/indexinfo
/usr/ports/misc/dejagnu
/usr/ports/devel/gmake
/usr/ports/lang/expect
/usr/ports/devel/autoconf
/usr/ports/devel/m4
/usr/ports/print/texinfo
/usr/ports/misc/help2man
/usr/ports/lang/perl5.32
/usr/ports/devel/p5-Locale-libintl
/usr/ports/converters/libiconv
/usr/ports/converters/p5-Text-Unidecode
/usr/ports/textproc/p5-Unicode-EastAsianWidth
/usr/ports/devel/ncurses
/usr/ports/devel/pkgconf
/usr/ports/devel/kyua
/usr/ports/devel/lutok
/usr/ports/lang/lua54
/usr/ports/devel/libedit
/usr/ports/databases/sqlite3
/usr/ports/lang/tcl86
/usr/ports/devel/autoconf-wrapper
/usr/ports/devel/automake
/usr/ports/security/libressl
/usr/ports/textproc/libyaml
/usr/ports/math/gmp
/usr/ports/devel/libunwind
/usr/ports/devel/ruby-gems
/usr/ports/lang/python39
/usr/ports/devel/readline
/usr/ports/x11/libICE
/usr/ports/x11/xorgproto
/usr/ports/devel/xorg-macros
/usr/ports/x11/xtrans
/usr/ports/x11/libX11
/usr/ports/x11/libxcb
/usr/ports/x11/xcb-proto
/usr/ports/textproc/libxml2
/usr/ports/devel/libpthread-stubs
/usr/ports/x11/libXau
/usr/ports/x11/libXdmcp
/usr/ports/x11/libXext
/usr/ports/x11/libXrandr
/usr/ports/x11/libXrender
/usr/ports/x11-toolkits/libXt
/usr/ports/x11/libSM
/usr/ports/x11/libXcursor
/usr/ports/x11/libXfixes
/usr/ports/x11-fonts/libXft
/usr/ports/print/freetype2
/usr/ports/archivers/brotli
/usr/ports/devel/libtool
/usr/ports/graphics/png
/usr/ports/x11-fonts/fontconfig
/usr/ports/devel/gperf
/usr/ports/devel/meson
/usr/ports/devel/py-setuptools
/usr/ports/devel/ninja
/usr/ports/devel/py-pytest-xdist
/usr/ports/devel/py-setuptools_scm
/usr/ports/textproc/py-toml
/usr/ports/devel/py-pytest
/usr/ports/devel/py-atomicwrites
/usr/ports/devel/py-attrs
/usr/ports/devel/py-coverage
/usr/ports/devel/py-hypothesis
/usr/ports/devel/py-sortedcontainers
/usr/ports/math/py-numpy
/usr/ports/lang/gcc10
/usr/ports/devel/binutils
/usr/ports/math/mpfr
/usr/ports/math/mpc
/usr/ports/lang/cython
/usr/ports/math/cblas
/usr/ports/math/suitesparse
/usr/ports/devel/cmake
/usr/ports/textproc/py-sphinx
/usr/ports/textproc/py-sphinxcontrib-applehelp
/usr/ports/textproc/py-sphinxcontrib-devhelp
/usr/ports/textproc/py-sphinxcontrib-jsmath
/usr/ports/textproc/py-sphinxcontrib-htmlhelp
/usr/ports/textproc/py-sphinxcontrib-serializinghtml
/usr/ports/textproc/py-sphinxcontrib-qthelp
/usr/ports/devel/py-Jinja2
/usr/ports/textproc/py-markupsafe
/usr/ports/devel/py-babel
/usr/ports/devel/py-pytz
/usr/ports/textproc/py-pygments
/usr/ports/textproc/py-docutils
/usr/ports/textproc/py-snowballstemmer
/usr/ports/textproc/py-pystemmer
/usr/ports/textproc/py-alabaster
/usr/ports/graphics/py-imagesize
/usr/ports/www/py-requests
/usr/ports/security/py-certifi
/usr/ports/textproc/py-chardet
/usr/ports/devel/py-pytest-runner
/usr/ports/dns/py-idna
/usr/ports/net/py-urllib3
/usr/ports/archivers/py-brotlipy
/usr/ports/devel/py-cffi
/usr/ports/devel/py-pycparser
/usr/ports/net/py-pysocks
/usr/ports/security/py-cryptography
/usr/ports/devel/py-six
/usr/ports/security/py-cryptography-vectors
/usr/ports/devel/py-iso8601
/usr/ports/devel/py-pretend
/usr/ports/security/py-openssl
/usr/ports/devel/py-flaky
/usr/ports/devel/py-nose
/usr/ports/devel/py-genty
/usr/ports/devel/py-mock
/usr/ports/security/ca_root_nss
/usr/ports/security/py-trustme
/usr/ports/devel/py-pytest-cov
/usr/ports/security/py-service_identity
/usr/ports/devel/py-pyasn1-modules
/usr/ports/devel/py-pyasn1
/usr/ports/devel/py-pytest-timeout
/usr/ports/misc/py-pexpect
/usr/ports/sysutils/py-ptyprocess
/usr/ports/devel/py-pytest-freezegun
/usr/ports/devel/py-freezegun
/usr/ports/devel/py-dateutil
/usr/ports/databases/py-sqlite3
/usr/ports/www/py-tornado
/usr/ports/devel/py-pytest-mock
/usr/ports/devel/py-packaging
/usr/ports/devel/py-pyparsing
/usr/ports/www/py-html5lib
/usr/ports/converters/py-webencodings
/usr/ports/devel/py-typed-ast
/usr/ports/ftp/curl
/usr/ports/www/libnghttp2
/usr/ports/archivers/zstd
/usr/ports/archivers/liblz4
/usr/ports/sysutils/coreutils
/usr/ports/textproc/expat2
/usr/ports/shells/bash
/usr/ports/devel/bison
/usr/ports/devel/jsoncpp
/usr/ports/devel/libuv
/usr/ports/security/rhash
/usr/ports/archivers/libarchive
/usr/ports/archivers/lzo2
/usr/ports/math/metis
/usr/ports/math/blas
/usr/ports/math/lapack
/usr/ports/devel/py-pympler
/usr/ports/devel/py-zope.interface
/usr/ports/devel/py-pluggy
/usr/ports/devel/py-py
/usr/ports/devel/py-wcwidth
/usr/ports/devel/py-more-itertools
/usr/ports/devel/py-pip
/usr/ports/textproc/py-furo
/usr/ports/www/py-beautifulsoup
/usr/ports/www/py-soupsieve
/usr/ports/devel/py-lxml
/usr/ports/textproc/libxslt
/usr/ports/security/libgcrypt
/usr/ports/security/libgpg-error
/usr/ports/textproc/py-sphinx-inline-tabs
/usr/ports/devel/py-csv23
/usr/ports/devel/py-invoke
/usr/ports/devel/py-pytest-rerunfailures
/usr/ports/devel/py-yaml
/usr/ports/devel/py-scripttest
/usr/ports/devel/py-tox
/usr/ports/sysutils/py-filelock
/usr/ports/devel/py-virtualenv
/usr/ports/textproc/py-sphinx_rtd_theme
/usr/ports/textproc/py-towncrier
/usr/ports/devel/py-click
/usr/ports/devel/py-incremental
/usr/ports/www/py-werkzeug
/usr/ports/devel/py-watchdog
/usr/ports/devel/py-pathtools
/usr/ports/devel/py-argh
/usr/ports/net/py-eventlet
/usr/ports/dns/py-dnspython
/usr/ports/devel/py-greenlet
/usr/ports/devel/py-wheel
/usr/ports/devel/mercurial
/usr/ports/devel/git
/usr/ports/devel/subversion
/usr/ports/security/gnupg
/usr/ports/security/libassuan
/usr/ports/security/libksba
/usr/ports/devel/npth
/usr/ports/security/pinentry
/usr/ports/security/pinentry-tty
/usr/ports/devel/apr1
/usr/ports/databases/gdbm
/usr/ports/databases/db5
/usr/ports/java/openjdk7
/usr/ports/archivers/zip
/usr/ports/archivers/unzip
/usr/ports/print/cups
/usr/ports/devel/xdg-utils
/usr/ports/textproc/minixmlto
/usr/ports/textproc/docbook-xsl
/usr/ports/textproc/xmlcatmgr
/usr/ports/textproc/docbook
/usr/ports/textproc/docbook-sgml
/usr/ports/textproc/iso8879
/usr/ports/textproc/docbook-xml
/usr/ports/textproc/xmlcharent
/usr/ports/textproc/sdocbook-xml
/usr/ports/textproc/html2text
/usr/ports/misc/hicolor-icon-theme
/usr/ports/x11/xprop
/usr/ports/x11/xset
/usr/ports/x11-toolkits/libXmu
/usr/ports/print/libpaper
/usr/ports/java/bootstrap-openjdk6
/usr/ports/java/java-zoneinfo
/usr/ports/audio/alsa-lib
/usr/ports/x11/libXi
/usr/ports/x11/libXtst
/usr/ports/java/javavmwrapper
/usr/ports/x11-fonts/dejavu
/usr/ports/x11-fonts/mkfontscale
/usr/ports/x11-fonts/libfontenc
/usr/ports/databases/mysql80-client
/usr/ports/devel/llvm11
/usr/ports/textproc/py-recommonmark
/usr/ports/textproc/py-CommonMark
/usr/ports/devel/py-future
/usr/ports/devel/swig
/usr/ports/devel/pcre
/usr/ports/devel/libevent
/usr/ports/devel/icu
/usr/ports/devel/protobuf
/usr/ports/devel/googletest
/usr/ports/textproc/groff
/usr/ports/print/psutils
/usr/ports/print/gsfonts
/usr/ports/textproc/uchardet
/usr/ports/textproc/utf8proc
/usr/ports/www/serf
/usr/ports/devel/scons
/usr/ports/sysutils/py-execnet
/usr/ports/devel/py-apipkg
/usr/ports/devel/py-pytest-forked
/usr/ports/devel/libbson
/usr/ports/converters/fribidi
/usr/ports/graphics/librsvg2-rust
/usr/ports/lang/rust
/usr/ports/lang/vala
/usr/ports/devel/gettext-runtime
/usr/ports/devel/glib20
/usr/ports/devel/gettext-tools
/usr/ports/devel/libtextstyle
/usr/ports/devel/gobject-introspection
/usr/ports/graphics/cairo
/usr/ports/x11/pixman
/usr/ports/graphics/mesa-libs
/usr/ports/graphics/wayland-protocols
/usr/ports/graphics/wayland
/usr/ports/devel/libepoll-shim
/usr/ports/textproc/py-mako
/usr/ports/www/py-beaker
/usr/ports/devel/llvm10
/usr/ports/x11/libXdamage
/usr/ports/x11/libxshmfence
/usr/ports/x11/libXxf86vm
/usr/ports/graphics/libdrm
/usr/ports/devel/libpciaccess
/usr/ports/misc/pciids
/usr/ports/print/harfbuzz
/usr/ports/textproc/gtk-doc
/usr/ports/textproc/itstool
/usr/ports/textproc/py-libxml2
/usr/ports/textproc/yelp-tools
/usr/ports/textproc/yelp-xsl
/usr/ports/graphics/graphite2
/usr/ports/print/py-fonttools3
/usr/ports/devel/py-fs2
/usr/ports/devel/py-appdirs
/usr/ports/graphics/gdk-pixbuf2
/usr/ports/misc/shared-mime-info
/usr/ports/graphics/jasper
/usr/ports/graphics/jpeg-turbo
/usr/ports/devel/nasm
/usr/ports/graphics/libGLU
/usr/ports/graphics/freeglut
/usr/ports/graphics/tiff
/usr/ports/graphics/jbigkit
/usr/ports/x11-toolkits/pango
/usr/ports/x11-fonts/xorg-fonts-truetype
/usr/ports/x11-fonts/font-bh-ttf
/usr/ports/x11-fonts/bdftopcf
/usr/ports/x11-fonts/font-misc-meltho
/usr/ports/x11-fonts/font-misc-ethiopic
/usr/ports/x11-fonts/encodings
/usr/ports/x11-fonts/font-util

In order to use that with poudriere, I will need to remove the /usr/ports/ portion which I can do fairly easily in vi.  Once in vi, I type :%s/\/usr\/ports\///g which very neatly and efficiently removes the text, then I save the file by simply typing ZZ.  Ordinarily I would take the extra step to organize those port origins alphabetically and remove duplicates, but poudriere will do this for me.  One thing I need to be sure to do, is add x11-wm/fvwm3 to this list or it will not get built with all of its indirect dependencies.  This file as is should suffice for my present needs, and I do not expect to ever need to edit it or doublecheck anything.  Let's tell poudriere to get to work.  

portsup ; poudriere bulk -f `p-keg-deblack fvwm3-and-dependents` -j 13amd64

I can only hope that the list I made had included a number of things I would not need.  The poudriere build finished surprisingly fast, considering I told it to process seventy port origins.  The tail end of the output tells the majority of the story.

[00:12:57] Creating pkg repository
Creating repository in /tmp/packages: 100%
Packing files for repository: 100%
[00:18:46] Committing packages to repository: /usr/local/poudriere/data/packages/13amd64-default/.real_1620639651 via .latest symlink
[00:18:46] Removing old packages
[00:18:46] Built ports: textproc/py-mako textproc/py-recommonmark devel/py-atomicwrites devel/py-wcwidth devel/py-incremental devel/py-py devel/py-greenlet devel/py-argh net/py-eventlet devel/py-pytest devel/py-appdirs devel/py-pyasn1 devel/py-apipkg textproc/py-towncrier devel/py-pathtools math/cblas textproc/py-sphinx_rtd_theme devel/py-sortedcontainers devel/py-pytest-forked devel/py-fs2 devel/py-pyasn1-modules sysutils/py-filelock sysutils/py-execnet textproc/py-sphinx-inline-tabs devel/py-coverage devel/py-freezegun textproc/py-furo devel/py-watchdog security/py-trustme devel/py-pytest-rerunfailures security/py-service_identity devel/py-pytest-runner devel/py-pytest-mock devel/py-virtualenv devel/py-scripttest devel/py-mock devel/py-genty devel/py-wheel devel/py-tox devel/py-pytest-xdist devel/py-invoke devel/py-pympler devel/py-zope.interface devel/py-typed-ast devel/py-pytest-timeout devel/git devel/py-csv23 devel/py-pretend www/py-werkzeug sysutils/coreutils devel/py-pytest-cov devel/libbson devel/mercurial devel/py-flaky devel/py-pytest-freezegun print/py-fonttools3 security/py-cryptography-vectors
[00:18:46] Skipped ports: databases/db5 devel/apr1 devel/py-hypothesis devel/subversion graphics/librsvg2-rust java/openjdk7 math/py-numpy www/serf
[00:18:46] Ignored ports: java/bootstrap-openjdk6 math/suitesparse security/gnupg lang/rust textproc/rubygem-asciidoctor
[13amd64-default] [2021-05-10_04h22m05s] [committing:] Queued: 70 Built: 57 Failed: 0  Skipped: 8  Ignored: 5  Tobuild: 0   Time: 00:18:43
[00:18:46] Logs: /usr/local/poudriere/data/logs/bulk/13amd64-default/2021-05-10_04h22m05s
[00:18:46] Cleaning up
13amd64-default: removed
13amd64-default-n: removed
[00:18:46] Unmounting file systems

All that is left for the moment is to suffer the consequences of switching from one to the next.  I will have to deinstall FVWM2 in order to install FVWM3, and this should be handled fairly automatically by pkg when I tell it to install FVWM3, as it very obviously conflicts with FVWM2.

Friday, May 7, 2021

Interim patches

Patches should be interim fixes only.  How can FreeBSD ever be a recognized full member of the UNIX world if it always hides in the shadows, repairing for itself the linuxisms or other broken upstream code instead of communicating?  Even without making our presence known, telling upstream of our difficulties due to our distinct methods and organization, we can use the same mechanisms which upstream uses to adjust our build without need of patches.  One example is cmake, it is possible to discover the options provided by upstream to modify the build in various ways, to provide paths for dependencies, to enable or disable options.  We force the issue by reminding upstream that we are a consumer and by them providing flexibility which we can use to adapt their build without patches, or by their inclusion of our patches, if those developers listen and are open to such changes. 

Aside from my personal distaste for patches because of what I just mentioned, I also strongly favor our own options framework within the ports system to expose all or most build options.  I am okay with our public FreeBSD repo providing packages which are built using the most universally compatible defaults and among them the most used options as defaults.  However, we should not remove choice from our users.  There may be reasons to build with bundled software even if it may not be the best choice generally.  There are sometimes incompatibilities between ports which if installed together conflict due to dependencies in unique ways.  Choosing the less pleasant or potentially dangerous bundled software dependency can be the work-around in that situation. 

FreeBSD should have within its ports system, as many of the non-bundled versions of any necessary dependencies as possible, but they and all the other ports should also be able to be configured in ways that conflicts do not force the need of any bundled dependency.  Maintaining ports may be a bit of effort and adding additional options exposure for their users may increase the work involved, but it should not be the reason to avoid it.  We cannot know for certain that any group of ports must conflict among themselves or their dependencies if we limit build options.  Beyond the flexibility which may be offered by exposing more options, this exploration and investigation may determine that build options which upstream provides might not affect the actual build except to force dependency attachments.  We need to take care that minimal builds can be configured, that dependencies are known and our own dependency system handles them exclusively or in concert with those caused by any upstream build option. 

We have a rather extensive make system for our ports which is reasonably documented.  This collection of shortcuts in /usr/ports/Mk helps streamline many things, formalizes standards in a sort of macro form.  When and where it is possible it should be a choice for ports users whether to suffer the bulk of a dependency collection or be able to limit them.  Simply because KDE or GNOME or any other desktop provides a rather tightly integrated group of desktop environment with applications does not necessarily mean that it all must be installed in bulk.  If it is possible to pick and choose constituent parts, such as kate exclusive of KDE or some other utility exclusive of GNOME, this should be made as a separate port or port flavor.  For many possibilities we already have much of the mechanisms to handle situations or desires like this but for simplicity or assumed default user choices we might not provide them.  Any META port should not simply be a way for dependencies to be tied together for a one-step port install, especially something like KDE or Lumina, but also should provide options which permit the selection among those individual meta parts. 

We recently extricated base from GPL code, this is a success long in coming but it also truly should not have ever been a necessity, the inclusion not the removal.  Why do we not have more BSD licensed ports?  Why do we wait for any various thing to be developed in or for Linux distros and then we adopt it as a port, not as upstream provider but as a consumer depending upon the whims of developers which are not required to ever acknowledge us?  We can do better.  We are not devoid of creativity or skill or developers who could accomplish the same things for FreeBSD or any other BSD as those coders do for the Linux consumers.  What is our limitation?  Yes, FreeBSD is slow to change and does not chase after the most recent shiny, but can we develop a new shiny object?  It does not need to be a part of base and must not be widely adopted in order to be useful.  Perhaps we need a focus on FreeBSD innovation, to point out and point at those new bits of code, those new applications we develop on FreeBSD as upstream, and not simply give up to hand it over to those who would enjoy maintaining it and improving it as an awesome GPL licenced hit. 

Whether avoiding patches or creating new code, we in our BSD world need to make ourselves known.  We must communicate.  We must not simply be silent consumers feeding from the Linux engine.  We should be recognized, we should be present on operating system statistics distinct from Linux.  We can assist in maintaining the FreeBSD specific parts of any application that chooses to include us as a unique consumer.  We will never be supported if we hide in the shadows, pretending to be Windows or Linux because any mechanisms fail us when we claim our actual operating system designation.  It always begins as feedback to the developers, or resellers, providers; or we can remain a subsidiary of Linux development as a sort of leech on their continued successes. 

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