GNU Emacs flavours in FreeBSD

r460621 added flavours to editors/emacs. If you previously used editors/emacs-nox11 to get a flavour suitable for most server systems, you’re in for a couple of surprises.

  1. Remove EMACS_PORT_NAME=emacs-nox11 from /etc/make.conf.
  2. Remove WITHOUT_X11=yes from /etc/make.conf.
  3. Add OPTIONS_UNSET+=X11 to /etc/make.conf simply as a precaution.
  4. Add DEFAULT_VERSIONS+=emacs=nox to /etc/make.conf.

The full range of valid values, as of r460621, are full, canna, nox, devel_full, and devel_nox.

Be sure to repeat the above steps for /usr/local/etc/synth/LiveSystem-make.conf, or similar files, if you are using ports-mgmt/synth.

I was under the impression that I have now told the ports collection that I want the nox flavour of editors/emacs.

root@enterprise:/usr/ports/editors/emacs # make -V DEFAULT_VERSIONS | gsed 's/ /\n/g'
apache=2.4
bdb=6
emacs=nox
firebird=2.5
fpc=3.0.2
gcc=6
ghostscript=9
linux=c6_64
lua=5.2
mysql=5.7
perl5=5.26
php=7.1
pgsql=9.6
python=2.7
python2=2.7
python3=3.6
ruby=2.3
samba=4.6
ssl=openssl
tcltk=8.6
varnish=4

To quote the relevant parts of the 20180201 entry of ports/head/UPDATING:

  An alternative to the default flavor, full, can be set in make.conf.  For
  example, to set the nox flavor as the default, use

     DEFAULT_VERSIONS+=emacs=nox

This is clearly not the case, just run make -C /usr/ports/editors/emacs config to prove my point. dialog4ports still shows the full (hah!) plethora of options. Instead, run these commands:

setenv FLAVOR nox
make -C /usr/ports/editors/emacs config
unsetenv FLAVOR

I ended up selecting ACL, LLDB, MODULES, SOURCES, XML, and KQUEUE.

If you, like me, are still using the severly outdated ports-mgmt/portupgrade, try this:

setenv FLAVOR nox
portupgrade -fpvo editors/emacs editors/emacs-nox11
unsetenv FLAVOR

After about 3 minutes, depending on your processing speed, a new and shiny GNU Emacs has replaced the previously installed GNU Emacs.

--->  ** Upgrade tasks 1: 1 done, 0 ignored, 0 skipped and 0 failed
--->  Listing the results (+:done / -:ignored / *:skipped / !:failed)
        + editors/emacs (emacs-25.3_2,3 -> emacs-nox-25.3_2,3)
--->  Packages processed: 1 done, 0 ignored, 0 skipped and 0 failed
--->  Session ended at: Fri, 02 Feb 2018 10:12:14 +0100 (consumed 00:02:43)

If you have print/auctex and/or devel/distel installed, you need to update their package names:

portupgrade -fpv print/auctex devel/distel

The results are in:

--->  ** Upgrade tasks 2: 2 done, 0 ignored, 0 skipped and 0 failed
--->  Listing the results (+:done / -:ignored / *:skipped / !:failed)
        + devel/distel (distel-4.1.1_1 -> distel-emacs25_nox-4.1.1_2)
        + print/auctex (auctex-emacs-nox11-11.90_2 -> auctex-emacs25_nox-11.90_3)
--->  Packages processed: 2 done, 0 ignored, 0 skipped and 0 failed
--->  Session ended at: Fri, 02 Feb 2018 10:15:16 +0100 (consumed 00:00:40)

At least print/auctex and devel/distel have the decency to honour my request for the nox flavour of editors/emacs.

Edit and upgrade any local metaports to reflect the new port origins and package names. If you are using ports-mgmt/portmaster or ports-mgmt/synth, this should do:

RUN_DEPENDS+=emacs-nox>0:${PORTSDIR}/editors/emacs@nox
RUN_DEPENDS+=auctex-emacs25_nox>0:${PORTSDIR}/print/auctex@nox
RUN_DEPENDS+=distel-emacs25_nox>0:${PORTSDIR}/devel/distel@nox

Update 2018-02-05

I revisited ports-mgmt/portmaster this weekend and created this little shell script:

#!/bin/sh

if [ "$#" = 0 ]; then
  extra=-a
fi

portmaster --no-confirm --no-term-title --no-index-fetch --index-first -g -w -D -v $extra $@

I’m not convinced portmaster always does the right thing. While upgrading ruby-2.3.5 to ruby-2.3.6, it never occurred to portmaster that other ports, like ruby23-bdb-0.6.6_5, portupgrade-2.4.15,2, ruby23-gems-2.7.4, rubygem-rdiscount-2.2.0.1, rubygem-hpricot-0.8.6, rubygem-mustache-1.0.5, and rubygem-ronn-0.7.3, should be forcefully updated. Maybe I’m too accustomed to portupgrade and its behaviour when given the -fprv flags.

I could investigate the use of portmaster‘s -r flag, but I fear that might lead me nowhere. I’m a bit disappointed that I can’t use the category/name@flavour notation along with the -r flag. Using the -f flag absent the -a flag, might do the trick.

Leave a Reply

Your email address will not be published. Required fields are marked *