-
Notifications
You must be signed in to change notification settings - Fork 3
/
installation.sh
155 lines (138 loc) · 5.82 KB
/
installation.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
#!/bin/bash
# Copyright 2010-2017 Ivan Perez Dominguez & Keera Studios Ltd (UK)
# BSD3
# This script is ad-hoc. As such, it will install keera-posture, but
# it will not create any DEB for it. That being said, you may want
# to use it in order to install it in your $HOME and take the program
# out for a spin
# Check out all necessary repositories
echo -n Cloning
git clone --quiet --depth=1 git://github.com/keera-studios/gtk-helpers.git
echo -n .
git clone --quiet --depth=1 git://github.com/keera-studios/hails-i18n.git
echo -n .
git clone --quiet --depth=1 git://github.com/keera-studios/hails-mvc-controller.git
echo -n .
git clone --quiet --depth=1 git://github.com/keera-studios/hails-mvc-environment-gtk.git
echo -n .
git clone --quiet --depth=1 git://github.com/keera-studios/hails-mvc-model-protectedmodels.git
echo -n .
git clone --quiet --depth=1 git://github.com/keera-studios/hails-mvc-solutions-config.git
echo -n .
git clone --quiet --depth=1 git://github.com/keera-studios/hails-mvc-solutions-gtk.git
echo -n .
git clone --quiet --depth=1 git://github.com/keera-studios/hails-mvc-view.git
echo -n .
git clone --quiet --depth=1 git://github.com/keera-studios/hails-mvc-view-gtk.git
echo -n .
git clone --quiet --depth=1 git://github.com/keera-studios/hails-reactive-gtk.git
echo -n .
git clone --quiet --depth=1 git://github.com/keera-studios/hails-reactivevalues.git
echo -n .
git clone --quiet --depth=1 git://github.com/keera-studios/keera-hails.git
echo -n .
# git clone --quiet --depth=1 git://github.com/keera-studios/keera-posture.git
# Private repo for pre-releases
git clone --quiet --depth=1 https://bitbucket.org/iperezdominguez/keera-posture-prerelease keera-posture # Make sure we use the right dir name
echo -n .
git clone --quiet --depth=1 git://github.com/keera-studios/MissingK.git
echo -n .
# # OpenCV 2.0 is not backwards compatible
git clone --quiet --depth=1 git://github.com/keera-studios/HOpenCV.git
echo -n .
git clone --quiet --depth=1 git://github.com/keera-studios/cv-combinators.git
echo -n .
# git clone --quiet git://github.com/sinelaw/HOpenCV.git
# pushd HOpenCV > /dev/null
# git checkout --quiet 99e3ffd # Revert to 0.1.2.4
# popd > /dev/null
# echo [DONE]
# Why cabal-dev does not do this automatically, I don't know
export PATH=$HOME/.cabal/bin:$PWD/.cabal-sandbox/bin:$PATH
# Installation requires three things: auxiliary tools, haskell dependencies and
# the program itself. There are four necessary tools: alex, happy, gtk2hs,
# hails. Because of the way cabal-dev adds packages to the DB (it runs cabal
# configure first, I believe) it is necessary to add some sources, install some
# tools, add more sources and so on and so forth, until every dependency is
# installed.
#
# Too bad, I know.
which cabal
if [[ "$?" -gt "0" ]] ; then
apt-get install -y cabal-install
fi
cabal update ;
cabal sandbox init
# Install alex and happy if they are not installed.
# It would be better to create a tool that checks if the programs
# exist, otherwise gives a choice to install them from
# binaries or from cabal. But there isn't.
git clone --depth=1 git://github.com/keera-studios/gtk-helpers.git
git clone --depth=1 git://github.com/keera-studios/hails-i18n.git
git clone --depth=1 git://github.com/keera-studios/hails-mvc-controller.git
git clone --depth=1 git://github.com/keera-studios/hails-mvc-environment-gtk.git
git clone --depth=1 git://github.com/keera-studios/hails-mvc-model-protectedmodels.git
git clone --depth=1 git://github.com/keera-studios/hails-mvc-solutions-config.git
git clone --depth=1 git://github.com/keera-studios/hails-mvc-solutions-gtk.git
git clone --depth=1 git://github.com/keera-studios/hails-mvc-view.git
git clone --depth=1 git://github.com/keera-studios/hails-mvc-view-gtk.git
git clone --depth=1 git://github.com/keera-studios/hails-reactive-gtk.git
git clone --depth=1 git://github.com/keera-studios/hails-reactivevalues.git
git clone --depth=1 git://github.com/keera-studios/keera-hails.git
git clone --depth=1 git://github.com/keera-studios/MissingK.git
git clone --depth=1 git://github.com/keera-studios/HOpenCV.git
git clone --depth=1 git://github.com/keera-studios/cv-combinators.git
# Install alex and happy
which alex
if [[ "$?" -gt "0" ]] ; then
cabal install alex ;
fi
which happy
if [[ "$?" -gt "0" ]] ; then
cabal install happy;
fi
# Add some packages to cabal-dev's local package DB
cabal sandbox add-source gtk-helpers
cabal sandbox add-source hails-i18n
cabal sandbox add-source hails-mvc-controller
cabal sandbox add-source hails-mvc-environment-gtk
cabal sandbox add-source hails-mvc-model-protectedmodels
cabal sandbox add-source hails-mvc-solutions-config
cabal sandbox add-source hails-mvc-solutions-gtk
cabal sandbox add-source hails-mvc-view
cabal sandbox add-source hails-mvc-view-gtk
cabal sandbox add-source hails-reactive-gtk
cabal sandbox add-source hails-reactivevalues
cabal sandbox add-source keera-hails
cabal sandbox add-source MissingK
cabal sandbox add-source HOpenCV
cabal sandbox add-source cv-combinators
# Install more dependencies
which gtk2hsC2hs
if [[ "$?" -gt "0" ]] ; then
cabal install gtk2hs-buildtools;
fi
which hails
if [[ "$?" -gt "0" ]] ; then
cabal install keera-hails;
fi
# Keera Posture
cabal add-source keera-posture
# Normal installation (even if we want to build a DEB, we install
# so that we can later copy only the data files we really need
# (FIXME: this is a bit ugly)
cabal install keera-posture
if [[ ! -z "$DEBIAN_BUILD" ]]; then
PACKAGE_NAME=keera-posture
DEBIAN_LIB_DIR=/usr/lib/$PACKAGE_NAME
DEBIAN_BIN_DIR=/usr/bin
DEBIAN_DATA_DIR=/usr/share/$PACKAGE_NAME/
DEBIAN_DATA_SUBDIR=""
# Prepare debian build
pushd keera-posture
cabal sandbox init --sandbox-dir=../.cabal-sandbox/
cabal install --only-depdendencies
cabal configure --libdir=$DEBIAN_LIB_DIR --bindir=$DEBIAN_BIN_DIR --datadir=$DEBIAN_DATA_DIR --datasubdir=$DEBIAN_DATA_SUBDIR
cabal build
popd
fi