17ec681f3Smrg#!/bin/bash
27ec681f3Smrg
37ec681f3Smrgset -e
47ec681f3Smrgset -o xtrace
57ec681f3Smrg
67ec681f3Smrgexport DEBIAN_FRONTEND=noninteractive
77ec681f3Smrg
87ec681f3Smrg# Ephemeral packages (installed for this script and removed again at the end)
97ec681f3SmrgSTABLE_EPHEMERAL=" \
107ec681f3Smrg      autoconf \
117ec681f3Smrg      automake \
127ec681f3Smrg      autotools-dev \
137ec681f3Smrg      bzip2 \
147ec681f3Smrg      cmake \
157ec681f3Smrg      libgbm-dev \
167ec681f3Smrg      libtool \
177ec681f3Smrg      python3-pip \
187ec681f3Smrg      "
197ec681f3Smrg
207ec681f3Smrg# We need multiarch for Wine
217ec681f3Smrgdpkg --add-architecture i386
227ec681f3Smrgapt-get update
237ec681f3Smrg
247ec681f3Smrgapt-get install -y --no-remove \
257ec681f3Smrg      $STABLE_EPHEMERAL \
267ec681f3Smrg      clang \
277ec681f3Smrg      libasan6 \
287ec681f3Smrg      libarchive-dev \
297ec681f3Smrg      libclang-cpp11-dev \
307ec681f3Smrg      libglvnd-dev \
317ec681f3Smrg      libllvmspirvlib-dev \
327ec681f3Smrg      liblua5.3-dev \
337ec681f3Smrg      libxcb-dri2-0-dev \
347ec681f3Smrg      libxcb-dri3-dev \
357ec681f3Smrg      libxcb-glx0-dev \
367ec681f3Smrg      libxcb-present-dev \
377ec681f3Smrg      libxcb-randr0-dev \
387ec681f3Smrg      libxcb-shm0-dev \
397ec681f3Smrg      libxcb-sync-dev \
407ec681f3Smrg      libxcb-xfixes0-dev \
417ec681f3Smrg      libxcb1-dev \
427ec681f3Smrg      libxml2-dev \
437ec681f3Smrg      llvm-11-dev \
447ec681f3Smrg      llvm-9-dev \
457ec681f3Smrg      ocl-icd-opencl-dev \
467ec681f3Smrg      procps \
477ec681f3Smrg      spirv-tools \
487ec681f3Smrg      strace \
497ec681f3Smrg      time \
507ec681f3Smrg      wine \
517ec681f3Smrg      wine32
527ec681f3Smrg
537ec681f3Smrg
547ec681f3Smrg. .gitlab-ci/container/container_pre_build.sh
557ec681f3Smrg
567ec681f3Smrg
577ec681f3Smrg# Debian's pkg-config wrapers for mingw are broken, and there's no sign that
587ec681f3Smrg# they're going to be fixed, so we'll just have to fix it ourselves
597ec681f3Smrg# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=930492
607ec681f3Smrgcat >/usr/local/bin/x86_64-w64-mingw32-pkg-config <<EOF
617ec681f3Smrg#!/bin/sh
627ec681f3Smrg
637ec681f3SmrgPKG_CONFIG_LIBDIR=/usr/x86_64-w64-mingw32/lib/pkgconfig pkg-config \$@
647ec681f3SmrgEOF
657ec681f3Smrgchmod +x /usr/local/bin/x86_64-w64-mingw32-pkg-config
667ec681f3Smrg
677ec681f3Smrg
687ec681f3Smrg# dependencies where we want a specific version
697ec681f3Smrgexport              XORG_RELEASES=https://xorg.freedesktop.org/releases/individual
707ec681f3Smrgexport           WAYLAND_RELEASES=https://wayland.freedesktop.org/releases
717ec681f3Smrg
727ec681f3Smrgexport         XORGMACROS_VERSION=util-macros-1.19.0
737ec681f3Smrgexport         LIBWAYLAND_VERSION=wayland-1.18.0
747ec681f3Smrg
757ec681f3Smrgwget $XORG_RELEASES/util/$XORGMACROS_VERSION.tar.bz2
767ec681f3Smrgtar -xvf $XORGMACROS_VERSION.tar.bz2 && rm $XORGMACROS_VERSION.tar.bz2
777ec681f3Smrgcd $XORGMACROS_VERSION; ./configure; make install; cd ..
787ec681f3Smrgrm -rf $XORGMACROS_VERSION
797ec681f3Smrg
807ec681f3Smrg. .gitlab-ci/container/build-libdrm.sh
817ec681f3Smrg
827ec681f3Smrgwget $WAYLAND_RELEASES/$LIBWAYLAND_VERSION.tar.xz
837ec681f3Smrgtar -xvf $LIBWAYLAND_VERSION.tar.xz && rm $LIBWAYLAND_VERSION.tar.xz
847ec681f3Smrgcd $LIBWAYLAND_VERSION; ./configure --enable-libraries --without-host-scanner --disable-documentation --disable-dtd-validation; make install; cd ..
857ec681f3Smrgrm -rf $LIBWAYLAND_VERSION
867ec681f3Smrg
877ec681f3Smrg
887ec681f3Smrgpushd /usr/local
897ec681f3Smrggit clone https://gitlab.freedesktop.org/mesa/shader-db.git --depth 1
907ec681f3Smrgrm -rf shader-db/.git
917ec681f3Smrgcd shader-db
927ec681f3Smrgmake
937ec681f3Smrgpopd
947ec681f3Smrg
957ec681f3Smrggit clone https://github.com/microsoft/DirectX-Headers -b v1.0.1 --depth 1
967ec681f3Smrgpushd DirectX-Headers
977ec681f3Smrgmkdir build
987ec681f3Smrgcd build
997ec681f3Smrgmeson .. --backend=ninja --buildtype=release -Dbuild-test=false
1007ec681f3Smrgninja
1017ec681f3Smrgninja install
1027ec681f3Smrgpopd
1037ec681f3Smrgrm -rf DirectX-Headers
1047ec681f3Smrg
1057ec681f3Smrgpip3 install git+https://git.lavasoftware.org/lava/lavacli@3db3ddc45e5358908bc6a17448059ea2340492b7
1067ec681f3Smrg
1077ec681f3Smrg############### Uninstall the build software
1087ec681f3Smrg
1097ec681f3Smrgapt-get purge -y \
1107ec681f3Smrg      $STABLE_EPHEMERAL
1117ec681f3Smrg
1127ec681f3Smrg. .gitlab-ci/container/container_post_build.sh
113