author Daniel Varga <>
Fri, 09 Nov 2018 12:22:53 +0200
changeset 445390 981eb3885ff2d2edc9408d44dab9610594a930f7
parent 444311 media/webrtc/trunk/build/
parent 445272 media/webrtc/trunk/build/
permissions -rwxr-xr-x
Merge mozilla-central to autoland. a=merge


# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

# Script to install everything needed to build chromium on android, including
# items requiring sudo privileges.
# See


if ! uname -m | egrep -q "i686|x86_64"; then
  echo "Only x86 architectures are currently supported" >&2

# Exit if any commands fail.
set -e

lsb_release=$(lsb_release --codename --short)

# Install first the default Linux build deps.
"$(dirname "${BASH_SOURCE[0]}")/" \
  --no-syms --lib32 --no-arm --no-chromeos-fonts --no-nacl --no-prompt "${args}"

# Fix deps
sudo apt-get -f install

# common
sudo apt-get -y install lib32z1 lighttpd python-pexpect xvfb x11-utils

# Some binaries in the Android SDK require 32-bit libraries on the host.
# See
sudo apt-get -y install libncurses5:i386 libstdc++6:i386 zlib1g:i386

# Required by //components/cronet/tools/
# TODO(375324): Stop requiring ANT.
sudo apt-get -y install ant

# Required for apk-patch-size-estimator
sudo apt-get -y install bsdiff

# Do our own error handling for java.
set +e

function IsJava8() {
  # Arg is either "java" or "javac"
  $1 -version 2>&1 | grep -q '1\.8'

if ! (IsJava8 java && IsJava8 javac); then
  sudo apt-get -y install openjdk-8-jre openjdk-8-jdk

# There can be several reasons why java8 is not default despite being installed.
# Just show an error and exit.
if ! (IsJava8 java && IsJava8 javac); then
  echo "Automatic java installation failed."
  echo '`java -version` reports:'
  java -version
  echo '`javac -version` reports:'
  javac -version
  echo "Please ensure that JDK 8 is installed and resolves first in your PATH."
  echo -n '`which java` reports: '
  which java
  echo -n '`which javac` reports: '
  which javac
  echo "You might also try running:"
  echo "    sudo update-java-alternatives -s java-1.8.0-openjdk-amd64"
  exit 1

echo " complete."