on cd4b7fc help sign in
stackage/debian-bootstrap.sh
191 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 mono-mcs \
115 nettle-dev \
116 nodejs \
117 npm \
118 openjdk-8-jdk \
119 protobuf-compiler \
120 python-mpltoolkits.basemap \
121 python3-matplotlib \
122 python3-numpy \
123 python3-pip \
124 r-base \
125 r-base-dev \
126 ruby-dev \
127 wget \
128 xclip \
129 z3 \
130 zip \
131 zlib1g-dev
133locale-gen en_US.UTF-8
135curl -sSL https://get.haskellstack.org/ | sh
137# Put documentation where we expect it
138mv /opt/ghc/$GHCVER/share/doc/ghc-$GHCVER/ /opt/ghc/$GHCVER/share/doc/ghc
140# Buggy versions of ld.bfd fail to link some Haskell packages:
141# https://sourceware.org/bugzilla/show_bug.cgi?id=17689. Gold is
142# faster anyways and uses less RAM.
143update-alternatives --install "/usr/bin/ld" "ld" "/usr/bin/ld.gold" 20
144update-alternatives --install "/usr/bin/ld" "ld" "/usr/bin/ld.bfd" 10
146# GHC requires a specific LLVM version on the system PATH for its LLVM backend.
147# This version is tracked here:
148# https://ghc.haskell.org/trac/ghc/wiki/Commentary/Compiler/Backends/LLVM/Installing
150# GHC 8.0 requires LLVM 3.7 tools (specifically, llc-3.7 and opt-3.7).
151update-alternatives --install "/usr/bin/llc" "llc" "/usr/bin/llc-3.7" 50
152update-alternatives --install "/usr/bin/opt" "opt" "/usr/bin/opt-3.7" 50
154# install ocilib dependencies then build and install ocilib
155cd /tmp \
156 && wget https://storage.googleapis.com/oracle.fpinsight.com/instantClient/oracle-instantclient12.1-basiclite_12.1.0.2.0-2_amd64.deb \
157 && dpkg -i oracle-instantclient12.1-basiclite_12.1.0.2.0-2_amd64.deb \
158 && rm -f oracle-instantclient12.1-basiclite_12.1.0.2.0-2_amd64.deb \
159 && wget https://storage.googleapis.com/oracle.fpinsight.com/instantClient/oracle-instantclient12.1-devel_12.1.0.2.0-2_amd64.deb \
160 && dpkg -i oracle-instantclient12.1-devel_12.1.0.2.0-2_amd64.deb \
161 && rm -f oracle-instantclient12.1-devel_12.1.0.2.0-2_amd64.deb \
162 && wget https://github.com/vrogier/ocilib/archive/v4.3.2.tar.gz \
163 && tar xvf v4.3.2.tar.gz \
164 && cd /tmp/ocilib-4.3.2 \
165 && ./configure --with-oracle-import=linkage \
166 --with-oracle-charset=ansi \
167 --with-oracle-headers-path=/usr/include/oracle/12.1/client64 \
168 --with-oracle-lib-path=/usr/lib/oracle/12.1/client64/lib \
169 && make \
170 && make install \
171 && cd \
172 && rm -rf /tmp/ocilib-4.3.2 \
173 && echo "/usr/local/lib" > /etc/ld.so.conf.d/usr-local.conf \
174 && echo "/usr/lib/oracle/12.1/client64/lib" > /etc/ld.so.conf.d/oracle-client.conf \
175 && ldconfig
177# Add JDK to system paths.
178echo "/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/" > /etc/ld.so.conf.d/openjdk.conf \
179 && ldconfig
181# currently the repo seems broken
182# # llvm-4.0 for llvm-hs (separate since it needs wget)
183# wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \
184# && add-apt-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-4.0 main" \
185# && apt-get update \
186# && apt-get install -y llvm-4.0
188## non-free repo for mediabus-fdk-aac
189#apt-add-repository multiverse \
190# && apt-get update \
191# && apt-get install -y libfdk-aac-dev