gitlab-ci: build a specific libdrm version for ARM64
[mesa.git] / .gitlab-ci / debian-arm64-install.sh
1 #!/bin/bash
2
3 set -e
4 set -o xtrace
5
6 ############### Install packages for building
7 apt-get -y install ca-certificates
8 sed -i -e 's/http:\/\/deb/https:\/\/deb/g' /etc/apt/sources.list
9 echo 'deb https://deb.debian.org/debian buster-backports main' >/etc/apt/sources.list.d/backports.list
10 dpkg --add-architecture armhf
11 apt-get update
12 apt-get -y install \
13 bc \
14 bison \
15 ccache \
16 crossbuild-essential-armhf \
17 flex \
18 g++ \
19 gettext \
20 libdrm-dev:armhf \
21 libelf-dev \
22 libelf-dev:armhf \
23 libexpat1-dev \
24 libexpat1-dev:armhf \
25 libssl-dev \
26 llvm-7-dev:armhf \
27 llvm-8-dev \
28 meson \
29 pkg-config \
30 python \
31 python3-mako \
32 wget \
33 zlib1g-dev
34
35 # dependencies where we want a specific version
36 export LIBDRM_VERSION=libdrm-2.4.100
37
38 wget https://dri.freedesktop.org/libdrm/$LIBDRM_VERSION.tar.bz2
39 tar -xvf $LIBDRM_VERSION.tar.bz2 && rm $LIBDRM_VERSION.tar.bz2
40 cd $LIBDRM_VERSION; meson build -D vc4=true -D freedreno=true -D etnaviv=true; ninja -j4 -C build install; cd ..
41 rm -rf $LIBDRM_VERSION
42
43 ############### Generate cross build file for Meson
44
45 cross_file="/cross_file-armhf.txt"
46 /usr/share/meson/debcrossgen --arch armhf -o "$cross_file"
47 # Explicitly set ccache path for cross compilers
48 sed -i "s|/usr/bin/\([^-]*\)-linux-gnu\([^-]*\)-g|/usr/lib/ccache/\\1-linux-gnu\\2-g|g" "$cross_file"
49 # Don't need wrapper for armhf executables
50 sed -i -e '/\[properties\]/a\' -e "needs_exe_wrapper = False" "$cross_file"
51
52 apt-get purge -y \
53 wget
54
55 apt-get autoremove -y --purge