tools: Install winetricks

This will help us running audio tests under wine.

BUG=b:237011316
TEST=presubmit

Change-Id: Iba297159291abd135fb1972a19fa5b5c216fa956
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3971028
Commit-Queue: Vikram Auradkar <auradkar@google.com>
Reviewed-by: Dennis Kempin <denniskempin@google.com>
This commit is contained in:
Vikram Auradkar 2022-10-21 19:49:52 +00:00 committed by crosvm LUCI
parent 462d4c799c
commit 2653304c8e
4 changed files with 41 additions and 2 deletions

View file

@ -30,6 +30,10 @@ RUN dpkg --add-architecture arm64 \
# Allow APT to cache packages between docker image builds
RUN rm -f /etc/apt/apt.conf.d/docker-clean; echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
# Setting this will help install-deps skip installing wine deps, which
# will be installed by Dockerfile.user
ENV DOCKER_WINE_SETUP=1
# Install dependencies (APT and cargo packages are cached between image builds for faster iterative builds).
COPY tools/install-deps tools/install-aarch64-deps tools/install-armhf-deps tools/install-docs-deps rust-toolchain /tools/
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \

View file

@ -20,6 +20,9 @@ RUN useradd -ms /bin/bash crosvmdev \
# Allow dependencies and build files to be used and overwritten by user
&& chown -R crosvmdev:crosvmdev /scratch /cache
COPY tools/install-wine-deps /tools/
RUN chmod 755 /tools/install-wine-deps
# Following operations will be run as crosvmdev to ensure correct permission.
USER crosvmdev
@ -28,6 +31,8 @@ RUN echo 'export PATH=/cache/cargo_home/bin:/usr/local/cargo/bin:$PATH' >> /home
RUN wine64 wineboot
RUN /tools/install-wine-deps
# Switch back to root to avoid usermod crosvmdev as crosvmdev
USER root
COPY tools/impl/dev_container/entrypoint.sh tools/impl/dev_container/setup-user.sh /tools/

View file

@ -73,10 +73,15 @@ rustup component add llvm-tools-preview
rustup target add x86_64-pc-windows-gnu
# The bindgen tool is required to build a crosvm dependency.
cargo install bindgen --version=0.60.1
cargo install -f bindgen --version=0.60.1
# binutils are wrappers to call the rustup bundled versions of llvm tools.
cargo install cargo-binutils
cargo install -f cargo-binutils
# Install dependencies used to generate mdbook documentation.
$(dirname "$0")/install-docs-deps
# Install wine related dependencies if this is a local install and not a docker build
if [[ -z "${DOCKER_WINE_SETUP}" ]]; then
$(dirname "$0")/install-wine-deps
fi

25
tools/install-wine-deps Executable file
View file

@ -0,0 +1,25 @@
#!/usr/bin/env bash
# Copyright 2022 The ChromiumOS Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
set -ex
WINETRICKS_COMMIT_HASH="b666e05a0bf28fd940e5c258ccdfc0a2799d1948"
WINETRICKS_URL="https://raw.githubusercontent.com/Winetricks/winetricks/"$WINETRICKS_COMMIT_HASH"/src/winetricks"
WINESTRICKS_SCRIPT_SHA="40fdf1f89f3636187201858e3591e86752172814"
# Setup wine windows prebuilt dependecies.
export WINEARCH=win64
export WINE=wine64
sudo wget https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks -O winetricks
echo "$WINESTRICKS_SCRIPT_SHA winetricks" | sha1sum -c -
sudo chmod +x winetricks
# winetricks command fails while setting up dll registry post installation. During docker build
# this command fails because it tries to create a regedit window but we do not have DISPLAY set.
# Failure happens after installing dlls that we need so we ignore the failure.
# TODO(b:255824543): Find a way to clean install vcrun2015
./winetricks --force vcrun2015 || true
ln -fs ~/.wine/drive_c/windows/system32/ucrtbase.dll ~/.wine/drive_c/windows/system32/ucrtbased.dll
ln -fs ~/.wine/drive_c/windows/system32/vcruntime140.dll ~/.wine/drive_c/windows/system32/vcruntime140d.dll