ci: Split building of libdrm to its own script
[mesa.git] / .gitlab-ci / container / cross_build.sh
1 #!/bin/bash
2
3 set -e
4 set -o xtrace
5
6 export DEBIAN_FRONTEND=noninteractive
7
8 # Ephemeral packages (installed for this script and removed again at the end)
9 STABLE_EPHEMERAL=" \
10 libpciaccess-dev:$arch
11 "
12
13 dpkg --add-architecture $arch
14 apt-get update
15
16 apt-get install -y --no-remove \
17 $STABLE_EPHEMERAL \
18 crossbuild-essential-$arch \
19 libelf-dev:$arch \
20 libexpat1-dev:$arch \
21 libffi-dev:$arch \
22 libstdc++6:$arch \
23 libtinfo-dev:$arch \
24 wget
25
26 if [[ $arch == "armhf" ]]; then
27 LLVM=llvm-7-dev
28 else
29 LLVM=llvm-8-dev
30 fi
31
32 apt-get install -y --no-remove -t buster-backports \
33 $LLVM:$arch
34
35 . .gitlab-ci/create-cross-file.sh $arch
36
37
38 . .gitlab-ci/container/container_pre_build.sh
39
40
41 # dependencies where we want a specific version
42 EXTRA_MESON_ARGS="--cross-file=/cross_file-${arch}.txt -D libdir=lib/$(dpkg-architecture -A $arch -qDEB_TARGET_MULTIARCH)"
43 . .gitlab-ci/build-libdrm.sh
44
45 apt-get purge -y \
46 $STABLE_EPHEMERAL
47
48 . .gitlab-ci/container/container_post_build.sh