gitlab-ci: Add Debian testing repository for x86_build image
[mesa.git] / .gitlab-ci / container / x86_build.sh
index 9170c84c7a935a2f92785bb6631d72a6b6c4f8ea..5980d1550d8f339b49435dbc4622a371368c056f 100644 (file)
@@ -20,16 +20,30 @@ apt-get install -y \
 apt-key add .gitlab-ci/container/llvm-snapshot.gpg.key
 echo "deb https://apt.llvm.org/buster/ llvm-toolchain-buster-9 main" >/etc/apt/sources.list.d/llvm9.list
 
+# Upstream Wine (WineHQ) package repository. We use the OBS service
+# instead of the repository at the winehq.org domain because:
+#
+#   " The WineHQ packages for Debian 10 and later require libfaudio0
+#     as a dependency. Since the distro does not provide it for Debian
+#     10, users of that version can download libfaudio0 packages from
+#     the OBS. See https://forum.winehq.org/viewtopic.php?f=8&t=32192
+#     for details."
+#
+# As explained at https://wiki.winehq.org/Debian
+apt-key add .gitlab-ci/container/obs-emulators-wine-debian.gpg.key
+echo 'deb https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/Debian_10/ ./' >/etc/apt/sources.list.d/obs-emulators-wine-debian.list
+
 sed -i -e 's/http:\/\/deb/https:\/\/deb/g' /etc/apt/sources.list
 echo 'deb https://deb.debian.org/debian buster-backports main' >/etc/apt/sources.list.d/backports.list
+echo 'deb https://deb.debian.org/debian testing main' >/etc/apt/sources.list.d/testing.list
 
 apt-get update
 
-# Use newer packages from backports by default
+# Don't use newer packages from testing by default
 cat >/etc/apt/preferences <<EOF
 Package: *
-Pin: release a=buster-backports
-Pin-Priority: 500
+Pin: release a=testing
+Pin-Priority: 100
 EOF
 
 apt-get dist-upgrade -y
@@ -49,7 +63,6 @@ apt-get install -y --no-remove \
       git \
       libclang-6.0-dev \
       libclang-7-dev \
-      libclang-8-dev \
       libclang-9-dev \
       libclc-dev \
       libelf-dev \
@@ -82,6 +95,8 @@ apt-get install -y --no-remove \
       pkg-config \
       python-mako \
       python3-mako \
+      python3-pil \
+      python3-requests \
       qemu-user \
       scons \
       x11proto-dri2-dev \
@@ -90,39 +105,49 @@ apt-get install -y --no-remove \
       xz-utils \
       zlib1g-dev
 
+apt-get install -y --no-remove -t buster-backports \
+      libclang-8-dev
+
 # Cross-build Mesa deps
 for arch in $CROSS_ARCHITECTURES; do
     apt-get install -y --no-remove \
             crossbuild-essential-${arch} \
             libdrm-dev:${arch} \
             libelf-dev:${arch} \
-            libexpat1-dev:${arch}
+            libexpat1-dev:${arch} \
+            libffi-dev:${arch} \
+            libstdc++6:${arch} \
+            libtinfo-dev:${arch}
+
+    apt-get install -y --no-remove -t buster-backports \
+            libllvm8:${arch}
 
-    if [ "$arch" != "i386" ]; then
-        mkdir /var/cache/apt/archives/${arch}
+    if [ "$arch" == "i386" ]; then
+        # libpciaccess-dev is only needed for Intel.
         apt-get install -y --no-remove \
-                libffi-dev:${arch} \
-                libllvm8:${arch} \
-                libstdc++6:${arch} \
-                libtinfo-dev:${arch} \
-
-        # Download llvm-* packages, but don't install them yet, since they can
-        # only be installed for one architecture at a time
-        apt-get install -o Dir::Cache::archives=/var/cache/apt/archives/$arch --download-only -y --no-remove \
-            llvm-8-dev:${arch}
+            libpciaccess-dev:${arch}
     fi
+
+    mkdir /var/cache/apt/archives/${arch}
+    # Download llvm-* packages, but don't install them yet, since they can
+    # only be installed for one architecture at a time
+    apt-get install -o Dir::Cache::archives=/var/cache/apt/archives/$arch --download-only \
+       -y --no-remove -t buster-backports \
+       llvm-8-dev:${arch}
 done
 
-apt-get install -y --no-remove \
+apt-get install -y --no-remove -t buster-backports \
       llvm-8-dev \
 
 # for 64bit windows cross-builds
 apt-get install -y --no-remove \
-    libz-mingw-w64-dev \
-    mingw-w64 \
-    wine \
-    wine32 \
-    wine64
+      libz-mingw-w64-dev \
+      mingw-w64 \
+      winehq-stable
+
+
+. .gitlab-ci/container/container_pre_build.sh
+
 
 # Debian's pkg-config wrapers for mingw are broken, and there's no sign that
 # they're going to be fixed, so we'll just have to fix it ourselves
