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