1#!/usr/bin/env bash 2set -o errexit 3set -o xtrace 4 5export DEBIAN_FRONTEND=noninteractive 6 7CROSS_ARCHITECTURES=(i386 armhf arm64 ppc64el) 8for arch in ${CROSS_ARCHITECTURES[@]}; do 9 dpkg --add-architecture $arch 10done 11 12apt-get install -y \ 13 ca-certificates 14 15sed -i -e 's/http:\/\/deb/https:\/\/deb/g' /etc/apt/sources.list 16echo 'deb https://deb.debian.org/debian buster-backports main' >/etc/apt/sources.list.d/backports.list 17 18apt-get update 19 20# Use newer packages from backports by default 21cat >/etc/apt/preferences <<EOF 22Package: * 23Pin: release a=buster-backports 24Pin-Priority: 500 25EOF 26 27apt-get dist-upgrade -y 28 29apt-get install -y --no-remove \ 30 build-essential \ 31 docbook-xsl \ 32 libatomic-ops-dev \ 33 libcairo2-dev \ 34 libcunit1-dev \ 35 libpciaccess-dev \ 36 meson \ 37 ninja-build \ 38 pkg-config \ 39 python3 \ 40 python3-pip \ 41 python3-wheel \ 42 python3-setuptools \ 43 python3-docutils \ 44 valgrind 45 46for arch in ${CROSS_ARCHITECTURES[@]}; do 47 cross_file=/cross_file-$arch.txt 48 49 # Cross-build libdrm deps 50 apt-get install -y --no-remove \ 51 libcairo2-dev:$arch \ 52 libpciaccess-dev:$arch \ 53 crossbuild-essential-$arch 54 55 # Generate cross build files for Meson 56 /usr/share/meson/debcrossgen --arch $arch -o $cross_file 57 58 # Work around a bug in debcrossgen that should be fixed in the next release 59 if [ $arch = i386 ]; then 60 sed -i "s|cpu_family = 'i686'|cpu_family = 'x86'|g" $cross_file 61 fi 62done 63 64 65# Test that the oldest Meson version we claim to support is still supported 66pip3 install meson==0.43 67