forked from hybridgroup/kidsrubyinstaller-osx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·143 lines (123 loc) · 2.78 KB
/
install.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
#!/bin/sh
RUN_DIR="$(pwd)"
BUILD_DIR="$RUN_DIR/build"
RUBY_DIR="/usr/local/kidsruby"
echo "Make sure your download and install the Platypus installer from here: http://www.sveinbjorn.org/platypus"
create_dirs() {
if [ ! -d "build" ]
then
mkdir build
fi
if [ ! -d "resources" ]
then
mkdir resources
fi
if [ ! -d "$RUBY_DIR" ]
then
mkdir "$RUBY_DIR"
fi
if [ ! -d "$RUBY_DIR/ruby" ]
then
mkdir "$RUBY_DIR/ruby"
fi
}
check_qt() {
if [ ! -f "resources/qt-mac-opensource-4.7.3.dmg" ]
then
curl "http://get.qt.nokia.com/qt/source/qt-mac-opensource-4.7.3.dmg" > "resources/qt-mac-opensource-4.7.3.dmg"
fi
}
check_git() {
if [ ! -f "resources/git-1.7.6-i386-snow-leopard.dmg" ]
then
curl "http://git-osx-installer.googlecode.com/files/git-1.7.6-i386-snow-leopard.dmg" > "resources/git-1.7.6-i386-snow-leopard.dmg"
fi
}
get_yaml() {
if [ ! -f "build/yaml-0.1.4.tar.gz" ]
then
curl "http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz" > "build/yaml-0.1.4.tar.gz"
fi
}
build_yaml() {
cd build
if [ ! -d "yaml" ]
then
mkdir yaml
fi
tar -xvzf yaml-0.1.4.tar.gz
cd yaml-0.1.4
CFLAGS="-arch i386 -arch x86_64"
export CFLAGS
LDFLAGS="-arch i386 -arch x86_64"
export LDFLAGS
./configure --prefix="$BUILD_DIR/yaml" --disable-dependency-tracking
make
make install
cd ../..
tar cvzf resources/yaml-0.1.4.universal.tar.gz build/yaml
}
check_yaml() {
if [ ! -f "resources/yaml-0.1.4.universal.tar.gz" ]
then
get_yaml
build_yaml
fi
}
get_ruby() {
if [ ! -f "build/ruby-1.9.2-p290.tar.gz" ]
then
curl "http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p290.tar.gz" > "build/ruby-1.9.2-p290.tar.gz"
fi
}
build_ruby() {
cd "$BUILD_DIR"
tar -xvzf ruby-1.9.2-p290.tar.gz
cd ruby-1.9.2-p290
export CFLAGS="-isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5"
export LDFLAGS=$CFLAGS
export MACOSX_DEPLOYMENT_TARGET=10.5
./configure --enable-shared --with-arch=i386,x86_64 --prefix="$RUBY_DIR/ruby"
make
make install
}
compress_ruby() {
cd "$RUBY_DIR"
tar cvzf "$RUN_DIR/resources/ruby-1.9.2-p290.universal.tar.gz" ruby
cd "$RUN_DIR"
}
check_ruby() {
if [ ! -f "resources/ruby-1.9.2-p290.universal.tar.gz" ]
then
get_ruby
build_ruby
compress_ruby
fi
}
get_kidsruby() {
/usr/local/bin/git clone --branch release git://github.com/hybridgroup/kidsruby.git
}
build_kidsruby() {
tar cvzf "../resources/kidsruby.tar.gz" kidsruby
}
clean_kidsruby() {
rm -rf "$BUILD_DIR/kidsruby"
rm "resources/kidsruby.tar.gz"
}
check_kidsruby() {
if [ ! -f "resources/kidsruby.tar.gz" ]
then
cd "$BUILD_DIR"
get_kidsruby
build_kidsruby
cd ..
fi
}
create_dirs
check_qt
check_git
check_yaml
check_ruby
clean_kidsruby
check_kidsruby
echo "You still need to build the qtbindings gem manually, and put into resources directory, before you can build the installer."