on d56fd19 help sign in
stackage/debian-bootstrap.sh
169 lines 4.9 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
16locale-gen en_US.UTF-8
18export DEBIAN_FRONTEND=noninteractive
19apt-get update
20apt-get install -y software-properties-common
22add-apt-repository ppa:hvr/ghc -y
23add-apt-repository -y ppa:marutter/rrutter
24# not sure what this was needed for
25#add-apt-repository -y ppa:openstack-ubuntu-testing/icehouse
27# Set the GHC version
28GHCVER=8.0.1
30# Get Stack
31apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 575159689BEFB442
32echo 'deb http://download.fpcomplete.com/ubuntu xenial main'|tee /etc/apt/sources.list.d/fpco.list
34apt-get update
35apt-get install -y \
36 build-essential \
37 ghc-$GHCVER \
38 ghc-$GHCVER-dyn \
39 ghc-$GHCVER-prof \
40 ghc-$GHCVER-htmldocs \
41 hscolour \
42 sudo \
43 curl \
44 freeglut3-dev \
45 git \
46 libadns1-dev \
47 libaio1 \
48 libalut-dev \
49 libasound2-dev \
50 libblas-dev \
51 libbz2-dev \
52 libcairo2-dev \
53 libclang-3.7-dev \
54 libcurl4-openssl-dev \
55 libdevil-dev \
56 libedit-dev \
57 libedit2 \
58 libfftw3-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 libmpfr-dev \
85 libmysqlclient-dev \
86 libncurses-dev \
87 libnfc-dev \
88 libnotify-dev \
89 libopenal-dev \
90 libpango1.0-dev \
91 libpcap0.8-dev \
92 libpq-dev \
93 libsdl2-dev \
94 libsnappy-dev \
95 libsndfile1-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 m4 \
113 nettle-dev \
114 nodejs \
115 npm \
116 openjdk-8-jdk \
117 r-base \
118 r-base-dev \
119 ruby-dev \
120 stack \
121 wget \
122 xclip \
123 z3 \
124 zip \
125 zlib1g-dev
127# Put documentation where we expect it
128mv /opt/ghc/$GHCVER/share/doc/ghc-$GHCVER/ /opt/ghc/$GHCVER/share/doc/ghc
130# Buggy versions of ld.bfd fail to link some Haskell packages:
131# https://sourceware.org/bugzilla/show_bug.cgi?id=17689. Gold is
132# faster anyways and uses less RAM.
133update-alternatives --install "/usr/bin/ld" "ld" "/usr/bin/ld.gold" 20
134update-alternatives --install "/usr/bin/ld" "ld" "/usr/bin/ld.bfd" 10
136# GHC requires a specific LLVM version on the system PATH for its LLVM backend.
137# This version is tracked here:
138# https://ghc.haskell.org/trac/ghc/wiki/Commentary/Compiler/Backends/LLVM/Installing
140# GHC 8.0 requires LLVM 3.7 tools (specifically, llc-3.7 and opt-3.7).
141update-alternatives --install "/usr/bin/llc" "llc" "/usr/bin/llc-3.7" 50
142update-alternatives --install "/usr/bin/opt" "opt" "/usr/bin/opt-3.7" 50
144# install ocilib dependencies then build and install ocilib
145cd /tmp \
146 && wget https://storage.googleapis.com/oracle.fpinsight.com/instantClient/oracle-instantclient12.1-basiclite_12.1.0.2.0-2_amd64.deb \
147 && dpkg -i oracle-instantclient12.1-basiclite_12.1.0.2.0-2_amd64.deb \
148 && rm -f oracle-instantclient12.1-basiclite_12.1.0.2.0-2_amd64.deb \
149 && wget https://storage.googleapis.com/oracle.fpinsight.com/instantClient/oracle-instantclient12.1-devel_12.1.0.2.0-2_amd64.deb \
150 && dpkg -i oracle-instantclient12.1-devel_12.1.0.2.0-2_amd64.deb \
151 && rm -f oracle-instantclient12.1-devel_12.1.0.2.0-2_amd64.deb \
152 && wget https://github.com/vrogier/ocilib/archive/v4.2.1.tar.gz \
153 && tar xvf v4.2.1.tar.gz \
154 && cd /tmp/ocilib-4.2.1 \
155 && ./configure --with-oracle-import=linkage \
156 --with-oracle-charset=ansi \
157 --with-oracle-headers-path=/usr/include/oracle/12.1/client64 \
158 --with-oracle-lib-path=/usr/lib/oracle/12.1/client64/lib \
159 && make \
160 && make install \
161 && cd \
162 && rm -rf /tmp/ocilib-4.2.1 \
163 && echo "/usr/local/lib" > /etc/ld.so.conf.d/usr-local.conf \
164 && echo "/usr/lib/oracle/12.1/client64/lib" > /etc/ld.so.conf.d/oracle-client.conf \
165 && ldconfig
167# Add JDK to system paths.
168echo "/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/" > /etc/ld.so.conf.d/openjdk.conf \
169 && ldconfig