/
compile
executable file
·85 lines (62 loc) · 1.42 KB
/
compile
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
#!/bin/sh
indent() {
sed -u 's/^/ /'
}
download() {
curl -L -s -S $@
}
ensure_env() {
echo "Ensuring suitable environment"
mkdir -p $CACHE
mkdir -p $BUILD
export $PATH="$CACHE:$PATH"
}
install_rbx() {
local old_path=$PWD
#if ! which rbx &>/dev/null ; then
#echo "rbx install detected" | indent
#return 0
#else
echo "------> Installing rbx-head, with 1.9 support" | indent
mkdir -p /tmp/rbx
echo "Downloading Rubinius" | indent
download $RBX_URL/release-$RBX_VERSION | tar -zx$VERBOSE
mv rubinius-rubinius-$RBX_VERSION /tmp/rbx/rubinius
echo "Unpacking" | indent
cd /tmp/rbx/rubinius
tar -zxvf rubinius.tar.gz
cd /tmp/rbx/rubinius/rubinius-rubinius-$RBX_VERSION
echo "Compiling" | indent
./configure --prefix $CACHE/rbx --default-version=1.9
rake install
return 0
#fi
cd $old_path
}
install_gems() {
echo "Installing bundler"
rbx -S gem install bundler
echo "Installing foreman"
rbx -S gem install foreman
return 2
}
bootstrap() {
install_rbx
install_gems
}
install_gems() {
# if gemfile exists, bundle
if [ -s $1/Gemfile ]; then
echo "Gemfile found, bundling" | indent
foreman run bundle
fi
}
VERBOSE=
RBX_URL=https://github.com/rubinius/rubinius/tarball
RBX_VERSION="1.2.4"
BUILD_DIR=$1
CACHE_DIR=$2
bootstrap
install_gems
exit 1
foreman start