1#!/bin/bash
2
3set -e
4set -o xtrace
5
6export DEBIAN_FRONTEND=noninteractive
7
8# Ephemeral packages (installed for this script and removed again at the end)
9STABLE_EPHEMERAL=" \
10        libpciaccess-dev:$arch
11        "
12
13dpkg --add-architecture $arch
14apt-get update
15
16apt-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
26if [[ $arch == "armhf" ]]; then
27        LLVM=llvm-7-dev
28else
29        LLVM=llvm-8-dev
30fi
31
32apt-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
42EXTRA_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
45apt-get purge -y \
46        $STABLE_EPHEMERAL
47
48. .gitlab-ci/container/container_post_build.sh
49