-
Notifications
You must be signed in to change notification settings - Fork 2
/
install-deps.sh
executable file
·55 lines (50 loc) · 1.68 KB
/
install-deps.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/env bash
die() {
echo "$(basename "$0"): error: $*" >&2
exit 1
}
LLVM_VERSION="11"
if [[ "$(uname)" = "Darwin" ]]; then
brew install \
"llvm@$LLVM_VERSION" \
bdw-gc \
pkg-config \
libsodium
else
apt update -y
apt install -y \
apt-utils \
cmake \
shellcheck \
gnupg2 \
libgc-dev \
libsodium-dev \
lsb-release \
make \
pkg-config \
software-properties-common \
wget
# Use the ordained script from https://apt.llvm.org/
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
./llvm.sh "$LLVM_VERSION"
# Ensure the rest of the LLVM dependencies are available and mapped to sane
# names.
apt-get install -y \
clang-format-"${LLVM_VERSION}" \
clang-tools-"${LLVM_VERSION}" \
libclang-"${LLVM_VERSION}"-dev \
libclang-common-"${LLVM_VERSION}"-dev \
libllvm${LLVM_VERSION} \
llvm-"${LLVM_VERSION}" \
llvm-"${LLVM_VERSION}"-dev \
llvm-"${LLVM_VERSION}"-runtime \
llvm-"${LLVM_VERSION}"-tools \
|| die "failed to install clang and llvm (and dependencies)..."
update-alternatives --install /usr/bin/llvm-link llvm-link /usr/bin/llvm-link-"${LLVM_VERSION}" 100 && \
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-"${LLVM_VERSION}" 100 && \
update-alternatives --install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-"${LLVM_VERSION}" 100 && \
update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-"${LLVM_VERSION}" 100 && \
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-"${LLVM_VERSION}" 100 && \
update-alternatives --install /usr/bin/lldb lldb /usr/bin/lldb-"${LLVM_VERSION}" 100
fi