Skip to content
This repository was archived by the owner on Sep 27, 2019. It is now read-only.

Commit 7303e51

Browse files
committed
Updated package.sh to support Ubuntu 17
1 parent de83ab5 commit 7303e51

File tree

1 file changed

+34
-7
lines changed

1 file changed

+34
-7
lines changed

script/installation/packages.sh

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,21 @@ TMPDIR=/tmp
4141
## UBUNTU
4242
## ------------------------------------------------
4343
if [ "$DISTRO" = "UBUNTU" ]; then
44-
# Fix for LLVM-3.7 on Ubuntu 14.04
45-
if [ "$DISTRO_VER" == "14.04" ]; then
46-
if ! grep -q 'deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.7 main' /etc/apt/sources.list; then
47-
echo 'deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.7 main' | sudo tee -a /etc/apt/sources.list > /dev/null
44+
MAJOR_VER=$(echo "$DISTRO_VER" | cut -d '.' -f 1)
45+
46+
# Fix for LLVM-3.7 on Ubuntu 14 + 17
47+
if [ "$MAJOR_VER" == "14" -o "$MAJOR_VER" == "17" ]; then
48+
if [ "$MAJOR_VER" == "14" ]; then
49+
LLVM_PKG_URL="http://llvm.org/apt/trusty/"
50+
LLVM_PKG_TARGET="llvm-toolchain-trusty-3.7 main"
51+
fi
52+
if [ "$MAJOR_VER" == "17" ]; then
53+
LLVM_PKG_URL="http://apt.llvm.org/artful/"
54+
LLVM_PKG_TARGET="llvm-toolchain-artful main"
55+
fi
56+
57+
if ! grep -q "deb $LLVM_PKG_URL $LLVM_PKG_TARGET" /etc/apt/sources.list; then
58+
echo -e "\n# Added by Peloton 'packages.sh' script on $(date)\ndeb $LLVM_PKG_URL $LLVM_PKG_TARGET" | sudo tee -a /etc/apt/sources.list > /dev/null
4859
fi
4960
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 15CF4D18AF4F7421
5061
sudo apt-get update -qq
@@ -55,11 +66,28 @@ if [ "$DISTRO" = "UBUNTU" ]; then
5566
FORCE_Y=""
5667
fi
5768

69+
FORCE_Y=""
70+
PKG_CMAKE="cmake"
71+
PKG_LLVM="llvm-3.7"
72+
PKG_CLANG="clang-3.7"
73+
74+
# Fix for cmake name change on Ubuntu 14.x and 16.x plus --force-yes deprecation
75+
if [ "$MAJOR_VER" == "14" ]; then
76+
PKG_CMAKE="cmake3"
77+
FORCE_Y="--force-yes"
78+
fi
79+
# Fix for llvm on Ubuntu 17.x
80+
if [ "$MAJOR_VER" == "17" ]; then
81+
PKG_LLVM="llvm-3.9"
82+
PKG_CLANG="clang-3.8"
83+
fi
84+
5885
sudo apt-get -qq $FORCE_Y --ignore-missing -y install \
86+
$PKG_CMAKE \
87+
$PKG_LLVM \
88+
$PKG_CLANG \
5989
git \
6090
g++ \
61-
clang-3.7 \
62-
$CMAKE_NAME \
6391
libgflags-dev \
6492
libprotobuf-dev \
6593
protobuf-compiler \
@@ -73,7 +101,6 @@ if [ "$DISTRO" = "UBUNTU" ]; then
73101
valgrind \
74102
lcov \
75103
libpqxx-dev \
76-
llvm-3.7 \
77104
libedit-dev \
78105
postgresql-client
79106

0 commit comments

Comments
 (0)