Do you have a script example that install the C++ g++ tools after a new FreeBSD install so can compile C++ code immediately after?

In an apt (debian like) distro it goes this way:
[using cmake, git, g++]
Code:
function install_pkg()
{
status="$(dpkg-query -W --showformat='${db:Status-Status}' "$1" 2>&1)"
if [ ! $? = 0 ] || [ ! "$status" = installed ]
then
sudo apt -y install $1
else
echo "$1 is already installed"
fi
}

install_pkg g++
install_pkg build-essential
install_pkg cmake
install_pkg git

// notcurses is use as a C++ example
// notcurses dependencies
install_pkg doctest-dev
install_pkg libavdevice-dev
install_pkg libdeflate-dev
install_pkg libgpm-dev
install_pkg libncurses-dev
install_pkg libqrcodegen-dev
install_pkg libswscale-dev
install_pkg libunistring-dev
install_pkg pandoc
install_pkg pkg-config

git clone [URL]https://github.com/dankamongmen/notcurses.git[/URL]
cmake ..
make
sudo make install
 
Last edited by a moderator:
Not sure about cmake. Git definitely isn’t in base.
True, but can easily be installed; pkg install git cmake. Don't really need a script for this.

Not sure what all the other necessities are, maybe if the OP told us what their intentions are we can give some better advice.
 
Back
Top