2021-10-13 23:40:53 +00:00
|
|
|
#!/usr/bin/env bash
|
2022-09-13 17:55:17 +00:00
|
|
|
# Copyright 2021 The ChromiumOS Authors
|
2021-10-13 23:40:53 +00:00
|
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
|
|
# found in the LICENSE file.
|
|
|
|
set -ex
|
|
|
|
|
|
|
|
sudo apt-get install --yes --no-install-recommends \
|
2023-02-23 18:58:32 +00:00
|
|
|
black \
|
2021-10-13 23:40:53 +00:00
|
|
|
ca-certificates \
|
2022-07-28 18:04:52 +00:00
|
|
|
clang \
|
2021-10-13 23:40:53 +00:00
|
|
|
cloud-image-utils \
|
|
|
|
curl \
|
|
|
|
dpkg-dev \
|
|
|
|
expect \
|
2023-03-14 13:08:55 +00:00
|
|
|
g++ \
|
2021-10-13 23:40:53 +00:00
|
|
|
gcc \
|
|
|
|
git \
|
|
|
|
jq \
|
|
|
|
libasound2-dev \
|
2022-06-02 06:32:32 +00:00
|
|
|
libavcodec-dev \
|
|
|
|
libavutil-dev \
|
2023-01-18 21:44:10 +00:00
|
|
|
libcap-dev \
|
2021-10-13 23:40:53 +00:00
|
|
|
libclang-dev \
|
|
|
|
libdbus-1-dev \
|
|
|
|
libdrm-dev \
|
|
|
|
libepoxy-dev \
|
2022-10-04 20:29:10 +00:00
|
|
|
libglib2.0-dev \
|
2022-07-27 21:04:13 +00:00
|
|
|
libguestfs-tools \
|
2022-10-04 20:29:10 +00:00
|
|
|
libslirp-dev \
|
2021-10-13 23:40:53 +00:00
|
|
|
libssl-dev \
|
2022-06-02 06:32:32 +00:00
|
|
|
libswscale-dev \
|
2022-06-21 04:57:28 +00:00
|
|
|
libva-dev \
|
2021-10-13 23:40:53 +00:00
|
|
|
libwayland-dev \
|
|
|
|
libxext-dev \
|
|
|
|
make \
|
2023-02-23 18:58:32 +00:00
|
|
|
meson \
|
|
|
|
mypy \
|
2021-10-13 23:40:53 +00:00
|
|
|
nasm \
|
2022-10-24 06:59:15 +00:00
|
|
|
ncat \
|
2021-10-13 23:40:53 +00:00
|
|
|
ninja-build \
|
|
|
|
openssh-client \
|
2023-02-23 18:58:32 +00:00
|
|
|
pipx \
|
2021-10-13 23:40:53 +00:00
|
|
|
pkg-config \
|
2023-01-18 21:44:10 +00:00
|
|
|
protobuf-compiler \
|
2021-10-13 23:40:53 +00:00
|
|
|
python3 \
|
2023-02-23 18:58:32 +00:00
|
|
|
python3-argh \
|
2021-11-01 06:32:18 +00:00
|
|
|
python3-pip \
|
2023-02-23 18:58:32 +00:00
|
|
|
python3-rich \
|
2021-10-13 23:40:53 +00:00
|
|
|
qemu-system-x86 \
|
|
|
|
rsync \
|
|
|
|
screen \
|
2023-03-21 23:39:16 +00:00
|
|
|
strace \
|
2022-11-01 22:06:43 +00:00
|
|
|
tmux \
|
2023-01-18 21:44:10 +00:00
|
|
|
wayland-protocols \
|
|
|
|
wget
|
2021-10-13 23:40:53 +00:00
|
|
|
|
2023-02-23 18:58:32 +00:00
|
|
|
# mdformat is not available as a debian package. Install via pipx instead.
|
|
|
|
pipx install mdformat
|
|
|
|
pipx inject mdformat mdformat-gfm mdformat-footnote
|
|
|
|
pipx ensurepath
|
2022-02-14 20:47:01 +00:00
|
|
|
|
2023-01-18 21:44:10 +00:00
|
|
|
# Install rustup if not available yet
|
2022-10-20 17:46:15 +00:00
|
|
|
if ! command -v rustup &>/dev/null; then
|
2022-09-12 19:20:23 +00:00
|
|
|
wget "https://static.rust-lang.org/rustup/archive/1.25.1/x86_64-unknown-linux-gnu/rustup-init"
|
2022-10-20 17:46:15 +00:00
|
|
|
echo "5cc9ffd1026e82e7fb2eec2121ad71f4b0f044e88bca39207b3f6b769aaa799c *rustup-init" | sha256sum -c -
|
2022-09-12 19:20:23 +00:00
|
|
|
chmod +x rustup-init
|
|
|
|
./rustup-init -y --no-modify-path --profile minimal --default-toolchain none
|
2023-01-18 21:44:10 +00:00
|
|
|
source ${CARGO_HOME:-~/.cargo}/env
|
2022-09-12 19:20:23 +00:00
|
|
|
rm rustup-init
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Install required rust components.
|
|
|
|
# This will also ensure the toolchain required by ./rust-toolchain is installed.
|
|
|
|
rustup component add cargo clippy rustfmt
|
2021-10-13 23:40:53 +00:00
|
|
|
|
2022-08-02 21:15:46 +00:00
|
|
|
# LLVM tools are used to generate and process coverage files
|
|
|
|
rustup component add llvm-tools-preview
|
|
|
|
|
2022-09-12 19:20:23 +00:00
|
|
|
# Allow cross-compilation via mingw64
|
2022-03-03 01:29:26 +00:00
|
|
|
rustup target add x86_64-pc-windows-gnu
|
|
|
|
|
2023-01-18 21:44:10 +00:00
|
|
|
# Cargo extension to install binary packages from github
|
|
|
|
curl -L https://github.com/cargo-bins/cargo-binstall/releases/download/v0.19.3/cargo-binstall-x86_64-unknown-linux-gnu.tgz | tar -xzvvf - -C ${CARGO_HOME:-~/.cargo}/bin
|
|
|
|
|
2023-02-23 18:58:32 +00:00
|
|
|
# Note: Using crate-meta-data will make too many requests to github to discover which release
|
|
|
|
# to download. This will get throttled quickly and slow down massively.
|
|
|
|
# This should be fixed by: https://github.com/cargo-bins/cargo-binstall/issues/776
|
|
|
|
|
2021-10-13 23:40:53 +00:00
|
|
|
# The bindgen tool is required to build a crosvm dependency.
|
2023-02-23 18:58:32 +00:00
|
|
|
cargo binstall --no-confirm --disable-strategies crate-meta-data bindgen-cli --version "0.64.0"
|
2021-10-13 23:40:53 +00:00
|
|
|
|
2022-08-02 21:15:46 +00:00
|
|
|
# binutils are wrappers to call the rustup bundled versions of llvm tools.
|
2023-02-23 18:58:32 +00:00
|
|
|
cargo binstall --no-confirm --disable-strategies crate-meta-data cargo-binutils
|
2022-08-02 21:15:46 +00:00
|
|
|
|
2023-01-18 21:44:10 +00:00
|
|
|
# The mdbook and mdbook-mermaid tools are used to build the crosvm book.
|
2023-02-23 18:58:32 +00:00
|
|
|
cargo binstall --no-confirm --disable-strategies crate-meta-data mdbook --version "0.4.25"
|
|
|
|
cargo binstall --no-confirm --disable-strategies crate-meta-data mdbook-mermaid --version "0.12.6"
|
|
|
|
cargo binstall --no-confirm --disable-strategies crate-meta-data mdbook-linkcheck --version "0.7.7"
|
2022-10-21 19:49:52 +00:00
|
|
|
|
2023-01-18 21:44:10 +00:00
|
|
|
# Nextest is an improved test runner for cargo
|
2023-02-23 18:58:32 +00:00
|
|
|
cargo binstall --no-confirm --disable-strategies crate-meta-data cargo-nextest --version "0.9.49"
|