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 autoconf \ 11 automake \ 12 autotools-dev \ 13 bzip2 \ 14 cmake \ 15 gnupg \ 16 libgbm-dev \ 17 libtool \ 18 make \ 19 unzip \ 20 wget \ 21 " 22 23# We need multiarch for Wine 24dpkg --add-architecture i386 25apt-get update 26 27apt-get install -y --no-remove \ 28 $STABLE_EPHEMERAL \ 29 libarchive-dev \ 30 libclang-cpp10-dev \ 31 liblua5.3-dev \ 32 libxml2-dev \ 33 ocl-icd-opencl-dev \ 34 wine-development \ 35 wine32-development 36 37apt-get install -y --no-remove -t buster-backports \ 38 llvm-8-dev 39 40 41. .gitlab-ci/container/container_pre_build.sh 42 43 44# Debian's pkg-config wrapers for mingw are broken, and there's no sign that 45# they're going to be fixed, so we'll just have to fix it ourselves 46# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=930492 47cat >/usr/local/bin/x86_64-w64-mingw32-pkg-config <<EOF 48#!/bin/sh 49 50PKG_CONFIG_LIBDIR=/usr/x86_64-w64-mingw32/lib/pkgconfig pkg-config \$@ 51EOF 52chmod +x /usr/local/bin/x86_64-w64-mingw32-pkg-config 53 54 55# dependencies where we want a specific version 56export XORG_RELEASES=https://xorg.freedesktop.org/releases/individual 57export XCB_RELEASES=https://xcb.freedesktop.org/dist 58export WAYLAND_RELEASES=https://wayland.freedesktop.org/releases 59 60export XORGMACROS_VERSION=util-macros-1.19.0 61export XCBPROTO_VERSION=xcb-proto-1.13 62export LIBXCB_VERSION=libxcb-1.13 63export LIBWAYLAND_VERSION=wayland-1.17.0 64export WAYLAND_PROTOCOLS_VERSION=wayland-protocols-1.12 65 66wget $XORG_RELEASES/util/$XORGMACROS_VERSION.tar.bz2 67tar -xvf $XORGMACROS_VERSION.tar.bz2 && rm $XORGMACROS_VERSION.tar.bz2 68cd $XORGMACROS_VERSION; ./configure; make install; cd .. 69rm -rf $XORGMACROS_VERSION 70 71wget $XCB_RELEASES/$XCBPROTO_VERSION.tar.bz2 72tar -xvf $XCBPROTO_VERSION.tar.bz2 && rm $XCBPROTO_VERSION.tar.bz2 73cd $XCBPROTO_VERSION; ./configure; make install; cd .. 74rm -rf $XCBPROTO_VERSION 75 76wget $XCB_RELEASES/$LIBXCB_VERSION.tar.bz2 77tar -xvf $LIBXCB_VERSION.tar.bz2 && rm $LIBXCB_VERSION.tar.bz2 78cd $LIBXCB_VERSION; ./configure; make install; cd .. 79rm -rf $LIBXCB_VERSION 80 81. .gitlab-ci/build-libdrm.sh 82 83wget $WAYLAND_RELEASES/$LIBWAYLAND_VERSION.tar.xz 84tar -xvf $LIBWAYLAND_VERSION.tar.xz && rm $LIBWAYLAND_VERSION.tar.xz 85cd $LIBWAYLAND_VERSION; ./configure --enable-libraries --without-host-scanner --disable-documentation --disable-dtd-validation; make install; cd .. 86rm -rf $LIBWAYLAND_VERSION 87 88wget $WAYLAND_RELEASES/$WAYLAND_PROTOCOLS_VERSION.tar.xz 89tar -xvf $WAYLAND_PROTOCOLS_VERSION.tar.xz && rm $WAYLAND_PROTOCOLS_VERSION.tar.xz 90cd $WAYLAND_PROTOCOLS_VERSION; ./configure; make install; cd .. 91rm -rf $WAYLAND_PROTOCOLS_VERSION 92 93 94# The version of libglvnd-dev in debian is too old 95# Check this page to see when this local compilation can be dropped in favour of the package: 96# https://packages.debian.org/libglvnd-dev 97GLVND_VERSION=1.3.2 98wget https://gitlab.freedesktop.org/glvnd/libglvnd/-/archive/v$GLVND_VERSION/libglvnd-v$GLVND_VERSION.tar.gz 99tar -xvf libglvnd-v$GLVND_VERSION.tar.gz && rm libglvnd-v$GLVND_VERSION.tar.gz 100pushd libglvnd-v$GLVND_VERSION; ./autogen.sh; ./configure; make install; popd 101rm -rf libglvnd-v$GLVND_VERSION 102 103. .gitlab-ci/build-spirv-tools.sh 104 105git clone https://github.com/KhronosGroup/SPIRV-LLVM-Translator -b llvm_release_100 --depth 1 106pushd SPIRV-LLVM-Translator 107cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS=-fPIC -DCMAKE_CXX_FLAGS=-fPIC 108ninja 109ninja install 110popd 111 112pushd /usr/local 113git clone https://gitlab.freedesktop.org/mesa/shader-db.git --depth 1 114rm -rf shader-db/.git 115cd shader-db 116make 117popd 118 119 120############### Uninstall the build software 121 122apt-get purge -y \ 123 $STABLE_EPHEMERAL 124 125. .gitlab-ci/container/container_post_build.sh 126