-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinstall_dependencies.sh
executable file
·81 lines (70 loc) · 2.35 KB
/
install_dependencies.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#! /usr/bin/env bash
set -euo pipefail
install_misc() {
# These dependencies are needed by a couple of different projects including
# redis, protobuf, grpc, etc.
sudo apt-get install \
ant \
autoconf \
automake \
curl \
g++ \
libcurl4-openssl-dev \
libev-dev\
libhiredis-dev \
libssl-dev \
libtool \
libuv-dev \
make \
unzip \
zlib1g-dev \
}
install_clang() {
sudo bash -c "echo '' >> /etc/apt/sources.list"
sudo bash -c "echo '# http://apt.llvm.org/' >> /etc/apt/sources.list"
sudo bash -c "echo 'deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-4.0 main' >> /etc/apt/sources.list"
sudo bash -c "echo 'deb-src http://apt.llvm.org/trusty/ llvm-toolchain-trusty-4.0 main' >> /etc/apt/sources.list"
wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-get -y update
sudo apt-get install -y \
clang-4.0 clang-format-4.0 clang-tidy-4.0 lldb-4.0
sudo ln -s "$(which clang-4.0)" /usr/bin/clang
sudo ln -s "$(which clang++-4.0)" /usr/bin/clang++
sudo ln -s "$(which clang-format-4.0)" /usr/bin/clang-format
sudo ln -s "$(which clang-tidy-4.0)" /usr/bin/clang-tidy
sudo ln -s "$(which lldb-4.0)" /usr/bin/lldb
sudo ln -s "$(which lldb-server-4.0)" /usr/bin/lldb-server
}
install_gpp() {
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install -y g++-6
sudo ln -sf "$(which /usr/bin/g++-6)" /usr/bin/g++
sudo ln -sf "$(which /usr/bin/gcc-6)" /usr/bin/gcc
}
install_cmake() {
wget 'https://cmake.org/files/v3.6/cmake-3.6.2-Linux-x86_64.sh'
sh cmake-3.6.2-Linux-x86_64.sh --skip-license
echo 'export PATH="$PATH:$HOME/cmake-3.6.2-Linux-x86_64/bin"' >> ~/.bash_path
}
install_boost() {
sudo apt-get install libboost-dev
}
install_postgres() {
sudo bash -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install -y postgresql-9.6 postgresql-server-dev-9.6 python-dev
}
main() {
set -x
sudo apt-get -y update
install_misc
install_clang
install_gpp
install_cmake
install_boost
install_postgres
set +x
}
main