blob: 0ddc65ffaba122f09e4687d5d287d310f6abf4e6 [file] [log] [blame]
Isaac Wilcovecfd9a032017-01-15 00:08:58 +00001#!/usr/bin/env bash
2
3set -e
4set -u
5
6export DEBIAN_FRONTEND=noninteractive
7
8readonly PKGS=(
Philipp Schrader29443be2017-11-26 18:14:53 -08009 clang-3.9
10 clang-format-3.9
11 curl
Isaac Wilcovecfd9a032017-01-15 00:08:58 +000012 gfortran
13 git
Philipp Schrader29443be2017-11-26 18:14:53 -080014 g++
Isaac Wilcovecfd9a032017-01-15 00:08:58 +000015 libblas-dev
16 liblapack-dev
17 libpython3-dev
18 libpython-dev
Philipp Schrader29443be2017-11-26 18:14:53 -080019 openjdk-8-jdk
Isaac Wilcovecfd9a032017-01-15 00:08:58 +000020 python3
21 python3-matplotlib
22 python3-numpy
23 python3-scipy
24 python-matplotlib
25 python-scipy
26 resolvconf
27 ruby
Philipp Schrader29443be2017-11-26 18:14:53 -080028 zlib1g-dev
Isaac Wilcovecfd9a032017-01-15 00:08:58 +000029)
30
31# Set up the backports repo.
32cat > /etc/apt/sources.list.d/backports.list <<EOT
Philipp Schrader29443be2017-11-26 18:14:53 -080033deb http://http.debian.net/debian stretch-backports main contrib
Isaac Wilcovecfd9a032017-01-15 00:08:58 +000034EOT
35
36# Set up the LLVM repo.
Philipp Schrader29443be2017-11-26 18:14:53 -080037cat > /etc/apt/sources.list.d/llvm-apt.list <<EOT
38deb http://apt.llvm.org/jessie/ llvm-toolchain-jessie main
39deb-src http://apt.llvm.org/jessie/ llvm-toolchain-jessie main
Isaac Wilcovecfd9a032017-01-15 00:08:58 +000040EOT
41
42# Enable user namespace for sandboxing.
43cat > /etc/sysctl.d/99-enable-user-namespaces.conf <<EOT
44kernel.unprivileged_userns_clone = 1
45EOT
46
Isaac Wilcovecfd9a032017-01-15 00:08:58 +000047# Accept the LLVM GPG key so we can install their packages.
48wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | apt-key add -
49
50# Install all the packages that we need/want.
51apt-get update
52for pkg in "${PKGS[@]}"; do
Philipp Schrader29443be2017-11-26 18:14:53 -080053 apt-get install -y -f --allow-change-held-packages "$pkg"
Isaac Wilcovecfd9a032017-01-15 00:08:58 +000054done
Philipp Schrader29443be2017-11-26 18:14:53 -080055
56# Install bazel if necessary.
57if ! dpkg -l bazel > /dev/null; then
58 pushd /tmp
59 curl -OL 'https://github.com/bazelbuild/bazel/releases/download/0.8.1/bazel_0.8.1-linux-x86_64.deb'
60 dpkg -i bazel_0.8.1-linux-x86_64.deb
61 popd
62fi