Isaac Wilcove | cfd9a03 | 2017-01-15 00:08:58 +0000 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | |
| 3 | set -e |
| 4 | set -u |
| 5 | |
| 6 | export DEBIAN_FRONTEND=noninteractive |
| 7 | |
| 8 | readonly PKGS=( |
Philipp Schrader | 29443be | 2017-11-26 18:14:53 -0800 | [diff] [blame^] | 9 | clang-3.9 |
| 10 | clang-format-3.9 |
| 11 | curl |
Isaac Wilcove | cfd9a03 | 2017-01-15 00:08:58 +0000 | [diff] [blame] | 12 | gfortran |
| 13 | git |
Philipp Schrader | 29443be | 2017-11-26 18:14:53 -0800 | [diff] [blame^] | 14 | g++ |
Isaac Wilcove | cfd9a03 | 2017-01-15 00:08:58 +0000 | [diff] [blame] | 15 | libblas-dev |
| 16 | liblapack-dev |
| 17 | libpython3-dev |
| 18 | libpython-dev |
Philipp Schrader | 29443be | 2017-11-26 18:14:53 -0800 | [diff] [blame^] | 19 | openjdk-8-jdk |
Isaac Wilcove | cfd9a03 | 2017-01-15 00:08:58 +0000 | [diff] [blame] | 20 | python3 |
| 21 | python3-matplotlib |
| 22 | python3-numpy |
| 23 | python3-scipy |
| 24 | python-matplotlib |
| 25 | python-scipy |
| 26 | resolvconf |
| 27 | ruby |
Philipp Schrader | 29443be | 2017-11-26 18:14:53 -0800 | [diff] [blame^] | 28 | zlib1g-dev |
Isaac Wilcove | cfd9a03 | 2017-01-15 00:08:58 +0000 | [diff] [blame] | 29 | ) |
| 30 | |
| 31 | # Set up the backports repo. |
| 32 | cat > /etc/apt/sources.list.d/backports.list <<EOT |
Philipp Schrader | 29443be | 2017-11-26 18:14:53 -0800 | [diff] [blame^] | 33 | deb http://http.debian.net/debian stretch-backports main contrib |
Isaac Wilcove | cfd9a03 | 2017-01-15 00:08:58 +0000 | [diff] [blame] | 34 | EOT |
| 35 | |
| 36 | # Set up the LLVM repo. |
Philipp Schrader | 29443be | 2017-11-26 18:14:53 -0800 | [diff] [blame^] | 37 | cat > /etc/apt/sources.list.d/llvm-apt.list <<EOT |
| 38 | deb http://apt.llvm.org/jessie/ llvm-toolchain-jessie main |
| 39 | deb-src http://apt.llvm.org/jessie/ llvm-toolchain-jessie main |
Isaac Wilcove | cfd9a03 | 2017-01-15 00:08:58 +0000 | [diff] [blame] | 40 | EOT |
| 41 | |
| 42 | # Enable user namespace for sandboxing. |
| 43 | cat > /etc/sysctl.d/99-enable-user-namespaces.conf <<EOT |
| 44 | kernel.unprivileged_userns_clone = 1 |
| 45 | EOT |
| 46 | |
Isaac Wilcove | cfd9a03 | 2017-01-15 00:08:58 +0000 | [diff] [blame] | 47 | # Accept the LLVM GPG key so we can install their packages. |
| 48 | wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | apt-key add - |
| 49 | |
| 50 | # Install all the packages that we need/want. |
| 51 | apt-get update |
| 52 | for pkg in "${PKGS[@]}"; do |
Philipp Schrader | 29443be | 2017-11-26 18:14:53 -0800 | [diff] [blame^] | 53 | apt-get install -y -f --allow-change-held-packages "$pkg" |
Isaac Wilcove | cfd9a03 | 2017-01-15 00:08:58 +0000 | [diff] [blame] | 54 | done |
Philipp Schrader | 29443be | 2017-11-26 18:14:53 -0800 | [diff] [blame^] | 55 | |
| 56 | # Install bazel if necessary. |
| 57 | if ! 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 |
| 62 | fi |