on 266dd21 help sign in
stackage/debian-bootstrap.sh
189 lines 5.4 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 libsox-dev \
96 libsqlite3-dev \
97 libssl-dev \
98 libsystemd-dev \
99 libtagc0-dev \
100 libtre-dev \
101 libudev-dev \
102 libusb-1.0-0-dev \
103 libwebkitgtk-3.0-dev \
104 libxau-dev \
105 libxml2-dev \
106 libxrandr-dev \
107 libxss-dev \
108 libyaml-dev \
109 libzip-dev \
110 libzmq3-dev \
111 llvm-3.7 \
112 locales \
113 m4 \
114 nettle-dev \
115 nodejs \
116 npm \
117 openjdk-8-jdk \
118 protobuf-compiler \
119 python-mpltoolkits.basemap \
120 python3-matplotlib \
121 python3-numpy \
122 python3-pip \
123 r-base \
124 r-base-dev \
125 ruby-dev \
126 wget \
127 xclip \
128 z3 \
129 zip \
130 zlib1g-dev
132locale-gen en_US.UTF-8
134curl -sSL https://get.haskellstack.org/ | sh
136# Put documentation where we expect it
137mv /opt/ghc/$GHCVER/share/doc/ghc-$GHCVER/ /opt/ghc/$GHCVER/share/doc/ghc
139# Buggy versions of ld.bfd fail to link some Haskell packages:
140# https://sourceware.org/bugzilla/show_bug.cgi?id=17689. Gold is
141# faster anyways and uses less RAM.
142update-alternatives --install "/usr/bin/ld" "ld" "/usr/bin/ld.gold" 20
143update-alternatives --install "/usr/bin/ld" "ld" "/usr/bin/ld.bfd" 10
145# GHC requires a specific LLVM version on the system PATH for its LLVM backend.
146# This version is tracked here:
147# https://ghc.haskell.org/trac/ghc/wiki/Commentary/Compiler/Backends/LLVM/Installing
149# GHC 8.0 requires LLVM 3.7 tools (specifically, llc-3.7 and opt-3.7).
150update-alternatives --install "/usr/bin/llc" "llc" "/usr/bin/llc-3.7" 50
151update-alternatives --install "/usr/bin/opt" "opt" "/usr/bin/opt-3.7" 50
153# install ocilib dependencies then build and install ocilib
154cd /tmp \
155 && wget https://storage.googleapis.com/oracle.fpinsight.com/instantClient/oracle-instantclient12.1-basiclite_12.1.0.2.0-2_amd64.deb \
156 && dpkg -i oracle-instantclient12.1-basiclite_12.1.0.2.0-2_amd64.deb \
157 && rm -f oracle-instantclient12.1-basiclite_12.1.0.2.0-2_amd64.deb \
158 && wget https://storage.googleapis.com/oracle.fpinsight.com/instantClient/oracle-instantclient12.1-devel_12.1.0.2.0-2_amd64.deb \
159 && dpkg -i oracle-instantclient12.1-devel_12.1.0.2.0-2_amd64.deb \
160 && rm -f oracle-instantclient12.1-devel_12.1.0.2.0-2_amd64.deb \
161 && wget https://github.com/vrogier/ocilib/archive/v4.3.2.tar.gz \
162 && tar xvf v4.3.2.tar.gz \
163 && cd /tmp/ocilib-4.3.2 \
164 && ./configure --with-oracle-import=linkage \
165 --with-oracle-charset=ansi \
166 --with-oracle-headers-path=/usr/include/oracle/12.1/client64 \
167 --with-oracle-lib-path=/usr/lib/oracle/12.1/client64/lib \
168 && make \
169 && make install \
170 && cd \
171 && rm -rf /tmp/ocilib-4.3.2 \
172 && echo "/usr/local/lib" > /etc/ld.so.conf.d/usr-local.conf \
173 && echo "/usr/lib/oracle/12.1/client64/lib" > /etc/ld.so.conf.d/oracle-client.conf \
174 && ldconfig
176# Add JDK to system paths.
177echo "/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/" > /etc/ld.so.conf.d/openjdk.conf \
178 && ldconfig
180# llvm-4.0 for llvm-hs (separate since it needs wget)
181wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \
182 && add-apt-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-4.0 main" \
183 && apt-get update \
184 && apt-get install -y llvm-4.0
186## non-free repo for mediabus-fdk-aac
187#apt-add-repository multiverse \
188# && apt-get update \
189# && apt-get install -y libfdk-aac-dev