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