]>
Commit | Line | Data |
---|---|---|
1e59de90 TL |
1 | #!/bin/sh |
2 | ||
3 | # Usage: | |
4 | # LLVM_OS: LLVM OS release to obtain clang binaries. Only needed for clang install. | |
5 | # LLVM_VER: The LLVM toolset version to point the repo at. | |
6 | # PACKAGES: Compiler packages to install. | |
7 | ||
8 | if command -v sudo ; then | |
9 | SUDO="sudo -E" | |
10 | fi | |
11 | OS_ISSUE=`cat /etc/issue | head -n1 | cut -d " " -f1` | |
12 | echo ">>>>> OS Issue: ${OS_ISSUE}" | |
13 | ||
14 | PACKAGES=${PACKAGES:-build-essential} | |
15 | ||
16 | set -e | |
17 | echo ">>>>>" | |
18 | echo ">>>>> APT: UPDATE.." | |
19 | echo ">>>>>" | |
20 | ${SUDO} apt-get -o Acquire::Retries=3 update | |
21 | echo ">>>>>" | |
22 | echo ">>>>> APT: REPO.." | |
23 | echo ">>>>>" | |
24 | ${SUDO} apt-get -o Acquire::Retries=3 -y install software-properties-common | |
25 | if test "${OS_ISSUE}" = "Ubuntu" ; then | |
26 | ${SUDO} apt-add-repository -y "ppa:ubuntu-toolchain-r/test" | |
27 | fi | |
28 | if test -n "${LLVM_OS}" ; then | |
29 | wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - | |
30 | ${SUDO} apt-add-repository "deb http://apt.llvm.org/${LLVM_OS}/ llvm-toolchain-${LLVM_OS}-${LLVM_VER} main" | |
31 | fi | |
32 | echo ">>>>>" | |
33 | echo ">>>>> APT: UPDATE.." | |
34 | echo ">>>>>" | |
35 | ${SUDO} apt-get -o Acquire::Retries=3 update | |
36 | echo ">>>>>" | |
37 | echo ">>>>> APT: INSTALL ${PACKAGES}.." | |
38 | echo ">>>>>" | |
39 | ${SUDO} apt-get -o Acquire::Retries=3 -yq --no-install-suggests --no-install-recommends install ${PACKAGES} | |
40 | ||
41 | # Use, modification, and distribution are | |
42 | # subject to the Boost Software License, Version 1.0. (See accompanying | |
43 | # file LICENSE.txt) | |
44 | # | |
45 | # Copyright René Ferdinand Rivera Morell 2020-2022. |