Use matrix to perform the same build steps for different platforms and
account for FreeBSD specific things by explicitly checking the OS name
in the scripts.
In many cases it should be 'either'.
No changes to actual code.
Complements #22723, which focused on API docs and comments in C++ code.
Co-authored-by: Ian McInerney <ian.s.mcinerney@ieee.org>
See #22798.
This is useful now that it uses different commands for installing
packages under different systems, as it means that we don't have to
write these commands manually in the CI configuration files.
The situation with Python under FreeBSD is pretty weird, with system
Python being 3.7, but pip only available as py38-pip package and,
unsurprisingly, not working with python3.
This could probably be resolved somehow, but for now I just don't have
enough energy to fight with Python again, so simply don't use it.