Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/bin/bash -x | 1 #!/bin/bash -x |
| 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 set -e | 7 set -e |
| 8 | 8 |
| 9 # The script is to install Android SDK, NDK for build chromium on Android, and | 9 # The script is to install Android SDK, NDK for build chromium on Android, and |
| 10 # doesn't need to run as root. | 10 # doesn't need to run as root. |
| 11 | 11 |
| 12 # Using Android 4.0, API Level: 14 (ice cream sandwich). The SDK package is | 12 # Using Android 4.0, API Level: 14 (ice cream sandwich). The SDK package is |
| 13 # about 25M. | 13 # about 25M. |
| 14 SDK_TARGET_VER=20 | 14 SDK_TARGET_VER=20 |
| 15 | 15 |
| 16 SDK_FILE_NAME="android-sdk_r${SDK_TARGET_VER}-linux.tgz" | 16 SDK_FILE_NAME="android-sdk_r${SDK_TARGET_VER}-linux.tgz" |
|
Yaron
2012/08/04 00:57:51
Just remove this file instead (and update build bo
Yaron
2012/08/06 16:29:04
Hmm. Although this also installs the custom 64-bit
| |
| 17 SDK_DOWNLOAD_URL="http://dl.google.com/android/${SDK_FILE_NAME}" | 17 SDK_DOWNLOAD_URL="http://dl.google.com/android/${SDK_FILE_NAME}" |
|
shashi
2012/08/04 01:12:01
Perhaps we can remove SDK_DOWNLOAD_URL and SDK_MD5
| |
| 18 SDK_MD5SUM="22a81cf1d4a951c62f71a8758290e9bb" | 18 SDK_MD5SUM="22a81cf1d4a951c62f71a8758290e9bb" |
| 19 | 19 |
| 20 # Using "ANDROID_SDK_ROOT/tools/android list targets" to get the matching target | 20 # Using "ANDROID_SDK_ROOT/tools/android list targets" to get the matching target |
| 21 # id which will be loaded in simulator for testing. | 21 # id which will be loaded in simulator for testing. |
| 22 # For example: the output of the listed the target could be below, and the | 22 # For example: the output of the listed the target could be below, and the |
| 23 # 'android-13' is the SDK_TARGET_ID in this case. | 23 # 'android-13' is the SDK_TARGET_ID in this case. |
| 24 # id: 9 or "android-13" | 24 # id: 9 or "android-13" |
| 25 # Name: Android 3.2 | 25 # Name: Android 3.2 |
| 26 # Type: Platform | 26 # Type: Platform |
| 27 # API level: 13 | 27 # API level: 13 |
| 28 # Revision: 1 | 28 # Revision: 1 |
| 29 # Skins: WXGA (default) | 29 # Skins: WXGA (default) |
| 30 SDK_TARGET_ID=android-15 | 30 SDK_TARGET_ID=android-16 |
| 31 | 31 |
| 32 # Using NDK r7; The package is about 64M. | 32 # Using NDK r7; The package is about 64M. |
| 33 # *** DO NOT UPDATE THE NDK without updating the 64-bit linker changes *** | 33 # *** DO NOT UPDATE THE NDK without updating the 64-bit linker changes *** |
| 34 # *** at the end of this file *** | 34 # *** at the end of this file *** |
| 35 NDK_FILE_NAME="android-ndk-r7-linux-x86.tar.bz2" | 35 NDK_FILE_NAME="android-ndk-r7-linux-x86.tar.bz2" |
| 36 NDK_DOWNLOAD_URL="http://dl.google.com/android/ndk/${NDK_FILE_NAME}" | 36 NDK_DOWNLOAD_URL="http://dl.google.com/android/ndk/${NDK_FILE_NAME}" |
|
shashi
2012/08/04 01:12:01
Same for this.
| |
| 37 NDK_MD5SUM="bf15e6b47bf50824c4b96849bf003ca3" | 37 NDK_MD5SUM="bf15e6b47bf50824c4b96849bf003ca3" |
| 38 | 38 |
| 39 # The temporary directory used to store the downloaded file. | 39 # The temporary directory used to store the downloaded file. |
| 40 TEMPDIR=$(mktemp -d) | 40 TEMPDIR=$(mktemp -d) |
| 41 cleanup() { | 41 cleanup() { |
| 42 local status=${?} | 42 local status=${?} |
| 43 trap - EXIT | 43 trap - EXIT |
| 44 rm -rf "${TEMPDIR}" | 44 rm -rf "${TEMPDIR}" |
| 45 exit ${status} | 45 exit ${status} |
| 46 } | 46 } |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 73 exit 1 | 73 exit 1 |
| 74 fi | 74 fi |
| 75 | 75 |
| 76 echo "Install ${local_file_name}" | 76 echo "Install ${local_file_name}" |
| 77 mv "${local_file_name}" "${install_path}" | 77 mv "${local_file_name}" "${install_path}" |
| 78 cd "${install_path}" | 78 cd "${install_path}" |
| 79 tar -xf "${local_file_name}" | 79 tar -xf "${local_file_name}" |
| 80 } | 80 } |
| 81 | 81 |
| 82 if [[ -z "${ANDROID_SDK_ROOT}" ]]; then | 82 if [[ -z "${ANDROID_SDK_ROOT}" ]]; then |
| 83 echo "Please set ANDROID_SDK_ROOT to where they should installed to." >& 2 | 83 echo "Please set ANDROID_SDK_ROOT to where they should installed to." >& 2 |
|
shashi
2012/08/04 01:12:01
Can we also nuke this code?
| |
| 84 echo "For example: /usr/local/android-sdk-linux_x86" >& 2 | 84 echo "For example: /usr/local/android-sdk-linux_x86" >& 2 |
| 85 exit 1 | 85 exit 1 |
| 86 fi | 86 fi |
| 87 | 87 |
| 88 if [[ -z "${ANDROID_NDK_ROOT}" ]]; then | 88 if [[ -z "${ANDROID_NDK_ROOT}" ]]; then |
| 89 echo "Please set ANDROID_NDK_ROOT to where they should installed to." >& 2 | 89 echo "Please set ANDROID_NDK_ROOT to where they should installed to." >& 2 |
| 90 echo "For example: /usr/local/android-ndk-r6b" >& 2 | 90 echo "For example: /usr/local/android-ndk-r6b" >& 2 |
| 91 exit 1 | 91 exit 1 |
| 92 fi | 92 fi |
| 93 | 93 |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 170 if [[ ! -f "$linker_dirname/$NEW_LINKER" ]]; then | 170 if [[ ! -f "$linker_dirname/$NEW_LINKER" ]]; then |
| 171 echo "Could not copy linker" | 171 echo "Could not copy linker" |
| 172 exit 1 | 172 exit 1 |
| 173 fi | 173 fi |
| 174 fi | 174 fi |
| 175 fi | 175 fi |
| 176 } | 176 } |
| 177 | 177 |
| 178 replace_linker $LINKER_DIRNAME_1 $LINKER_BASENAME_1 | 178 replace_linker $LINKER_DIRNAME_1 $LINKER_BASENAME_1 |
| 179 replace_linker $LINKER_DIRNAME_2 $LINKER_BASENAME_2 | 179 replace_linker $LINKER_DIRNAME_2 $LINKER_BASENAME_2 |
| OLD | NEW |