iris: add identifier BO
[mesa.git] / .gitlab-ci / container / x86_build.sh
1 #!/bin/bash
2
3 set -e
4 set -o xtrace
5
6 export DEBIAN_FRONTEND=noninteractive
7
8 CROSS_ARCHITECTURES="i386 ppc64el s390x"
9 for arch in $CROSS_ARCHITECTURES; do
10 dpkg --add-architecture $arch
11 done
12
13 apt-get install -y \
14 ca-certificates \
15 gnupg \
16 unzip \
17 wget
18
19 # Upstream LLVM package repository
20 apt-key add .gitlab-ci/container/llvm-snapshot.gpg.key
21 echo "deb https://apt.llvm.org/buster/ llvm-toolchain-buster-9 main" >/etc/apt/sources.list.d/llvm9.list
22
23 sed -i -e 's/http:\/\/deb/https:\/\/deb/g' /etc/apt/sources.list
24 echo 'deb https://deb.debian.org/debian buster-backports main' >/etc/apt/sources.list.d/backports.list
25 echo 'deb https://deb.debian.org/debian testing main' >/etc/apt/sources.list.d/testing.list
26
27 apt-get update
28
29 # Don't use newer packages from testing by default
30 cat >/etc/apt/preferences <<EOF
31 Package: *
32 Pin: release a=testing
33 Pin-Priority: 100
34 EOF
35
36 apt-get dist-upgrade -y
37
38 apt-get install -y --no-remove \
39 autoconf \
40 automake \
41 autotools-dev \
42 bison \
43 ccache \
44 clang-9 \
45 cmake \
46 flex \
47 g++ \
48 gcc \
49 gettext \
50 git \
51 libclang-6.0-dev \
52 libclang-7-dev \
53 libclang-9-dev \
54 libclc-dev \
55 libdrm-dev:s390x \
56 libelf-dev \
57 libepoxy-dev \
58 libexpat1-dev \
59 libgbm-dev \
60 libgtk-3-dev \
61 libomxil-bellagio-dev \
62 libpciaccess-dev \
63 libpciaccess-dev:i386 \
64 libtool \
65 libunwind-dev \
66 libva-dev \
67 libvdpau-dev \
68 libvulkan-dev \
69 libvulkan-dev:ppc64el \
70 libx11-dev \
71 libx11-xcb-dev \
72 libxdamage-dev \
73 libxext-dev \
74 libxml2-utils \
75 libxrandr-dev \
76 libxrender-dev \
77 libxshmfence-dev \
78 libxvmc-dev \
79 libxxf86vm-dev \
80 llvm-6.0-dev \
81 llvm-7-dev \
82 llvm-9-dev \
83 meson \
84 pkg-config \
85 python-mako \
86 python3-mako \
87 python3-pil \
88 python3-requests \
89 qemu-user \
90 scons \
91 x11proto-dri2-dev \
92 x11proto-gl-dev \
93 x11proto-randr-dev \
94 xz-utils \
95 zlib1g-dev
96
97 apt-get install -y --no-remove -t buster-backports \
98 libclang-8-dev
99
100 # Cross-build Mesa deps
101 for arch in $CROSS_ARCHITECTURES; do
102 apt-get install -y --no-remove \
103 crossbuild-essential-${arch} \
104 libelf-dev:${arch} \
105 libexpat1-dev:${arch} \
106 libffi-dev:${arch} \
107 libstdc++6:${arch} \
108 libtinfo-dev:${arch}
109
110 apt-get install -y --no-remove -t buster-backports \
111 libllvm8:${arch}
112
113 mkdir /var/cache/apt/archives/${arch}
114 # Download llvm-* packages, but don't install them yet, since they can
115 # only be installed for one architecture at a time
116 apt-get install -o Dir::Cache::archives=/var/cache/apt/archives/$arch --download-only \
117 -y --no-remove -t buster-backports \
118 llvm-8-dev:${arch}
119 done
120
121 apt-get install -y --no-remove -t buster-backports \
122 llvm-8-dev \
123
124
125 # Install packages we need from Debian testing last, to avoid pulling in more
126
127 # Need to allow removing libgcc1 for these
128 apt-get install -y -t testing \
129 libstdc++6:i386 \
130 libstdc++6:ppc64el \
131 libstdc++6:s390x
132
133 apt-get install -y --no-remove -t testing \
134 g++-mingw-w64-x86-64-win32 \
135 libz-mingw-w64-dev \
136 wine \
137 wine32 \
138 wine64
139
140
141 . .gitlab-ci/container/container_pre_build.sh
142
143
144 # Debian's pkg-config wrapers for mingw are broken, and there's no sign that
145 # they're going to be fixed, so we'll just have to fix it ourselves
146 # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=930492
147 cat >/usr/local/bin/x86_64-w64-mingw32-pkg-config <<EOF
148 #!/bin/sh
149
150 PKG_CONFIG_LIBDIR=/usr/x86_64-w64-mingw32/lib/pkgconfig pkg-config \$@
151 EOF
152 chmod +x /usr/local/bin/x86_64-w64-mingw32-pkg-config
153
154
155 # Generate cross build files for Meson
156 for arch in $CROSS_ARCHITECTURES; do
157 . .gitlab-ci/create-cross-file.sh $arch
158 done
159
160
161 # for the vulkan overlay layer
162 wget https://github.com/KhronosGroup/glslang/releases/download/master-tot/glslang-master-linux-Release.zip
163 unzip glslang-master-linux-Release.zip bin/glslangValidator
164 install -m755 bin/glslangValidator /usr/local/bin/
165 rm bin/glslangValidator glslang-master-linux-Release.zip
166
167
168 # dependencies where we want a specific version
169 export XORG_RELEASES=https://xorg.freedesktop.org/releases/individual
170 export XCB_RELEASES=https://xcb.freedesktop.org/dist
171 export WAYLAND_RELEASES=https://wayland.freedesktop.org/releases
172
173 export XORGMACROS_VERSION=util-macros-1.19.0
174 export LIBDRM_VERSION=libdrm-2.4.100
175 export XCBPROTO_VERSION=xcb-proto-1.13
176 export LIBXCB_VERSION=libxcb-1.13
177 export LIBWAYLAND_VERSION=wayland-1.15.0
178 export WAYLAND_PROTOCOLS_VERSION=wayland-protocols-1.12
179
180 wget $XORG_RELEASES/util/$XORGMACROS_VERSION.tar.bz2
181 tar -xvf $XORGMACROS_VERSION.tar.bz2 && rm $XORGMACROS_VERSION.tar.bz2
182 cd $XORGMACROS_VERSION; ./configure; make install; cd ..
183 rm -rf $XORGMACROS_VERSION
184
185 wget $XCB_RELEASES/$XCBPROTO_VERSION.tar.bz2
186 tar -xvf $XCBPROTO_VERSION.tar.bz2 && rm $XCBPROTO_VERSION.tar.bz2
187 cd $XCBPROTO_VERSION; ./configure; make install; cd ..
188 rm -rf $XCBPROTO_VERSION
189
190 wget $XCB_RELEASES/$LIBXCB_VERSION.tar.bz2
191 tar -xvf $LIBXCB_VERSION.tar.bz2 && rm $LIBXCB_VERSION.tar.bz2
192 cd $LIBXCB_VERSION; ./configure; make install; cd ..
193 rm -rf $LIBXCB_VERSION
194
195 wget https://dri.freedesktop.org/libdrm/$LIBDRM_VERSION.tar.bz2
196 tar -xvf $LIBDRM_VERSION.tar.bz2 && rm $LIBDRM_VERSION.tar.bz2
197 cd $LIBDRM_VERSION
198 meson build -D vc4=true -D freedreno=true -D etnaviv=true -D libdir=lib/x86_64-linux-gnu; ninja -C build install
199 rm -rf build; meson --cross-file=/cross_file-ppc64el.txt build -D libdir=lib/powerpc64le-linux-gnu; ninja -C build install
200 rm -rf build; meson --cross-file=/cross_file-i386.txt build -D libdir=lib/i386-linux-gnu; ninja -C build install
201 cd ..
202 rm -rf $LIBDRM_VERSION
203
204 wget $WAYLAND_RELEASES/$LIBWAYLAND_VERSION.tar.xz
205 tar -xvf $LIBWAYLAND_VERSION.tar.xz && rm $LIBWAYLAND_VERSION.tar.xz
206 cd $LIBWAYLAND_VERSION; ./configure --enable-libraries --without-host-scanner --disable-documentation --disable-dtd-validation; make install; cd ..
207 rm -rf $LIBWAYLAND_VERSION
208
209 wget $WAYLAND_RELEASES/$WAYLAND_PROTOCOLS_VERSION.tar.xz
210 tar -xvf $WAYLAND_PROTOCOLS_VERSION.tar.xz && rm $WAYLAND_PROTOCOLS_VERSION.tar.xz
211 cd $WAYLAND_PROTOCOLS_VERSION; ./configure; make install; cd ..
212 rm -rf $WAYLAND_PROTOCOLS_VERSION
213
214
215 # The version of libglvnd-dev in debian is too old
216 # Check this page to see when this local compilation can be dropped in favour of the package:
217 # https://packages.debian.org/libglvnd-dev
218 GLVND_VERSION=1.2.0
219 wget https://gitlab.freedesktop.org/glvnd/libglvnd/-/archive/v$GLVND_VERSION/libglvnd-v$GLVND_VERSION.tar.gz
220 tar -xvf libglvnd-v$GLVND_VERSION.tar.gz && rm libglvnd-v$GLVND_VERSION.tar.gz
221 pushd libglvnd-v$GLVND_VERSION; ./autogen.sh; ./configure; make install; popd
222 rm -rf libglvnd-v$GLVND_VERSION
223
224
225 pushd /usr/local
226 git clone https://gitlab.freedesktop.org/mesa/shader-db.git --depth 1
227 rm -rf shader-db/.git
228 cd shader-db
229 make
230 popd
231
232
233 ############### Uninstall the build software
234
235 apt-get purge -y \
236 autoconf \
237 automake \
238 autotools-dev \
239 cmake \
240 git \
241 gnupg \
242 libgbm-dev \
243 libtool \
244 unzip \
245 wget
246
247 . .gitlab-ci/container/container_post_build.sh