on bb0eb73 help sign in
stackage/debian-bootstrap.sh
170 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.2
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 libflac-dev \
60 libfreenect-dev \
61 libgd2-xpm-dev \
62 libgeoip-dev \
63 libgirepository1.0-dev \
64 libglfw3-dev \
65 libglib2.0-dev \
66 libglu1-mesa-dev \
67 libgmp3-dev \
68 libgnutls-dev \
69 libgsasl7-dev \
70 libgsl0-dev \
71 libgtk-3-dev \
72 libgtk2.0-dev \
73 libgtksourceview-3.0-dev \
74 libhidapi-dev \
75 libicu-dev \
76 libjudy-dev \
77 liblapack-dev \
78 libleveldb-dev \
79 liblmdb-dev \
80 liblzma-dev \
81 libmagic-dev \
82 libmagickcore-dev \
83 libmagickwand-dev \
84 libmarkdown2-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 libsnappy-dev \
96 libsndfile1-dev \
97 libsqlite3-dev \
98 libssl-dev \
99 libsystemd-dev \
100 libtagc0-dev \
101 libtre-dev \
102 libudev-dev \
103 libusb-1.0-0-dev \
104 libwebkitgtk-3.0-dev \
105 libxau-dev \
106 libxml2-dev \
107 libxrandr-dev \
108 libxss-dev \
109 libyaml-dev \
110 libzip-dev \
111 libzmq3-dev \
112 llvm-3.7 \
113 m4 \
114 nettle-dev \
115 nodejs \
116 npm \
117 openjdk-8-jdk \
118 r-base \
119 r-base-dev \
120 ruby-dev \
121 stack \
122 wget \
123 xclip \
124 z3 \
125 zip \
126 zlib1g-dev
128# Put documentation where we expect it
129mv /opt/ghc/$GHCVER/share/doc/ghc-$GHCVER/ /opt/ghc/$GHCVER/share/doc/ghc
131# Buggy versions of ld.bfd fail to link some Haskell packages:
132# https://sourceware.org/bugzilla/show_bug.cgi?id=17689. Gold is
133# faster anyways and uses less RAM.
134update-alternatives --install "/usr/bin/ld" "ld" "/usr/bin/ld.gold" 20
135update-alternatives --install "/usr/bin/ld" "ld" "/usr/bin/ld.bfd" 10
137# GHC requires a specific LLVM version on the system PATH for its LLVM backend.
138# This version is tracked here:
139# https://ghc.haskell.org/trac/ghc/wiki/Commentary/Compiler/Backends/LLVM/Installing
141# GHC 8.0 requires LLVM 3.7 tools (specifically, llc-3.7 and opt-3.7).
142update-alternatives --install "/usr/bin/llc" "llc" "/usr/bin/llc-3.7" 50
143update-alternatives --install "/usr/bin/opt" "opt" "/usr/bin/opt-3.7" 50
145# install ocilib dependencies then build and install ocilib
146cd /tmp \
147 && wget https://storage.googleapis.com/oracle.fpinsight.com/instantClient/oracle-instantclient12.1-basiclite_12.1.0.2.0-2_amd64.deb \
148 && dpkg -i oracle-instantclient12.1-basiclite_12.1.0.2.0-2_amd64.deb \
149 && rm -f oracle-instantclient12.1-basiclite_12.1.0.2.0-2_amd64.deb \
150 && wget https://storage.googleapis.com/oracle.fpinsight.com/instantClient/oracle-instantclient12.1-devel_12.1.0.2.0-2_amd64.deb \
151 && dpkg -i oracle-instantclient12.1-devel_12.1.0.2.0-2_amd64.deb \
152 && rm -f oracle-instantclient12.1-devel_12.1.0.2.0-2_amd64.deb \
153 && wget https://github.com/vrogier/ocilib/archive/v4.2.1.tar.gz \
154 && tar xvf v4.2.1.tar.gz \
155 && cd /tmp/ocilib-4.2.1 \
156 && ./configure --with-oracle-import=linkage \
157 --with-oracle-charset=ansi \
158 --with-oracle-headers-path=/usr/include/oracle/12.1/client64 \
159 --with-oracle-lib-path=/usr/lib/oracle/12.1/client64/lib \
160 && make \
161 && make install \
162 && cd \
163 && rm -rf /tmp/ocilib-4.2.1 \
164 && echo "/usr/local/lib" > /etc/ld.so.conf.d/usr-local.conf \
165 && echo "/usr/lib/oracle/12.1/client64/lib" > /etc/ld.so.conf.d/oracle-client.conf \
166 && ldconfig
168# Add JDK to system paths.
169echo "/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/" > /etc/ld.so.conf.d/openjdk.conf \
170 && ldconfig