3 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file.
7 # Script to install everything needed to build chromium on android, including
8 # items requiring sudo privileges.
9 # See https://www.chromium.org/developers/how-tos/android-build-instructions
13 if ! uname -m | egrep -q "i686|x86_64"; then
14 echo "Only x86 architectures are currently supported" >&2
18 # Exit if any commands fail.
21 lsb_release=$(lsb_release --codename --short)
23 # Install first the default Linux build deps.
24 "$(dirname "${BASH_SOURCE[0]}")/install-build-deps.sh" \
25 --no-syms --lib32 --no-arm --no-chromeos-fonts --no-nacl --no-prompt "${args}"
28 sudo apt-get -f install
31 sudo apt-get -y install lib32z1 lighttpd python-pexpect xvfb x11-utils
33 # Some binaries in the Android SDK require 32-bit libraries on the host.
34 # See https://developer.android.com/sdk/installing/index.html?pkg=tools
35 sudo apt-get -y install libncurses5:i386 libstdc++6:i386 zlib1g:i386
37 # Required for apk-patch-size-estimator
38 sudo apt-get -y install bsdiff
40 # Do our own error handling for java.
44 # Arg is either "java" or "javac"
45 $1 -version 2>&1 | grep -q '1\.8'
48 if ! (IsJava8 java && IsJava8 javac); then
49 sudo apt-get -y install openjdk-8-jre openjdk-8-jdk
52 # There can be several reasons why java8 is not default despite being installed.
53 # Just show an error and exit.
54 if ! (IsJava8 java && IsJava8 javac); then
56 echo "Automatic java installation failed."
57 echo '`java -version` reports:'
60 echo '`javac -version` reports:'
63 echo "Please ensure that JDK 8 is installed and resolves first in your PATH."
64 echo -n '`which java` reports: '
66 echo -n '`which javac` reports: '
69 echo "You might also try running:"
70 echo " sudo update-java-alternatives -s java-1.8.0-openjdk-amd64"
74 echo "install-build-deps-android.sh complete."