Posted on 2021-11-20 - Updated on 2021-11-22

The FreeBSD Operating Systems provides the Ports Collection to allow a simple way for users and administrators to install applications, to know more https://www.freebsd.org/ports/.

It is possible to configure a port before the building and installation, ports-mgmt/dialog4ports is a well known TUI utility for the port options, unfortunately dialog4ports depends on non-permissive open source software. portconfig is a new utility to provide the same features of dialog4ports, it and its dependecies (bsddialog and ncurses) are completely permissive.

Getting Started:

$ git clone https://gitlab.com/alfix/portconfig.git
$ cd portconfig
$ git submodule update --init --recursive
$ make

Now edit /usr/ports/Mk/bsd.commands.mk, comment DIALOG4PORTS and add the absolute path to portconfig:

#DIALOG4PORTS?= ${LOCALBASE}/bin/dialog4ports
DIALOG4PORTS?= /absolute/path/to/portconfig

Now make config uses portconfig instead of dialog4ports, for example:

# cd /usr/ports/editor/vim
# make config

It is possible to customize portconfig via environment variables, for example to set the dialog4ports theme (properly dialog) with tcsh:

# env PORTCONFIGTHEME="blackwhite" make config

Other variables:

  • D4PHEIGHT: hight (otherwise autosize)
  • D4PWIDTH: width (otherwise autosize)
  • D4PFULLSCREEN: fullscreen mode
  • D4PALIGNCENTER: align menu text to centre (default left)
  • D4PASCIILINES: draw borders with + - | charachters
  • PORTCONFIGTHEME: possible values: blackwhite / bsddialog / dialog / magenta

Please NOTE: portconfig is under development and distributed without any warranty.

Project repository https://gitlab.com/alfix/portconfig.

Happy Hacking!