-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.sh
executable file
·247 lines (226 loc) · 6.42 KB
/
bootstrap.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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
#!/bin/bash
set -e
XCB_VERSION=1.12
function vala_version
{
ls vala-*.tar.xz 2> /dev/null | sed -e 's/^vala-\(.*\).tar.xz/\1/'
}
function libgee_version
{
ls libgee-*.tar.xz 2> /dev/null | sed -e 's/^libgee-\(.*\).tar.xz/\1/'
}
function valadoc_version
{
ls valadoc-*.tar.xz 2> /dev/null | sed -e 's/^valadoc-\(.*\).tar.xz/\1/'
}
function checkout
{
checkout_root_dir=
if [ ! -e vala-$(vala_version).tar.xz ]
then
git clone git://git.gnome.org/vala
cd vala
./autogen.sh --prefix=$(dirname $PWD)/checkout --disable-shared --enable-static
make -j8
make install
make clean
rm -f */*.vala.stamp
patch -p1 < ../add-explicit-notify.patch
patch -p1 < ../fix-cast-callback.patch
./configure \
CFLAGS="-fPIC" \
VALAC=$(dirname $PWD)/checkout/bin/valac \
--prefix=$(dirname $PWD)/checkout --disable-shared --enable-static
make -j8
make install
make dist
mv vala-*.tar.xz ..
cd ..
rm -rf vala
fi
if [ ! -e libgee-$(libgee_version).tar.xz ]
then
git clone git://git.gnome.org/libgee
cd libgee
patch -p1 < ../disable-ax-required.patch
./autogen.sh \
CFLAGS="-fPIC" \
VALAC=$(dirname $PWD)/checkout/bin/valac \
--prefix=$(dirname $PWD)/checkout --disable-shared --enable-static --enable-introspection=no
make -j8
make install
make dist
mv libgee-*.tar.xz ..
cd ..
rm -rf libgee
fi
if [ ! -e valadoc-$(valadoc_version).tar.xz ]
then
git clone git://git.gnome.org/valadoc
cd valadoc
patch -p1 < ../fix-valadoc-gen.patch
patch -p1 < ../fix-valadoc-pc.patch
export PKG_CONFIG_PATH=$(dirname $PWD)/checkout/lib/pkgconfig
export LD_LIBRARY_PATH="$(dirname $PWD)/checkout/lib"
./autogen.sh CFLAGS="-I$(dirname $PWD)/checkout/include -fPIC" \
VALAC="$(dirname $PWD)/checkout/bin/valac --vapidir $(dirname $PWD)/checkout/share/vala/vapi" \
--prefix=$(dirname $PWD)/checkout
make -j8
make dist
mv valadoc-*.tar.xz ..
cd ..
rm -rf valadoc
fi
if [ ! -e xcb-proto-${XCB_VERSION}.tar.gz ];
then
wget --no-check-certificate https://xcb.freedesktop.org/dist/xcb-proto-${XCB_VERSION}.tar.gz
fi
if [ ! -e libxcb-${XCB_VERSION}.tar.gz ];
then
wget --no-check-certificate https://xcb.freedesktop.org/dist/libxcb-${XCB_VERSION}.tar.gz
fi
if [ -e checkout ]
then
rm -rf checkout
fi
}
function build
{
if [ ! -e vala-build.stamp ];
then
if [ -e vala-$(vala_version) ]
then
rm -rf vala-$(vala_version)
fi
tar xvf vala-$(vala_version).tar.xz
cd vala-$(vala_version)
./configure \
CFLAGS="-fPIC" \
--prefix=$(dirname $PWD)/build --disable-shared --enable-static
make -j8
make install
cd ..
rm -rf vala-$(vala_version)
touch vala-build.stamp
fi
if [ ! -e libgee-build.stamp ];
then
if [ -e libgee-$(libgee_version) ]
then
rm -rf libgee-$(libgee_version)
fi
tar xvf libgee-$(libgee_version).tar.xz
cd libgee-$(libgee_version)
./configure \
CFLAGS="-fPIC" \
VALAC=$(dirname $PWD)/build/bin/valac \
--prefix=$(dirname $PWD)/build --disable-shared --enable-static --enable-introspection=no
make -j8
make install
cd ..
rm -rf libgee-$(libgee_version)
touch libgee-build.stamp
fi
if [ ! -e valadoc-build.stamp ];
then
if [ -e valadoc-$(valadoc_version) ]
then
rm -rf valadoc-$(valadoc_version)
fi
tar xvf valadoc-$(valadoc_version).tar.xz
cd valadoc-$(valadoc_version)
export PKG_CONFIG_PATH=$(dirname $PWD)/build/lib/pkgconfig
export LD_LIBRARY_PATH="$(dirname $PWD)/build/lib"
./configure CFLAGS="-I$(dirname $PWD)/build/include -fPIC" \
VALAC="$(dirname $PWD)/build/bin/valac --vapidir $(dirname $PWD)/build/share/vala/vapi" \
--prefix=$(dirname $PWD)/build
make -j8
make install
cd ..
rm -rf valadoc-$(valadoc_version)
touch valadoc-build.stamp
fi
if [ ! -e xcb-proto-${XCB_VERSION}-build.stamp ];
then
if [ -e xcb-proto-${XCB_VERSION} ];
then
rm -rf xcb-proto-${XCB_VERSION}
fi
tar xvf xcb-proto-${XCB_VERSION}.tar.gz
cd xcb-proto-${XCB_VERSION}
./configure --prefix=$(dirname $PWD)/build
make -j8
make install
cd ..
rm -rf xcb-proto-${XCB_VERSION}
touch xcb-proto-${XCB_VERSION}-build.stamp
fi
if [ ! -e libxcb-${XCB_VERSION}-build.stamp ];
then
if [ -e libxcb-${XCB_VERSION} ];
then
rm -rf libxcb-${XCB_VERSION}
fi
tar xvf libxcb-${XCB_VERSION}.tar.gz
cd libxcb-${XCB_VERSION}
export PKG_CONFIG_PATH=$(dirname $PWD)/build/lib/pkgconfig
./configure \
CFLAGS="-fPIC" \
--prefix=$(dirname $PWD)/build --disable-shared --enable-static --enable-xinput --without-doxygen
make -j8
make install
cd ..
rm -rf libxcb-${XCB_VERSION}
touch libxcb-${XCB_VERSION}-build.stamp
fi
}
function clean
{
rm -f vala-build.stamp
rm -rf vala-$(vala_version)
rm -rf vala
rm -f libgee-build.stamp
rm -rf libgee-$(libgee_version)
rm -rf libgee
rm -f valadoc-build.stamp
rm -rf valadoc-$(valadoc_version)
rm -rf valadoc
rm -f xcb-proto-${XCB_VERSION}-build.stamp
rm -rf xcb-proto-${XCB_VERSION}
rm -f libxcb-${XCB_VERSION}-build.stamp
rm -rf libxcb-${XCB_VERSION}
rm -rf build
}
function mrproper
{
clean
rm -rf checkout
rm -f vala-*.tar.xz
rm -f libgee-*.tar.xz
rm -f valadoc-*.tar.xz
rm -f xcb-proto-${XCB_VERSION}.tar.gz
rm -f libxcb-${XCB_VERSION}.tar.gz
}
if [ $# -lt 1 ]
then
echo "$0 [COMMAND]"
echo "COMMAND:"
echo " - build : build bootstrap"
echo " - clean : clean bootstrap"
exit 1
fi
cd $(dirname $0)/bootstrap
if [ $1 == "checkout" ];
then
checkout
elif [ $1 == "build" ];
then
checkout
build
elif [ $1 == "clean" ];
then
clean
elif [ $1 == "mrproper" ];
then
mrproper
fi