74ecd2b1296bdc1bcdb9871da8d43050a180c0ed
[mesa.git] / .gitlab-ci / container / arm_build.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 abootimg \
14 android-sdk-ext4-utils \
15 bc \
16 bison \
17 ccache \
18 cmake \
19 cpio \
20 crossbuild-essential-armhf \
21 debootstrap \
22 fastboot \
23 flex \
24 g++ \
25 gettext \
26 git \
27 lavacli \
28 libdrm-dev:armhf \
29 libegl1-mesa-dev \
30 libegl1-mesa-dev:armhf \
31 libelf-dev \
32 libelf-dev:armhf \
33 libexpat1-dev \
34 libexpat1-dev:armhf \
35 libgles2-mesa-dev \
36 libgles2-mesa-dev:armhf \
37 libpng-dev \
38 libpng-dev:armhf \
39 libssl-dev \
40 libvulkan-dev \
41 libvulkan-dev:armhf \
42 llvm-7-dev:armhf \
43 llvm-8-dev \
44 meson \
45 pkg-config \
46 python \
47 python3-distutils \
48 python3-mako \
49 python3-serial \
50 unzip \
51 wget \
52 xz-utils \
53 zlib1g-dev
54
55 . .gitlab-ci/container/container_pre_build.sh
56
57 # dependencies where we want a specific version
58 export LIBDRM_VERSION=libdrm-2.4.100
59
60 wget https://dri.freedesktop.org/libdrm/$LIBDRM_VERSION.tar.bz2
61 tar -xvf $LIBDRM_VERSION.tar.bz2 && rm $LIBDRM_VERSION.tar.bz2
62 cd $LIBDRM_VERSION; meson build -D vc4=true -D freedreno=true -D etnaviv=true; ninja -C build install; cd ..
63 rm -rf $LIBDRM_VERSION
64
65 ############### Generate cross build file for Meson
66
67 cross_file="/cross_file-armhf.txt"
68 /usr/share/meson/debcrossgen --arch armhf -o "$cross_file"
69 # Explicitly set ccache path for cross compilers
70 sed -i "s|/usr/bin/\([^-]*\)-linux-gnu\([^-]*\)-g|/usr/lib/ccache/\\1-linux-gnu\\2-g|g" "$cross_file"
71 # Don't need wrapper for armhf executables
72 sed -i -e '/\[properties\]/a\' -e "needs_exe_wrapper = False" "$cross_file"
73
74 ############### Generate kernel, ramdisk, test suites, etc for LAVA jobs
75
76 DEBIAN_ARCH=arm64 . .gitlab-ci/container/lava_arm.sh
77 DEBIAN_ARCH=armhf . .gitlab-ci/container/lava_arm.sh
78
79 apt-get purge -y \
80 python3-distutils \
81 wget
82
83 . .gitlab-ci/container/container_post_build.sh