forked from ybakos/wayland-build-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwl_build.sh
executable file
·221 lines (171 loc) · 3.21 KB
/
wl_build.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
#!/bin/bash
. $HOME/.config/wayland-build-tools/wl_defines.sh
if [ ! -e $WLROOT ]; then
exit 1
fi
# Bail if errors
set -e
gen() {
pkg=$1
shift
echo
echo $pkg
cd $WLROOT/$pkg
echo "./autogen.sh --prefix=$WLD $*"
./autogen.sh --prefix=$WLD $*
}
compile() {
make -j32 && make install
if [ $? != 0 ]; then
echo "Build Error. Terminating"
exit
fi
}
distcheck() {
make distcheck
}
# TODO: Check if tree doesn't exist
# TODO: Log output
# TODO: If it's been a while since we last ran successfully, then
# delete $WLD
mkdir -p $WLD/share/aclocal
gen wayland
compile
gen wayland-protocols
compile
gen drm --disable-libkms
compile
gen proto
compile
gen macros
compile
gen libxcb
compile
gen presentproto
compile
gen dri3proto
compile
gen libxshmfence
compile
gen libxkbcommon \
--with-xkb-config-root=/usr/share/X11/xkb \
--with-x-locale-root=/usr/share/X11/locale \
--disable-x11
compile
llvm_drivers=swrast,nouveau,r300
vga_pci=$(lspci | grep VGA | head -n1)
vga_name=${vga_pci#*controller: }
vga_manu=${vga_name%% *}
if [ "${vga_manu}" = "NVIDIA" ]; then
llvm_drivers=swrast,nouveau
fi
echo
echo "mesa"
cd $WLROOT/mesa
git clean -xfd
./autogen.sh --prefix=$WLD \
--enable-gles2 \
--with-egl-platforms=x11,wayland,drm \
--enable-gbm \
--enable-shared-glapi \
--disable-llvm-shared-libs \
--disable-dri3 \
--with-gallium-drivers=$llvm_drivers
compile
gen pixman
compile
gen cairo --enable-xcb --enable-gl
compile
echo
echo "libunwind"
cd $WLROOT/libunwind
autoreconf -i
./configure --prefix=$WLD
compile
gen libevdev
compile
gen wayland-protocols
compile
gen libwacom
compile
echo
echo libinput
cd $WLROOT/libinput
rm -rf $WLROOT/libinput/builddir/
mkdir $WLROOT/libinput/builddir/
echo "meson --prefix=$WLD builddir/"
meson --prefix=$WLD -Ddebug-gui=false builddir/
ninja -C builddir/
ninja -C builddir/ install
# sudo udevadm hwdb --update
if [ ${INCLUDE_XWAYLAND} ]; then
if [ ${WL_BITS} = 32 ]; then
gen libxtrans
compile
fi
gen xproto
compile
rm -rf $WLROOT/libepoxy/m4
gen libepoxy
compile
gen glproto
compile
gen xcmiscproto
compile
gen libxtrans
compile
gen bigreqsproto
compile
gen xextproto
compile
gen fontsproto
compile
gen videoproto
compile
gen recordproto
compile
gen resourceproto
compile
gen xf86driproto
compile
gen randrproto
compile
gen libxkbfile
compile
gen libXfont
compile
echo
echo "xserver"
cd $WLROOT/xserver
./autogen.sh --prefix=$WLD --disable-docs --disable-devel-docs \
--enable-xwayland --disable-xorg --disable-xvfb --disable-xnest \
--disable-xquartz --disable-xwin
compile
echo
echo "Paths"
mkdir -p $WLD/share/X11/xkb/rules
if [ ! -e $WLD/share/X11/xkb/rules/evdev ]; then
ln -s /usr/share/X11/xkb/rules/evdev $WLD/share/X11/xkb/rules/
fi
if [ ! -e $WLD/bin/xkbcomp ]; then
ln -s /usr/bin/xkbcomp $WLD/bin/
fi
fi
echo
echo "weston"
cd $WLROOT/weston
git clean -xfd
./autogen.sh --prefix=$WLD \
--with-cairo=image \
--with-xserver-path=$WLD/bin/Xwayland \
--enable-setuid-install=no \
--enable-clients \
--enable-headless-compositor \
--enable-demo-clients-install
compile
#distcheck
# Set up config file if it isn't there already
if [ ! -e $HOME/.config/weston.ini ]; then
cp weston.ini $HOME/.config/
fi
cd $WLROOT