1
0

install-deps 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. #!/usr/bin/env bash
  2. # Copyright 2021 The ChromiumOS Authors
  3. # Use of this source code is governed by a BSD-style license that can be
  4. # found in the LICENSE file.
  5. set -ex
  6. sudo apt-get install --yes --no-install-recommends \
  7. black \
  8. ca-certificates \
  9. clang \
  10. cloud-image-utils \
  11. curl \
  12. dpkg-dev \
  13. expect \
  14. g++ \
  15. gcc \
  16. git \
  17. jq \
  18. libavcodec-dev \
  19. libavutil-dev \
  20. libcap-dev \
  21. libclang-dev \
  22. libdbus-1-dev \
  23. libdrm-dev \
  24. libepoxy-dev \
  25. libglib2.0-dev \
  26. libguestfs-tools \
  27. libslirp-dev \
  28. libssl-dev \
  29. libswscale-dev \
  30. libva-dev \
  31. libwayland-dev \
  32. libxext-dev \
  33. lld \
  34. make \
  35. meson \
  36. mypy \
  37. nasm \
  38. ncat \
  39. ninja-build \
  40. openssh-client \
  41. pipx \
  42. pkg-config \
  43. protobuf-compiler \
  44. python3 \
  45. python3-argh \
  46. python3-pip \
  47. python3-rich \
  48. qemu-system-x86 \
  49. rsync \
  50. screen \
  51. strace \
  52. tmux \
  53. wayland-protocols \
  54. wget
  55. # mdformat is not available as a debian package. Install via pipx instead.
  56. pipx install mdformat
  57. pipx inject mdformat mdformat-gfm mdformat-footnote
  58. pipx ensurepath
  59. # Install rustup if not available yet
  60. if ! command -v rustup &>/dev/null; then
  61. wget "https://static.rust-lang.org/rustup/archive/1.25.1/x86_64-unknown-linux-gnu/rustup-init"
  62. echo "5cc9ffd1026e82e7fb2eec2121ad71f4b0f044e88bca39207b3f6b769aaa799c *rustup-init" | sha256sum -c -
  63. chmod +x rustup-init
  64. ./rustup-init -y --no-modify-path --profile minimal --default-toolchain none
  65. source ${CARGO_HOME:-~/.cargo}/env
  66. rm rustup-init
  67. fi
  68. # Install required rust components.
  69. # This will also ensure the toolchain required by ./rust-toolchain is installed.
  70. rustup component add cargo clippy rustfmt
  71. # LLVM tools are used to generate and process coverage files
  72. rustup component add llvm-tools-preview
  73. # Allow cross-compilation via mingw64
  74. rustup target add x86_64-pc-windows-gnu
  75. # Allow cross-compilation for android
  76. rustup target add aarch64-linux-android
  77. # Install nightly toolchain. Only used for rustfmt
  78. rustup toolchain install nightly --profile minimal --component rustfmt
  79. # Cargo extension to install binary packages from github
  80. curl -L https://github.com/cargo-bins/cargo-binstall/releases/download/v1.4.4/cargo-binstall-x86_64-unknown-linux-gnu.tgz | tar -xzvvf - -C ${CARGO_HOME:-~/.cargo}/bin
  81. # The bindgen tool is required to build a crosvm dependency.
  82. cargo binstall --no-confirm bindgen-cli --version "0.68.1"
  83. # binutils are wrappers to call the rustup bundled versions of llvm tools.
  84. cargo binstall --no-confirm cargo-binutils
  85. # The mdbook and mdbook-mermaid tools are used to build the crosvm book.
  86. cargo binstall --no-confirm mdbook --version "0.4.25"
  87. cargo binstall --no-confirm mdbook-mermaid --version "0.12.6"
  88. cargo binstall --no-confirm mdbook-linkcheck --version "0.7.7"
  89. # Nextest is an improved test runner for cargo
  90. cargo binstall --no-confirm cargo-nextest --version "0.9.49"
  91. Red='\033[0;31m'
  92. Reset='\033[0m'
  93. # Check if submodules were initialized. If a submodule is not initialized, git
  94. # submodule status will be prefixed with `-`
  95. if git submodule status | grep '^-'; then
  96. >&2 echo -e "${Red}ERROR${Reset}: Git modules were not initialized. Run 'git submodule update --init' to initialize them."
  97. fi