@@ -172,35 +197,36 @@ export  WAYLAND_PROTOCOLS_VERSION=wayland-protocols-1.12
 
 wget $XORG_RELEASES/util/$XORGMACROS_VERSION.tar.bz2
 tar -xvf $XORGMACROS_VERSION.tar.bz2 && rm $XORGMACROS_VERSION.tar.bz2
-cd $XORGMACROS_VERSION; ./configure; make -j4 install; cd ..
+cd $XORGMACROS_VERSION; ./configure; make install; cd ..
 rm -rf $XORGMACROS_VERSION
 
 wget $XCB_RELEASES/$XCBPROTO_VERSION.tar.bz2
 tar -xvf $XCBPROTO_VERSION.tar.bz2 && rm $XCBPROTO_VERSION.tar.bz2
-cd $XCBPROTO_VERSION; ./configure; make -j4 install; cd ..
+cd $XCBPROTO_VERSION; ./configure; make install; cd ..
 rm -rf $XCBPROTO_VERSION
 
 wget $XCB_RELEASES/$LIBXCB_VERSION.tar.bz2
 tar -xvf $LIBXCB_VERSION.tar.bz2 && rm $LIBXCB_VERSION.tar.bz2
-cd $LIBXCB_VERSION; ./configure; make -j4 install; cd ..
+cd $LIBXCB_VERSION; ./configure; make install; cd ..
 rm -rf $LIBXCB_VERSION
 
 wget https://dri.freedesktop.org/libdrm/$LIBDRM_VERSION.tar.bz2
 tar -xvf $LIBDRM_VERSION.tar.bz2 && rm $LIBDRM_VERSION.tar.bz2
 cd $LIBDRM_VERSION
-meson build -D vc4=true -D freedreno=true -D etnaviv=true -D libdir=lib/x86_64-linux-gnu; ninja -j4 -C build install
-rm -rf build; meson --cross-file=/cross_file-ppc64el.txt build -D libdir=lib/powerpc64le-linux-gnu; ninja -j4 -C build install
+meson build -D vc4=true -D freedreno=true -D etnaviv=true -D libdir=lib/x86_64-linux-gnu; ninja -C build install
+rm -rf build; meson --cross-file=/cross_file-ppc64el.txt build -D libdir=lib/powerpc64le-linux-gnu; ninja -C build install
+rm -rf build; meson --cross-file=/cross_file-i386.txt build -D libdir=lib/i386-linux-gnu; ninja -C build install
 cd ..
 rm -rf $LIBDRM_VERSION
 
 wget $WAYLAND_RELEASES/$LIBWAYLAND_VERSION.tar.xz
 tar -xvf $LIBWAYLAND_VERSION.tar.xz && rm $LIBWAYLAND_VERSION.tar.xz
-cd $LIBWAYLAND_VERSION; ./configure --enable-libraries --without-host-scanner --disable-documentation --disable-dtd-validation; make -j4 install; cd ..
+cd $LIBWAYLAND_VERSION; ./configure --enable-libraries --without-host-scanner --disable-documentation --disable-dtd-validation; make install; cd ..
 rm -rf $LIBWAYLAND_VERSION
 
 wget $WAYLAND_RELEASES/$WAYLAND_PROTOCOLS_VERSION.tar.xz
 tar -xvf $WAYLAND_PROTOCOLS_VERSION.tar.xz && rm $WAYLAND_PROTOCOLS_VERSION.tar.xz
-cd $WAYLAND_PROTOCOLS_VERSION; ./configure; make -j4 install; cd ..
+cd $WAYLAND_PROTOCOLS_VERSION; ./configure; make install; cd ..
 rm -rf $WAYLAND_PROTOCOLS_VERSION
 
 
@@ -210,7 +236,7 @@ rm -rf $WAYLAND_PROTOCOLS_VERSION
 GLVND_VERSION=1.2.0
 wget https://gitlab.freedesktop.org/glvnd/libglvnd/-/archive/v$GLVND_VERSION/libglvnd-v$GLVND_VERSION.tar.gz
 tar -xvf libglvnd-v$GLVND_VERSION.tar.gz && rm libglvnd-v$GLVND_VERSION.tar.gz
-pushd libglvnd-v$GLVND_VERSION; ./autogen.sh; ./configure; make -j4 install; popd
+pushd libglvnd-v$GLVND_VERSION; ./autogen.sh; ./configure; make install; popd
 rm -rf libglvnd-v$GLVND_VERSION
 
 
@@ -218,14 +244,10 @@ pushd /usr/local
 git clone https://gitlab.freedesktop.org/mesa/shader-db.git --depth 1
 rm -rf shader-db/.git
 cd shader-db
-make -j4
+make
 popd
 
 
-# Remove ccache directory, useless for the build jobs
-rm -rf $(ccache --get-config=cache_dir)
-
-
 ############### Uninstall the build software
 
 apt-get purge -y \
@@ -240,4 +262,4 @@ apt-get purge -y \
       unzip \
       wget
 
-apt-get autoremove -y --purge
+. .gitlab-ci/container/container_post_build.sh