blob: cbb8fcd45810112f6f74ab8bc421f473ca0cf47f [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 Schrader85a71fa2017-12-20 19:35:22 -08009 bazel
10 clang-3.6
11 clang-format-3.5
Isaac Wilcovecfd9a032017-01-15 00:08:58 +000012 gfortran
13 git
14 libblas-dev
15 liblapack-dev
16 libpython3-dev
17 libpython-dev
18 python3
19 python3-matplotlib
20 python3-numpy
21 python3-scipy
22 python-matplotlib
23 python-scipy
24 resolvconf
25 ruby
26)
27
28# Set up the backports repo.
29cat > /etc/apt/sources.list.d/backports.list <<EOT
Philipp Schrader85a71fa2017-12-20 19:35:22 -080030deb http://http.debian.net/debian jessie-backports main
Isaac Wilcovecfd9a032017-01-15 00:08:58 +000031EOT
32
33# Set up the LLVM repo.
Philipp Schrader85a71fa2017-12-20 19:35:22 -080034cat > /etc/apt/sources.list.d/llvm-3.6.list <<EOT
35deb http://llvm.org/apt/jessie/ llvm-toolchain-jessie-3.6 main
36deb-src http://llvm.org/apt/jessie/ llvm-toolchain-jessie-3.6 main
37EOT
38
39# Set up the 971-managed bazel repo.
40cat > /etc/apt/sources.list.d/bazel-971.list <<EOT
41deb http://robotics.mvla.net/files/frc971/packages jessie main
Isaac Wilcovecfd9a032017-01-15 00:08:58 +000042EOT
43
44# Enable user namespace for sandboxing.
45cat > /etc/sysctl.d/99-enable-user-namespaces.conf <<EOT
46kernel.unprivileged_userns_clone = 1
47EOT
48
Philipp Schrader85a71fa2017-12-20 19:35:22 -080049# We need to explicitly pull in the java certificates from backports. Otherwise
50# bazel won't install properly.
51cat > /etc/apt/preferences.d/java_certificates <<EOT
52Package: ca-certificates-java
53Pin: release a=jessie-backports
54Pin-Priority: 900
55EOT
56
Isaac Wilcovecfd9a032017-01-15 00:08:58 +000057# Accept the LLVM GPG key so we can install their packages.
58wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | apt-key add -
59
60# Install all the packages that we need/want.
61apt-get update
62for pkg in "${PKGS[@]}"; do
Philipp Schrader85a71fa2017-12-20 19:35:22 -080063 apt-get install -y -f --force-yes "$pkg"
Isaac Wilcovecfd9a032017-01-15 00:08:58 +000064done