Custom user select groups

Gregory Anders greg at
Thu Dec 2 20:24:41 UTC 2021

A feature I would personally like to see in MacPorts is the ability to create 
my own select groups and add arbitrary programs to it. I am happy to create a 
prototype PR for review, but wanted to see if this had been proposed or 
considered before.

What I have in mind is a new subcommand to 'port select', e.g. '--add' that 
could be used like so:

     sudo port select --add GROUP TARGET OPTIONS...

Presently, each port that has multiple options has to provide its own 'select' 
companion port. Not all ports have these and it can be tedious to create them 
for every port that needs it. This is especially true for Python and Lua ports 
that install executables: users often want to use the plain executable name 
without the version information which is only possible with a select group.

This would also solve another personal pain point for me: the current inability 
to use a plain 'clangd' command installed via MacPorts. I proposed adding 
clangd to the clang_select group in #10558, but it was closed (for perfectly 
valid reasons). However, if I were able to create my own select group I could 
still accomplish this with no compatibility issues for the greater MacPorts 

     sudo port select --add clangd clangd clangd-mp-13
     sudo port select --set clangd clangd-mp-13

A similar situation exists for e.g. universal-ctags, which currently installs 
itself as 'uctags'. I would love to be able to create my own "ctags_select" 
group that allows me to use universal-ctags as plain 'ctags'.

     sudo port select --add ctags ctags ctags uctags
     sudo port select --set ctags uctags

I hope the above provides enough motivation for the feature. Please let me know 
your thoughts. I will start work on a prototype PR if I get a positive (or at 
least, non-negative) response.



More information about the macports-dev mailing list