• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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        "
11
12dpkg --add-architecture $arch
13apt-get update
14
15apt-get install -y --no-remove \
16        $STABLE_EPHEMERAL \
17        crossbuild-essential-$arch \
18        libelf-dev:$arch \
19        libexpat1-dev:$arch \
20        libpciaccess-dev:$arch \
21        libstdc++6:$arch \
22        libvulkan-dev:$arch \
23        libx11-dev:$arch \
24        libx11-xcb-dev:$arch \
25        libxcb-dri2-0-dev:$arch \
26        libxcb-dri3-dev:$arch \
27        libxcb-glx0-dev:$arch \
28        libxcb-present-dev:$arch \
29        libxcb-randr0-dev:$arch \
30        libxcb-shm0-dev:$arch \
31        libxcb-xfixes0-dev:$arch \
32        libxdamage-dev:$arch \
33        libxext-dev:$arch \
34        libxrandr-dev:$arch \
35        libxshmfence-dev:$arch \
36        libxxf86vm-dev:$arch \
37        wget
38
39if [[ $arch != "armhf" ]]; then
40    if [[ $arch == "s390x" ]]; then
41        LLVM=9
42    else
43        LLVM=11
44    fi
45
46    # llvm-*-tools:$arch conflicts with python3:amd64. Install dependencies only
47    # with apt-get, then force-install llvm-*-{dev,tools}:$arch with dpkg to get
48    # around this.
49    apt-get install -y --no-remove \
50            libclang-cpp${LLVM}:$arch \
51            libffi-dev:$arch \
52            libgcc-s1:$arch \
53            libtinfo-dev:$arch \
54            libz3-dev:$arch \
55            llvm-${LLVM}:$arch \
56            zlib1g
57fi
58
59. .gitlab-ci/container/create-cross-file.sh $arch
60
61
62. .gitlab-ci/container/container_pre_build.sh
63
64
65# dependencies where we want a specific version
66EXTRA_MESON_ARGS="--cross-file=/cross_file-${arch}.txt -D libdir=lib/$(dpkg-architecture -A $arch -qDEB_TARGET_MULTIARCH)"
67. .gitlab-ci/container/build-libdrm.sh
68
69apt-get purge -y \
70        $STABLE_EPHEMERAL
71
72. .gitlab-ci/container/container_post_build.sh
73
74# This needs to be done after container_post_build.sh, or apt-get breaks in there
75if [[ $arch != "armhf" ]]; then
76    apt-get download llvm-${LLVM}-{dev,tools}:$arch
77    dpkg -i --force-depends llvm-${LLVM}-*_${arch}.deb
78    rm llvm-${LLVM}-*_${arch}.deb
79fi
80