2012-03-07 06:22:18 +04:00
|
|
|
#!/bin/bash -e
|
2011-10-06 22:19:30 +04:00
|
|
|
|
2012-02-18 05:58:43 +04:00
|
|
|
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
2011-10-06 22:19:30 +04:00
|
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
|
|
# found in the LICENSE file.
|
|
|
|
|
2012-03-07 06:22:18 +04:00
|
|
|
# Script to install everything needed to build chromium on android that
|
|
|
|
# requires sudo privileges.
|
|
|
|
# See http://code.google.com/p/chromium/wiki/AndroidBuildInstructions
|
|
|
|
|
2012-03-14 11:23:30 +04:00
|
|
|
# This script installs the sun-java6 packages (bin, jre and jdk). Sun requires
|
|
|
|
# a license agreement, so upon installation it will prompt the user. To get
|
|
|
|
# past the curses-based dialog press TAB <ret> TAB <ret> to agree.
|
2012-03-07 06:22:18 +04:00
|
|
|
|
|
|
|
if ! uname -m | egrep -q "i686|x86_64"; then
|
|
|
|
echo "Only x86 architectures are currently supported" >&2
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2014-04-04 01:40:19 +04:00
|
|
|
# Install first the default Linux build deps.
|
|
|
|
"$(dirname "${BASH_SOURCE[0]}")/install-build-deps.sh" \
|
2014-09-16 21:08:10 +04:00
|
|
|
--no-syms --no-arm --no-chromeos-fonts --no-nacl --no-prompt "$@"
|
2012-03-07 06:22:18 +04:00
|
|
|
|
2012-03-14 11:23:30 +04:00
|
|
|
# The temporary directory used to store output of update-java-alternatives
|
2011-10-06 22:19:30 +04:00
|
|
|
TEMPDIR=$(mktemp -d)
|
|
|
|
cleanup() {
|
|
|
|
local status=${?}
|
|
|
|
trap - EXIT
|
|
|
|
rm -rf "${TEMPDIR}"
|
|
|
|
exit ${status}
|
|
|
|
}
|
|
|
|
trap cleanup EXIT
|
|
|
|
|
2012-03-14 11:23:30 +04:00
|
|
|
sudo apt-get update
|
2011-10-06 22:19:30 +04:00
|
|
|
|
2012-03-14 11:23:30 +04:00
|
|
|
# Fix deps
|
|
|
|
sudo apt-get -f install
|
2011-10-06 22:19:30 +04:00
|
|
|
|
2012-06-23 03:58:58 +04:00
|
|
|
# Install deps
|
2012-09-27 01:47:07 +04:00
|
|
|
# This step differs depending on what Ubuntu release we are running
|
|
|
|
# on since the package names are different, and Sun's Java must
|
|
|
|
# be installed manually on late-model versions.
|
|
|
|
|
2014-01-08 04:05:19 +04:00
|
|
|
# common
|
2014-08-13 03:40:57 +04:00
|
|
|
sudo apt-get -y install lighttpd python-pexpect xvfb x11-utils
|
2012-09-27 01:47:07 +04:00
|
|
|
|
2013-08-10 11:29:09 +04:00
|
|
|
# Few binaries in the Android SDK require 32-bit libraries on the host.
|
|
|
|
sudo apt-get -y install lib32z1 g++-multilib
|
|
|
|
|
2014-08-20 00:10:06 +04:00
|
|
|
# On Trusty-based systems you can't compile V8's mksnapshot without this one.
|
|
|
|
# It is compiled for the host, using the -m32 flag, so it needs some 32 bit
|
|
|
|
# development support. It seems harmless on older Linux releases.
|
|
|
|
sudo apt-get -y install linux-libc-dev:i386
|
|
|
|
|
2014-05-28 04:20:26 +04:00
|
|
|
sudo apt-get -y install ant
|
2014-05-23 13:42:37 +04:00
|
|
|
|
|
|
|
# Install openjdk and openjre 7 stuff
|
|
|
|
sudo apt-get -y install openjdk-7-jre openjdk-7-jdk
|
|
|
|
|
|
|
|
# Switch version of Java to openjdk 7.
|
|
|
|
# Some Java plugins (e.g. for firefox, mozilla) are not required to build, and
|
|
|
|
# thus are treated only as warnings. Any errors in updating java alternatives
|
|
|
|
# which are not '*-javaplugin.so' will cause errors and stop the script from
|
|
|
|
# completing successfully.
|
|
|
|
if ! sudo update-java-alternatives -s java-1.7.0-openjdk-amd64 \
|
|
|
|
>& "${TEMPDIR}"/update-java-alternatives.out
|
|
|
|
then
|
|
|
|
# Check that there are the expected javaplugin.so errors for the update
|
|
|
|
if grep 'javaplugin.so' "${TEMPDIR}"/update-java-alternatives.out >& \
|
|
|
|
/dev/null
|
|
|
|
then
|
|
|
|
# Print as warnings all the javaplugin.so errors
|
|
|
|
echo 'WARNING: java-6-sun has no alternatives for the following plugins:'
|
|
|
|
grep 'javaplugin.so' "${TEMPDIR}"/update-java-alternatives.out
|
2012-03-14 11:23:30 +04:00
|
|
|
fi
|
2014-05-23 13:42:37 +04:00
|
|
|
# Check if there are any errors that are not javaplugin.so
|
|
|
|
if grep -v 'javaplugin.so' "${TEMPDIR}"/update-java-alternatives.out \
|
|
|
|
>& /dev/null
|
2012-03-14 11:23:30 +04:00
|
|
|
then
|
2014-05-23 13:42:37 +04:00
|
|
|
# If there are non-javaplugin.so errors, treat as errors and exit
|
|
|
|
echo 'ERRORS: Failed to update alternatives for java-6-sun:'
|
|
|
|
grep -v 'javaplugin.so' "${TEMPDIR}"/update-java-alternatives.out
|
|
|
|
exit 1
|
2012-03-14 11:23:30 +04:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2012-03-07 06:22:18 +04:00
|
|
|
echo "install-build-deps-android.sh complete."
|