| OLD | NEW |
| 1 #!/bin/bash -e | 1 #!/bin/bash -e |
| 2 | 2 |
| 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 # Script to install everything needed to build chromium on android that | 7 # Script to install everything needed to build chromium on android that |
| 8 # requires sudo privileges. | 8 # requires sudo privileges. |
| 9 # See http://code.google.com/p/chromium/wiki/AndroidBuildInstructions | 9 # See http://code.google.com/p/chromium/wiki/AndroidBuildInstructions |
| 10 | 10 |
| 11 # This script installs the sun-java6 packages (bin, jre and jdk). Sun requires | 11 # This script installs the sun-java6 packages (bin, jre and jdk). Sun requires |
| 12 # a license agreement, so upon installation it will prompt the user. To get | 12 # a license agreement, so upon installation it will prompt the user. To get |
| 13 # past the curses-based dialog press TAB <ret> TAB <ret> to agree. | 13 # past the curses-based dialog press TAB <ret> TAB <ret> to agree. |
| 14 | 14 |
| 15 if ! uname -m | egrep -q "i686|x86_64"; then | 15 if ! uname -m | egrep -q "i686|x86_64"; then |
| 16 echo "Only x86 architectures are currently supported" >&2 | 16 echo "Only x86 architectures are currently supported" >&2 |
| 17 exit | 17 exit |
| 18 fi | 18 fi |
| 19 | 19 |
| 20 # Install first the default Linux build deps. | 20 # Install first the default Linux build deps. |
| 21 "$(dirname "${BASH_SOURCE[0]}")/install-build-deps.sh" \ | 21 "$(dirname "${BASH_SOURCE[0]}")/install-build-deps.sh" \ |
| 22 --no-syms --no-arm --no-chromeos-fonts --no-nacl --no-prompt "$@" | 22 --no-syms --lib32 --no-arm --no-chromeos-fonts --no-nacl --no-prompt "$@" |
| 23 |
| 24 lsb_release=$(lsb_release --codename --short) |
| 23 | 25 |
| 24 # The temporary directory used to store output of update-java-alternatives | 26 # The temporary directory used to store output of update-java-alternatives |
| 25 TEMPDIR=$(mktemp -d) | 27 TEMPDIR=$(mktemp -d) |
| 26 cleanup() { | 28 cleanup() { |
| 27 local status=${?} | 29 local status=${?} |
| 28 trap - EXIT | 30 trap - EXIT |
| 29 rm -rf "${TEMPDIR}" | 31 rm -rf "${TEMPDIR}" |
| 30 exit ${status} | 32 exit ${status} |
| 31 } | 33 } |
| 32 trap cleanup EXIT | 34 trap cleanup EXIT |
| 33 | 35 |
| 34 sudo apt-get update | |
| 35 | |
| 36 # Fix deps | 36 # Fix deps |
| 37 sudo apt-get -f install | 37 sudo apt-get -f install |
| 38 | 38 |
| 39 # Install deps | 39 # Install deps |
| 40 # This step differs depending on what Ubuntu release we are running | 40 # This step differs depending on what Ubuntu release we are running |
| 41 # on since the package names are different, and Sun's Java must | 41 # on since the package names are different, and Sun's Java must |
| 42 # be installed manually on late-model versions. | 42 # be installed manually on late-model versions. |
| 43 | 43 |
| 44 # common | 44 # common |
| 45 sudo apt-get -y install lighttpd python-pexpect xvfb x11-utils | 45 sudo apt-get -y install lighttpd python-pexpect xvfb x11-utils |
| 46 | 46 |
| 47 # Few binaries in the Android SDK require 32-bit libraries on the host. | 47 # Some binaries in the Android SDK require 32-bit libraries on the host. |
| 48 sudo apt-get -y install lib32z1 g++-multilib | 48 # See https://developer.android.com/sdk/installing/index.html?pkg=tools |
| 49 | 49 if [[ $lsb_release == "precise" ]]; then |
| 50 # On Trusty-based systems you can't compile V8's mksnapshot without this one. | 50 sudo apt-get -y install ia32-libs |
| 51 # It is compiled for the host, using the -m32 flag, so it needs some 32 bit | 51 else |
| 52 # development support. It seems harmless on older Linux releases. | 52 sudo apt-get -y install libncurses5:i386 libstdc++6:i386 zlib1g:i386 |
| 53 sudo apt-get -y install linux-libc-dev:i386 | 53 fi |
| 54 | 54 |
| 55 sudo apt-get -y install ant | 55 sudo apt-get -y install ant |
| 56 | 56 |
| 57 # Install openjdk and openjre 7 stuff | 57 # Install openjdk and openjre 7 stuff |
| 58 sudo apt-get -y install openjdk-7-jre openjdk-7-jdk | 58 sudo apt-get -y install openjdk-7-jre openjdk-7-jdk |
| 59 | 59 |
| 60 # Switch version of Java to openjdk 7. | 60 # Switch version of Java to openjdk 7. |
| 61 # Some Java plugins (e.g. for firefox, mozilla) are not required to build, and | 61 # Some Java plugins (e.g. for firefox, mozilla) are not required to build, and |
| 62 # thus are treated only as warnings. Any errors in updating java alternatives | 62 # thus are treated only as warnings. Any errors in updating java alternatives |
| 63 # which are not '*-javaplugin.so' will cause errors and stop the script from | 63 # which are not '*-javaplugin.so' will cause errors and stop the script from |
| (...skipping 14 matching lines...) Expand all Loading... |
| 78 >& /dev/null | 78 >& /dev/null |
| 79 then | 79 then |
| 80 # If there are non-javaplugin.so errors, treat as errors and exit | 80 # If there are non-javaplugin.so errors, treat as errors and exit |
| 81 echo 'ERRORS: Failed to update alternatives for java-6-sun:' | 81 echo 'ERRORS: Failed to update alternatives for java-6-sun:' |
| 82 grep -v 'javaplugin.so' "${TEMPDIR}"/update-java-alternatives.out | 82 grep -v 'javaplugin.so' "${TEMPDIR}"/update-java-alternatives.out |
| 83 exit 1 | 83 exit 1 |
| 84 fi | 84 fi |
| 85 fi | 85 fi |
| 86 | 86 |
| 87 echo "install-build-deps-android.sh complete." | 87 echo "install-build-deps-android.sh complete." |
| OLD | NEW |