Files
predef/tools/ci/linux-cxx-install.sh

48 lines
1.3 KiB
Bash
Raw Permalink Normal View History

2021-01-02 17:57:43 -06:00
#!/bin/sh
# Usage:
# LLVM_OS: LLVM OS release to obtain clang binaries. Only needed for clang install.
# LLVM_VER: The LLVM toolset version to point the repo at.
# PACKAGES: Compiler packages to install.
2022-02-26 23:34:52 -06:00
if command -v sudo ; then
SUDO="sudo -E"
fi
OS_ISSUE=`cat /etc/issue | head -n1 | cut -d " " -f1`
echo ">>>>> OS Issue: ${OS_ISSUE}"
PACKAGES=${PACKAGES:-build-essential}
APT_OPT="-o Acquire::Retries=3 -yq"
2022-02-26 23:34:52 -06:00
2021-01-02 17:57:43 -06:00
set -e
echo ">>>>>"
echo ">>>>> APT: UPDATE 1/2.."
2022-02-26 23:34:52 -06:00
echo ">>>>>"
${SUDO} apt-get ${APT_OPT} update
echo ">>>>>"
echo ">>>>> APT: INSTALL 1/2: wget.."
echo ">>>>>"
${SUDO} apt-get ${APT_OPT} install wget
2022-02-26 23:34:52 -06:00
echo ">>>>>"
2021-01-02 17:57:43 -06:00
echo ">>>>> APT: REPO.."
echo ">>>>>"
${SUDO} apt-get ${APT_OPT} install software-properties-common
2022-02-26 23:34:52 -06:00
if test -n "${LLVM_OS}" ; then
2021-01-02 17:57:43 -06:00
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
2022-02-26 23:34:52 -06:00
${SUDO} apt-add-repository "deb http://apt.llvm.org/${LLVM_OS}/ llvm-toolchain-${LLVM_OS}-${LLVM_VER} main"
2021-01-02 17:57:43 -06:00
fi
echo ">>>>>"
echo ">>>>> APT: UPDATE 2/2.."
2021-01-02 17:57:43 -06:00
echo ">>>>>"
${SUDO} apt-get ${APT_OPT} update
2021-01-02 17:57:43 -06:00
echo ">>>>>"
echo ">>>>> APT: INSTALL 2/2: ${PACKAGES}.."
2021-01-02 17:57:43 -06:00
echo ">>>>>"
${SUDO} apt-get ${APT_OPT} install ${PACKAGES}
2021-01-02 17:57:43 -06:00
# Use, modification, and distribution are
# subject to the Boost Software License, Version 1.0. (See accompanying
# file LICENSE.txt)
#
2022-02-26 23:34:52 -06:00
# Copyright René Ferdinand Rivera Morell 2020-2022.