|
@@ -0,0 +1,63 @@
|
|
1
|
+#!/bin/bash
|
|
2
|
+#
|
|
3
|
+# .---. . .
|
|
4
|
+# | | |
|
|
5
|
+# |--- .--. .-. .-. .-.| .-. .--.--. |.-. .-. .--. .-.
|
|
6
|
+# | | (.-' (.-' ( | ( )| | | | )( )| | (.-'
|
|
7
|
+# ' ' --' --' -' - -' ' ' -' -' -' ' - --'
|
|
8
|
+#
|
|
9
|
+# Freedom in the Cloud
|
|
10
|
+#
|
|
11
|
+# Elixir functions
|
|
12
|
+#
|
|
13
|
+# There's a problem with installing this onto mesh images, which is
|
|
14
|
+# that qemu appears to run out of RAM when using yarn to add webpack.
|
|
15
|
+#
|
|
16
|
+# License
|
|
17
|
+# =======
|
|
18
|
+#
|
|
19
|
+# Copyright (C) 2018 Bob Mottram <bob@freedombone.net>
|
|
20
|
+#
|
|
21
|
+# This program is free software: you can redistribute it and/or modify
|
|
22
|
+# it under the terms of the GNU Affero General Public License as published by
|
|
23
|
+# the Free Software Foundation, either version 3 of the License, or
|
|
24
|
+# (at your option) any later version.
|
|
25
|
+#
|
|
26
|
+# This program is distributed in the hope that it will be useful,
|
|
27
|
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
28
|
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
29
|
+# GNU Affero General Public License for more details.
|
|
30
|
+#
|
|
31
|
+# You should have received a copy of the GNU Affero General Public License
|
|
32
|
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
33
|
+
|
|
34
|
+function remove_elixir {
|
|
35
|
+ apt-get -yq remove elixir erlang-xmerl erlang-dev erlang-parsetools
|
|
36
|
+ apt-get -yq remove esl-erlang
|
|
37
|
+}
|
|
38
|
+
|
|
39
|
+function install_elixir {
|
|
40
|
+ apt-get -yq install wget build-essential
|
|
41
|
+
|
|
42
|
+ if [ ! -d "$INSTALL_DIR" ]; then
|
|
43
|
+ mkdir -p "$INSTALL_DIR"
|
|
44
|
+ fi
|
|
45
|
+
|
|
46
|
+ cd "$INSTALL_DIR" || exit 768345274
|
|
47
|
+ erlang_package=erlang-solutions_1.0_all.deb
|
|
48
|
+ wget https://packages.erlang-solutions.com/$erlang_package
|
|
49
|
+ if [ ! -f "$INSTALL_DIR/$erlang_package" ]; then
|
|
50
|
+ exit 72853
|
|
51
|
+ fi
|
|
52
|
+ dpkg -i $erlang_package
|
|
53
|
+ apt-get -yq update
|
|
54
|
+ apt-get -yq install esl-erlang
|
|
55
|
+ apt-get -yq install elixir erlang-xmerl erlang-dev erlang-parsetools
|
|
56
|
+
|
|
57
|
+ if [ ! -f /usr/local/bin/mix ]; then
|
|
58
|
+ echo $'/usr/local/bin/mix not found after elixir installation'
|
|
59
|
+ exit 629352
|
|
60
|
+ fi
|
|
61
|
+}
|
|
62
|
+
|
|
63
|
+# NOTE: deliberately no exit 0
|