| 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 (well, ideally, anyway) | 7 # Script to install everything needed to build chromium (well, ideally, anyway) |
| 8 # See http://code.google.com/p/chromium/wiki/LinuxBuildInstructions | 8 # See http://code.google.com/p/chromium/wiki/LinuxBuildInstructions |
| 9 # and http://code.google.com/p/chromium/wiki/LinuxBuild64Bit | 9 # and http://code.google.com/p/chromium/wiki/LinuxBuild64Bit |
| 10 | 10 |
| 11 usage() { | 11 usage() { |
| 12 echo "Usage: $0 [--options]" | 12 echo "Usage: $0 [--options]" |
| 13 echo "Options:" | 13 echo "Options:" |
| 14 echo "--[no-]syms: enable or disable installation of debugging symbols" | 14 echo "--[no-]syms: enable or disable installation of debugging symbols" |
| 15 echo "--[no-]lib32: enable or disable installation of 32 bit libraries" | 15 echo "--[no-]lib32: enable or disable installation of 32 bit libraries" |
| 16 echo "--[no-]arm: enable or disable installation of arm cross toolchain" |
| 16 echo "--no-prompt: silently select standard options/defaults" | 17 echo "--no-prompt: silently select standard options/defaults" |
| 17 echo "Script will prompt interactively if options not given." | 18 echo "Script will prompt interactively if options not given." |
| 18 exit 1 | 19 exit 1 |
| 19 } | 20 } |
| 20 | 21 |
| 21 while test "$1" != "" | 22 while test "$1" != "" |
| 22 do | 23 do |
| 23 case "$1" in | 24 case "$1" in |
| 24 --syms) do_inst_syms=1;; | 25 --syms) do_inst_syms=1;; |
| 25 --no-syms) do_inst_syms=0;; | 26 --no-syms) do_inst_syms=0;; |
| 26 --lib32) do_inst_lib32=1;; | 27 --lib32) do_inst_lib32=1;; |
| 27 --no-lib32) do_inst_lib32=0;; | 28 --no-lib32) do_inst_lib32=0;; |
| 29 --arm) do_inst_arm=1;; |
| 30 --no-arm) do_inst_arm=0;; |
| 28 --no-prompt) do_default=1 | 31 --no-prompt) do_default=1 |
| 29 do_quietly="-qq --assume-yes" | 32 do_quietly="-qq --assume-yes" |
| 30 ;; | 33 ;; |
| 31 *) usage;; | 34 *) usage;; |
| 32 esac | 35 esac |
| 33 shift | 36 shift |
| 34 done | 37 done |
| 35 | 38 |
| 36 if ! egrep -q \ | 39 ubuntu_versions="10\.04|10\.10|11\.04|11\.10|12\.04" |
| 37 'Ubuntu (10\.04|10\.10|11\.04|11\.10|12\.04|lucid|maverick|natty|oneiric|pre
cise)' \ | 40 ubuntu_codenames="lucid|maverick|natty|oneiric|precise" |
| 38 /etc/issue; then | 41 |
| 39 echo "Only Ubuntu 10.04 (lucid) through 12.04 (precise) are currently" \ | 42 if ! egrep -q "Ubuntu ($ubuntu_versions|$ubuntu_codenames)" /etc/issue; then |
| 43 echo "ERROR: Only Ubuntu 10.04 (lucid) through 12.04 (precise) are currently"\ |
| 40 "supported" >&2 | 44 "supported" >&2 |
| 41 exit 1 | 45 exit 1 |
| 42 fi | 46 fi |
| 43 | 47 |
| 44 if ! uname -m | egrep -q "i686|x86_64"; then | 48 if ! uname -m | egrep -q "i686|x86_64"; then |
| 45 echo "Only x86 architectures are currently supported" >&2 | 49 echo "Only x86 architectures are currently supported" >&2 |
| 46 exit | 50 exit |
| 47 fi | 51 fi |
| 48 | 52 |
| 49 if [ "x$(id -u)" != x0 ]; then | 53 if [ "x$(id -u)" != x0 ]; then |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 $chromeos_lib_list" | 92 $chromeos_lib_list" |
| 89 | 93 |
| 90 # Debugging symbols for all of the run-time libraries | 94 # Debugging symbols for all of the run-time libraries |
| 91 dbg_list="libatk1.0-dbg libc6-dbg libcairo2-dbg libfontconfig1-dbg | 95 dbg_list="libatk1.0-dbg libc6-dbg libcairo2-dbg libfontconfig1-dbg |
| 92 libglib2.0-0-dbg libgtk2.0-0-dbg libpango1.0-0-dbg libpcre3-dbg | 96 libglib2.0-0-dbg libgtk2.0-0-dbg libpango1.0-0-dbg libpcre3-dbg |
| 93 libpixman-1-0-dbg libsqlite3-0-dbg libx11-6-dbg libxau6-dbg | 97 libpixman-1-0-dbg libsqlite3-0-dbg libx11-6-dbg libxau6-dbg |
| 94 libxcb1-dbg libxcomposite1-dbg libxcursor1-dbg libxdamage1-dbg | 98 libxcb1-dbg libxcomposite1-dbg libxcursor1-dbg libxdamage1-dbg |
| 95 libxdmcp6-dbg libxext6-dbg libxfixes3-dbg libxi6-dbg libxinerama1-dbg | 99 libxdmcp6-dbg libxext6-dbg libxfixes3-dbg libxi6-dbg libxinerama1-dbg |
| 96 libxrandr2-dbg libxrender1-dbg libxtst6-dbg zlib1g-dbg" | 100 libxrandr2-dbg libxrender1-dbg libxtst6-dbg zlib1g-dbg" |
| 97 | 101 |
| 102 # arm cross toolchain packages needed to build chrome on arm |
| 103 arm_list="libc6-armel-cross libc6-dev-armel-cross libgcc1-armel-cross |
| 104 libgomp1-armel-cross linux-libc-dev-armel-cross |
| 105 libgcc1-dbg-armel-cross libgomp1-dbg-armel-cross |
| 106 binutils-arm-linux-gnueabi cpp-arm-linux-gnueabi |
| 107 gcc-arm-linux-gnueabi g++-arm-linux-gnueabi |
| 108 cpp-4.5-arm-linux-gnueabi gcc-4.5-arm-linux-gnueabi |
| 109 g++-4.5-arm-linux-gnueabi libmudflap0-dbg-armel-cross" |
| 110 |
| 98 # Plugin lists needed for tests. | 111 # Plugin lists needed for tests. |
| 99 plugin_list="flashplugin-installer" | 112 plugin_list="flashplugin-installer" |
| 100 | 113 |
| 101 # Some package names have changed over time | 114 # Some package names have changed over time |
| 102 if apt-cache show ttf-mscorefonts-installer >/dev/null 2>&1; then | 115 if apt-cache show ttf-mscorefonts-installer >/dev/null 2>&1; then |
| 103 dev_list="${dev_list} ttf-mscorefonts-installer" | 116 dev_list="${dev_list} ttf-mscorefonts-installer" |
| 104 else | 117 else |
| 105 dev_list="${dev_list} msttcorefonts" | 118 dev_list="${dev_list} msttcorefonts" |
| 106 fi | 119 fi |
| 107 if apt-cache show libnspr4-dbg >/dev/null 2>&1; then | 120 if apt-cache show libnspr4-dbg >/dev/null 2>&1; then |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 do_inst_syms=1 | 186 do_inst_syms=1 |
| 174 fi | 187 fi |
| 175 fi | 188 fi |
| 176 if test "$do_inst_syms" = "1"; then | 189 if test "$do_inst_syms" = "1"; then |
| 177 echo "Installing debugging symbols." | 190 echo "Installing debugging symbols." |
| 178 else | 191 else |
| 179 echo "Skipping installation of debugging symbols." | 192 echo "Skipping installation of debugging symbols." |
| 180 dbg_list= | 193 dbg_list= |
| 181 fi | 194 fi |
| 182 | 195 |
| 196 if test "$do_inst_arm" = "1"; then |
| 197 . /etc/lsb-release |
| 198 if test "$DISTRIB_CODENAME" != "precise"; then |
| 199 echo "ERROR: Installing the ARM cross toolchain is only available on" \ |
| 200 "Ubuntu precise." >&2 |
| 201 exit 1 |
| 202 fi |
| 203 echo "Installing ARM cross toolchain." |
| 204 else |
| 205 echo "Skipping installation of ARM cross toolchain." |
| 206 arm_list= |
| 207 fi |
| 208 |
| 183 sudo apt-get update | 209 sudo apt-get update |
| 184 | 210 |
| 185 # We initially run "apt-get" with the --reinstall option and parse its output. | 211 # We initially run "apt-get" with the --reinstall option and parse its output. |
| 186 # This way, we can find all the packages that need to be newly installed | 212 # This way, we can find all the packages that need to be newly installed |
| 187 # without accidentally promoting any packages from "auto" to "manual". | 213 # without accidentally promoting any packages from "auto" to "manual". |
| 188 # We then re-run "apt-get" with just the list of missing packages. | 214 # We then re-run "apt-get" with just the list of missing packages. |
| 189 echo "Finding missing packages..." | 215 echo "Finding missing packages..." |
| 190 packages="${dev_list} ${lib_list} ${dbg_list} ${plugin_list}" | 216 packages="${dev_list} ${lib_list} ${dbg_list} ${plugin_list} ${arm_list}" |
| 191 # Intentionally leaving $packages unquoted so it's more readable. | 217 # Intentionally leaving $packages unquoted so it's more readable. |
| 192 echo "Packages required: " $packages | 218 echo "Packages required: " $packages |
| 193 echo | 219 echo |
| 194 new_list_cmd="sudo apt-get install --reinstall $(echo $packages)" | 220 new_list_cmd="sudo apt-get install --reinstall $(echo $packages)" |
| 195 if new_list="$(yes n | LANG=C $new_list_cmd)"; then | 221 if new_list="$(yes n | LANG=C $new_list_cmd)"; then |
| 196 # We probably never hit this following line. | 222 # We probably never hit this following line. |
| 197 echo "No missing packages, and the packages are up-to-date." | 223 echo "No missing packages, and the packages are up-to-date." |
| 198 elif [ $? -eq 1 ]; then | 224 elif [ $? -eq 1 ]; then |
| 199 # We expect apt-get to have exit status of 1. | 225 # We expect apt-get to have exit status of 1. |
| 200 # This indicates that we cancelled the install with "yes n|". | 226 # This indicates that we cancelled the install with "yes n|". |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 sed -e 's/[.]so[.][0-9].*/.so/' | | 435 sed -e 's/[.]so[.][0-9].*/.so/' | |
| 410 sort -u); do | 436 sort -u); do |
| 411 [ "x${i##*/}" = "xld-linux.so" ] && continue | 437 [ "x${i##*/}" = "xld-linux.so" ] && continue |
| 412 [ -r "$i" ] && continue | 438 [ -r "$i" ] && continue |
| 413 j="$(ls "$i."* | sed -e 's/.*[.]so[.]\([^.]*\)$/\1/;t;d' | | 439 j="$(ls "$i."* | sed -e 's/.*[.]so[.]\([^.]*\)$/\1/;t;d' | |
| 414 sort -n | tail -n 1)" | 440 sort -n | tail -n 1)" |
| 415 [ -r "$i.$j" ] || continue | 441 [ -r "$i.$j" ] || continue |
| 416 sudo ln -s "${i##*/}.$j" "$i" | 442 sudo ln -s "${i##*/}.$j" "$i" |
| 417 done | 443 done |
| 418 fi | 444 fi |
| OLD | NEW |