meson: Build libdrm.so as an unversioned lib on Android.
[drm/libdrm.git] / .gitlab-ci / debian-install.sh
blobab901360ac010a59b02c5fd2b59e9526b25b3ad0
1 #!/usr/bin/env bash
2 set -o errexit
3 set -o xtrace
5 export DEBIAN_FRONTEND=noninteractive
7 CROSS_ARCHITECTURES=(i386 armhf arm64 ppc64el)
8 for arch in ${CROSS_ARCHITECTURES[@]}; do
9 dpkg --add-architecture $arch
10 done
12 apt-get install -y \
13 ca-certificates
15 sed -i -e 's/http:\/\/deb/https:\/\/deb/g' /etc/apt/sources.list
16 echo 'deb https://deb.debian.org/debian buster-backports main' >/etc/apt/sources.list.d/backports.list
18 apt-get update
20 # Use newer packages from backports by default
21 cat >/etc/apt/preferences <<EOF
22 Package: *
23 Pin: release a=buster-backports
24 Pin-Priority: 500
25 EOF
27 apt-get dist-upgrade -y
29 apt-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
46 for arch in ${CROSS_ARCHITECTURES[@]}; do
47 cross_file=/cross_file-$arch.txt
49 # Cross-build libdrm deps
50 apt-get install -y --no-remove \
51 libcairo2-dev:$arch \
52 libpciaccess-dev:$arch \
53 crossbuild-essential-$arch
55 # Generate cross build files for Meson
56 /usr/share/meson/debcrossgen --arch $arch -o $cross_file
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
62 done
65 # Test that the oldest Meson version we claim to support is still supported
66 pip3 install meson==0.46