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 |
(...skipping 29 matching lines...) Expand all Loading... |
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 checkstyle lighttpd python-pexpect xvfb x11-utils | 45 sudo apt-get -y install checkstyle lighttpd python-pexpect xvfb x11-utils |
46 | 46 |
47 # Few binaries in the Android SDK require 32-bit libraries on the host. | 47 # Few binaries in the Android SDK require 32-bit libraries on the host. |
48 sudo apt-get -y install lib32z1 g++-multilib | 48 sudo apt-get -y install lib32z1 g++-multilib |
49 | 49 |
50 if [ $(/usr/bin/lsb_release -r -s | cut -d"." -f1) -ge 12 ]; then | 50 sudo apt-get -y install ant1.8 |
51 # Ubuntu >= 12.x | |
52 sudo apt-get -y install ant | |
53 | 51 |
54 # Java can not be installed via ppa on Ubuntu 12.04+ so we'll | 52 # Install openjdk and openjre 7 stuff |
55 # simply check to see if it has been setup properly -- if not | 53 sudo apt-get -y install openjdk-7-jre openjdk-7-jdk |
56 # let the user know. | |
57 | 54 |
58 if ! java -version 2>&1 | grep -q "Java(TM)"; then | 55 # Switch version of Java to openjdk 7. |
59 echo "****************************************************************" | 56 # Some Java plugins (e.g. for firefox, mozilla) are not required to build, and |
60 echo "You need to install the Oracle Java SDK from http://goo.gl/uPRSq" | 57 # thus are treated only as warnings. Any errors in updating java alternatives |
61 echo "and configure it as the default command-line Java environment." | 58 # which are not '*-javaplugin.so' will cause errors and stop the script from |
62 echo "****************************************************************" | 59 # completing successfully. |
63 exit | 60 if ! sudo update-java-alternatives -s java-1.7.0-openjdk-amd64 \ |
| 61 >& "${TEMPDIR}"/update-java-alternatives.out |
| 62 then |
| 63 # Check that there are the expected javaplugin.so errors for the update |
| 64 if grep 'javaplugin.so' "${TEMPDIR}"/update-java-alternatives.out >& \ |
| 65 /dev/null |
| 66 then |
| 67 # Print as warnings all the javaplugin.so errors |
| 68 echo 'WARNING: java-6-sun has no alternatives for the following plugins:' |
| 69 grep 'javaplugin.so' "${TEMPDIR}"/update-java-alternatives.out |
64 fi | 70 fi |
65 | 71 # Check if there are any errors that are not javaplugin.so |
66 else | 72 if grep -v 'javaplugin.so' "${TEMPDIR}"/update-java-alternatives.out \ |
67 # Ubuntu 10.x | 73 >& /dev/null |
68 | |
69 sudo apt-get -y install ant1.8 | |
70 | |
71 # Install sun-java6 stuff | |
72 sudo apt-get -y install sun-java6-bin sun-java6-jre sun-java6-jdk | |
73 | |
74 # Switch version of Java to java-6-sun | |
75 # Sun's java is missing certain Java plugins (e.g. for firefox, mozilla). | |
76 # These are not required to build, and thus are treated only as warnings. | |
77 # Any errors in updating java alternatives which are not '*-javaplugin.so' | |
78 # will cause errors and stop the script from completing successfully. | |
79 if ! sudo update-java-alternatives -s java-6-sun \ | |
80 >& "${TEMPDIR}"/update-java-alternatives.out | |
81 then | 74 then |
82 # Check that there are the expected javaplugin.so errors for the update | 75 # If there are non-javaplugin.so errors, treat as errors and exit |
83 if grep 'javaplugin.so' "${TEMPDIR}"/update-java-alternatives.out >& \ | 76 echo 'ERRORS: Failed to update alternatives for java-6-sun:' |
84 /dev/null | 77 grep -v 'javaplugin.so' "${TEMPDIR}"/update-java-alternatives.out |
85 then | 78 exit 1 |
86 # Print as warnings all the javaplugin.so errors | |
87 echo 'WARNING: java-6-sun has no alternatives for the following plugins:' | |
88 grep 'javaplugin.so' "${TEMPDIR}"/update-java-alternatives.out | |
89 fi | |
90 # Check if there are any errors that are not javaplugin.so | |
91 if grep -v 'javaplugin.so' "${TEMPDIR}"/update-java-alternatives.out \ | |
92 >& /dev/null | |
93 then | |
94 # If there are non-javaplugin.so errors, treat as errors and exit | |
95 echo 'ERRORS: Failed to update alternatives for java-6-sun:' | |
96 grep -v 'javaplugin.so' "${TEMPDIR}"/update-java-alternatives.out | |
97 exit 1 | |
98 fi | |
99 fi | 79 fi |
100 fi | 80 fi |
101 | 81 |
102 echo "install-build-deps-android.sh complete." | 82 echo "install-build-deps-android.sh complete." |
OLD | NEW |