• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/env bash
2# shellcheck disable=SC2086 # we want word splitting
3
4set -e
5
6. .gitlab-ci/setup-test-env.sh
7
8set -o xtrace
9
10export DEBIAN_FRONTEND=noninteractive
11: "${LLVM_VERSION:?llvm version not set!}"
12
13# Ephemeral packages (installed for this script and removed again at the end)
14EPHEMERAL=(
15)
16
17DEPS=(
18    "crossbuild-essential-$arch"
19    "pkgconf:$arch"
20    "libasan8:$arch"
21    "libdrm-dev:$arch"
22    "libelf-dev:$arch"
23    "libexpat1-dev:$arch"
24    "libffi-dev:$arch"
25    "libpciaccess-dev:$arch"
26    "libstdc++6:$arch"
27    "libvulkan-dev:$arch"
28    "libx11-dev:$arch"
29    "libx11-xcb-dev:$arch"
30    "libxcb-dri2-0-dev:$arch"
31    "libxcb-dri3-dev:$arch"
32    "libxcb-glx0-dev:$arch"
33    "libxcb-present-dev:$arch"
34    "libxcb-randr0-dev:$arch"
35    "libxcb-shm0-dev:$arch"
36    "libxcb-xfixes0-dev:$arch"
37    "libxdamage-dev:$arch"
38    "libxext-dev:$arch"
39    "libxrandr-dev:$arch"
40    "libxshmfence-dev:$arch"
41    "libxxf86vm-dev:$arch"
42    "libwayland-dev:$arch"
43)
44
45dpkg --add-architecture $arch
46
47echo "deb [trusted=yes] https://gitlab.freedesktop.org/gfx-ci/ci-deb-repo/-/raw/${PKG_REPO_REV}/ ${FDO_DISTRIBUTION_VERSION%-*} main" | tee /etc/apt/sources.list.d/gfx-ci_.list
48
49apt-get update
50
51apt-get install -y --no-remove "${DEPS[@]}" "${EPHEMERAL[@]}" \
52    $EXTRA_LOCAL_PACKAGES
53
54if [[ $arch != "armhf" ]]; then
55    # We don't need clang-format for the crossbuilds, but the installed amd64
56    # package will conflict with libclang. Uninstall clang-format (and its
57    # problematic dependency) to fix.
58    apt-get remove -y "clang-format-${LLVM_VERSION}" "libclang-cpp${LLVM_VERSION}" \
59            "llvm-${LLVM_VERSION}-runtime" "llvm-${LLVM_VERSION}-linker-tools"
60
61    # llvm-*-tools:$arch conflicts with python3:amd64. Install dependencies only
62    # with apt-get, then force-install llvm-*-{dev,tools}:$arch with dpkg to get
63    # around this.
64    apt-get install -y --no-remove --no-install-recommends \
65            "libclang-cpp${LLVM_VERSION}:$arch" \
66            "libgcc-s1:$arch" \
67            "libtinfo-dev:$arch" \
68            "libz3-dev:$arch" \
69            "llvm-${LLVM_VERSION}:$arch" \
70            zlib1g
71fi
72
73. .gitlab-ci/container/create-cross-file.sh $arch
74
75
76. .gitlab-ci/container/container_pre_build.sh
77
78
79# dependencies where we want a specific version
80MULTIARCH_PATH=$(dpkg-architecture -A $arch -qDEB_TARGET_MULTIARCH)
81export EXTRA_MESON_ARGS="--cross-file=/cross_file-${arch}.txt -D libdir=lib/${MULTIARCH_PATH}"
82. .gitlab-ci/container/build-wayland.sh
83
84. .gitlab-ci/container/build-directx-headers.sh
85
86apt-get purge -y "${EPHEMERAL[@]}"
87
88. .gitlab-ci/container/container_post_build.sh
89
90# This needs to be done after container_post_build.sh, or apt-get breaks in there
91if [[ $arch != "armhf" ]]; then
92    apt-get download llvm-"${LLVM_VERSION}"-{dev,tools}:"$arch"
93    dpkg -i --force-depends llvm-"${LLVM_VERSION}"-*_"${arch}".deb
94    rm llvm-"${LLVM_VERSION}"-*_"${arch}".deb
95fi
96