on 89ee925 help sign in
stackage/debian-bootstrap.sh
183 lines 5.2 kB history raw
1#!/usr/bin/env bash
3# Work in progress: create a list of commands necessary to get Stackage
4# up-and-running on a freshly installed Debian-based system (including Ubuntu).
6# Quick start:
7# wget -O - https://raw.github.com/fpco/stackage/master/debian-bootstrap.sh | bash -ex
9# NOTE: Requires that GHC and Cabal are installed and on your PATH. For
10# instructions, see:
11# http://www.stackage.org/install
13set -exu
15mkdir /home/stackage -p
17export DEBIAN_FRONTEND=noninteractive
18apt-get update
19apt-get install -y software-properties-common
21add-apt-repository ppa:hvr/ghc -y
22add-apt-repository -y ppa:marutter/rrutter
24GHCVER=8.0.2
26apt-get update
27apt-get install -y \
28 build-essential \
29 ghc-$GHCVER \
30 ghc-$GHCVER-dyn \
31 ghc-$GHCVER-prof \
32 ghc-$GHCVER-htmldocs \
33 hscolour \
34 sudo \
35 curl \
36 freeglut3-dev \
37 git \
38 gradle \
39 libadns1-dev \
40 libaio1 \
41 libalut-dev \
42 libasound2-dev \
43 libblas-dev \
44 libbz2-dev \
45 libcairo2-dev \
46 libclang-3.7-dev \
47 libcurl4-openssl-dev \
48 libdevil-dev \
49 libedit-dev \
50 libedit2 \
51 libfftw3-dev \
52 libflac-dev \
53 libfreenect-dev \
54 libgd2-xpm-dev \
55 libgeoip-dev \
56 libgirepository1.0-dev \
57 libglfw3-dev \
58 libglib2.0-dev \
59 libglu1-mesa-dev \
60 libgmp3-dev \
61 libgnutls-dev \
62 libgsasl7-dev \
63 libgsl0-dev \
64 libgtk-3-dev \
65 libgtk2.0-dev \
66 libgtksourceview-3.0-dev \
67 libhidapi-dev \
68 libicu-dev \
69 libjudy-dev \
70 liblapack-dev \
71 libleveldb-dev \
72 liblmdb-dev \
73 liblzma-dev \
74 libmagic-dev \
75 libmagickcore-dev \
76 libmagickwand-dev \
77 libmarkdown2-dev \
78 libmp3lame-dev \
79 libmpfr-dev \
80 libmysqlclient-dev \
81 libncurses-dev \
82 libnfc-dev \
83 libnotify-dev \
84 libopenal-dev \
85 libpango1.0-dev \
86 libpcap0.8-dev \
87 libpq-dev \
88 libsdl2-dev \
89 libsdl2-mixer-dev \
90 libsdl2-image-dev \
91 libsdl2-gfx-dev \
92 libsdl2-ttf-dev \
93 libsnappy-dev \
94 libsndfile1-dev \
95 libsqlite3-dev \
96 libssl-dev \
97 libsystemd-dev \
98 libtagc0-dev \
99 libtre-dev \
100 libudev-dev \
101 libusb-1.0-0-dev \
102 libwebkitgtk-3.0-dev \
103 libxau-dev \
104 libxml2-dev \
105 libxrandr-dev \
106 libxss-dev \
107 libyaml-dev \
108 libzip-dev \
109 libzmq3-dev \
110 llvm-3.7 \
111 locales \
112 m4 \
113 nettle-dev \
114 nodejs \
115 npm \
116 openjdk-8-jdk \
117 protobuf-compiler \
118 python-mpltoolkits.basemap \
119 python3-matplotlib \
120 python3-numpy \
121 python3-pip \
122 r-base \
123 r-base-dev \
124 ruby-dev \
125 wget \
126 xclip \
127 z3 \
128 zip \
129 zlib1g-dev
131locale-gen en_US.UTF-8
133curl -sSL https://get.haskellstack.org/ | sh
135# Put documentation where we expect it
136mv /opt/ghc/$GHCVER/share/doc/ghc-$GHCVER/ /opt/ghc/$GHCVER/share/doc/ghc
138# Buggy versions of ld.bfd fail to link some Haskell packages:
139# https://sourceware.org/bugzilla/show_bug.cgi?id=17689. Gold is
140# faster anyways and uses less RAM.
141update-alternatives --install "/usr/bin/ld" "ld" "/usr/bin/ld.gold" 20
142update-alternatives --install "/usr/bin/ld" "ld" "/usr/bin/ld.bfd" 10
144# GHC requires a specific LLVM version on the system PATH for its LLVM backend.
145# This version is tracked here:
146# https://ghc.haskell.org/trac/ghc/wiki/Commentary/Compiler/Backends/LLVM/Installing
148# GHC 8.0 requires LLVM 3.7 tools (specifically, llc-3.7 and opt-3.7).
149update-alternatives --install "/usr/bin/llc" "llc" "/usr/bin/llc-3.7" 50
150update-alternatives --install "/usr/bin/opt" "opt" "/usr/bin/opt-3.7" 50
152# install ocilib dependencies then build and install ocilib
153cd /tmp \
154 && wget https://storage.googleapis.com/oracle.fpinsight.com/instantClient/oracle-instantclient12.1-basiclite_12.1.0.2.0-2_amd64.deb \
155 && dpkg -i oracle-instantclient12.1-basiclite_12.1.0.2.0-2_amd64.deb \
156 && rm -f oracle-instantclient12.1-basiclite_12.1.0.2.0-2_amd64.deb \
157 && wget https://storage.googleapis.com/oracle.fpinsight.com/instantClient/oracle-instantclient12.1-devel_12.1.0.2.0-2_amd64.deb \
158 && dpkg -i oracle-instantclient12.1-devel_12.1.0.2.0-2_amd64.deb \
159 && rm -f oracle-instantclient12.1-devel_12.1.0.2.0-2_amd64.deb \
160 && wget https://github.com/vrogier/ocilib/archive/v4.3.2.tar.gz \
161 && tar xvf v4.3.2.tar.gz \
162 && cd /tmp/ocilib-4.3.2 \
163 && ./configure --with-oracle-import=linkage \
164 --with-oracle-charset=ansi \
165 --with-oracle-headers-path=/usr/include/oracle/12.1/client64 \
166 --with-oracle-lib-path=/usr/lib/oracle/12.1/client64/lib \
167 && make \
168 && make install \
169 && cd \
170 && rm -rf /tmp/ocilib-4.3.2 \
171 && echo "/usr/local/lib" > /etc/ld.so.conf.d/usr-local.conf \
172 && echo "/usr/lib/oracle/12.1/client64/lib" > /etc/ld.so.conf.d/oracle-client.conf \
173 && ldconfig
175# Add JDK to system paths.
176echo "/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/" > /etc/ld.so.conf.d/openjdk.conf \
177 && ldconfig
179# llvm-4.0 for llvm-hs (separate since it needs wget)
180wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \
181 && add-apt-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-4.0 main" \
182 && apt-get update \
183 && apt-get install -y llvm-4.0