• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2# The relative paths in this file only become valid at runtime.
3# shellcheck disable=SC1091
4
5set -e
6set -o xtrace
7
8export DEBIAN_FRONTEND=noninteractive
9
10# Ephemeral packages (installed for this script and removed again at the end)
11STABLE_EPHEMERAL=" \
12      ccache \
13      cmake \
14      g++ \
15      g++-mingw-w64-i686-posix \
16      g++-mingw-w64-x86-64-posix \
17      glslang-tools \
18      libexpat1-dev \
19      gnupg2 \
20      libgbm-dev \
21      libgles2-mesa-dev \
22      liblz4-dev \
23      libpciaccess-dev \
24      libudev-dev \
25      libvulkan-dev \
26      libwaffle-dev \
27      libx11-xcb-dev \
28      libxcb-ewmh-dev \
29      libxcb-keysyms1-dev \
30      libxkbcommon-dev \
31      libxrandr-dev \
32      libxrender-dev \
33      libzstd-dev \
34      meson \
35      mingw-w64-i686-dev \
36      mingw-w64-tools \
37      mingw-w64-x86-64-dev \
38      p7zip \
39      patch \
40      pkg-config \
41      python3-dev \
42      python3-distutils \
43      python3-pip \
44      python3-setuptools \
45      python3-wheel \
46      software-properties-common \
47      wget \
48      wine64-tools \
49      xz-utils \
50      "
51
52apt-get install -y --no-remove \
53      $STABLE_EPHEMERAL \
54      libxcb-shm0 \
55      pciutils \
56      python3-lxml \
57      python3-simplejson \
58      xinit \
59      xserver-xorg-video-amdgpu \
60      xserver-xorg-video-ati
61
62# We need multiarch for Wine
63dpkg --add-architecture i386
64
65# Install a more recent version of Wine than exists in Debian.
66apt-key add .gitlab-ci/container/debian/winehq.gpg.key
67apt-add-repository https://dl.winehq.org/wine-builds/debian/
68apt update -qyy
69
70# Needed for Valve's tracing jobs to collect information about the graphics
71# hardware on the test devices.
72pip3 install gfxinfo-mupuf==0.0.9
73
74apt install -y --no-remove --install-recommends winehq-stable
75
76function setup_wine() {
77    export WINEDEBUG="-all"
78    export WINEPREFIX="$1"
79
80    # We don't want crash dialogs
81    cat >crashdialog.reg <<EOF
82Windows Registry Editor Version 5.00
83
84[HKEY_CURRENT_USER\Software\Wine\WineDbg]
85"ShowCrashDialog"=dword:00000000
86
87EOF
88
89    # Set the wine prefix and disable the crash dialog
90    wine regedit crashdialog.reg
91    rm crashdialog.reg
92
93    # An immediate wine command may fail with: "${WINEPREFIX}: Not a
94    # valid wine prefix."  and that is just spit because of checking
95    # the existance of the system.reg file, which fails.  Just giving
96    # it a bit more of time for it to be created solves the problem
97    # ...
98    while ! test -f  "${WINEPREFIX}/system.reg"; do sleep 1; done
99}
100
101############### Install DXVK
102
103dxvk_install_release() {
104    local DXVK_VERSION=${1:-"1.10.1"}
105
106    wget "https://github.com/doitsujin/dxvk/releases/download/v${DXVK_VERSION}/dxvk-${DXVK_VERSION}.tar.gz"
107    tar xzpf dxvk-"${DXVK_VERSION}".tar.gz
108    "dxvk-${DXVK_VERSION}"/setup_dxvk.sh install
109    rm -rf "dxvk-${DXVK_VERSION}"
110    rm dxvk-"${DXVK_VERSION}".tar.gz
111}
112
113# Install from a Github PR number
114dxvk_install_pr() {
115    local __prnum=$1
116
117    # NOTE: Clone all the ensite history of the repo so as not to think
118    # harder about cloning just enough for 'git describe' to work.  'git
119    # describe' is used by the dxvk build system to generate a
120    # dxvk_version Meson variable, which is nice-to-have.
121    git clone https://github.com/doitsujin/dxvk
122    pushd dxvk
123    git fetch origin pull/"$__prnum"/head:pr
124    git checkout pr
125    ./package-release.sh pr ../dxvk-build --no-package
126    popd
127    pushd ./dxvk-build/dxvk-pr
128    ./setup_dxvk.sh install
129    popd
130    rm -rf ./dxvk-build ./dxvk
131}
132
133# Sets up the WINEPREFIX for the DXVK installation commands below.
134setup_wine "/dxvk-wine64"
135dxvk_install_release "1.10.1"
136#dxvk_install_pr 2359
137
138############### Install apitrace binaries for wine
139
140. .gitlab-ci/container/install-wine-apitrace.sh
141# Add the apitrace path to the registry
142wine \
143    reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment" \
144    /v Path \
145    /t REG_EXPAND_SZ \
146    /d "C:\windows\system32;C:\windows;C:\windows\system32\wbem;Z:\apitrace-msvc-win64\bin" \
147    /f
148
149############### Building ...
150
151. .gitlab-ci/container/container_pre_build.sh
152
153############### Build libdrm
154
155. .gitlab-ci/container/build-libdrm.sh
156
157############### Build Wayland
158
159. .gitlab-ci/container/build-wayland.sh
160
161############### Build parallel-deqp-runner's hang-detection tool
162
163. .gitlab-ci/container/build-hang-detection.sh
164
165############### Build piglit
166
167PIGLIT_BUILD_TARGETS="piglit_replayer" . .gitlab-ci/container/build-piglit.sh
168
169############### Build Fossilize
170
171. .gitlab-ci/container/build-fossilize.sh
172
173############### Build dEQP VK
174
175. .gitlab-ci/container/build-deqp.sh
176
177############### Build apitrace
178
179. .gitlab-ci/container/build-apitrace.sh
180
181############### Build gfxreconstruct
182
183. .gitlab-ci/container/build-gfxreconstruct.sh
184
185############### Build VKD3D-Proton
186
187setup_wine "/vkd3d-proton-wine64"
188
189. .gitlab-ci/container/build-vkd3d-proton.sh
190
191############### Uninstall the build software
192
193ccache --show-stats
194
195apt-get purge -y \
196      $STABLE_EPHEMERAL
197
198apt-get autoremove -y --purge
199