In an apt (debian like) distro it goes this way:
[using cmake, git, g++]
[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: