| 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 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 --syms) do_inst_syms=1;; | 23 --syms) do_inst_syms=1;; |
| 24 --no-syms) do_inst_syms=0;; | 24 --no-syms) do_inst_syms=0;; |
| 25 --lib32) do_inst_lib32=1;; | 25 --lib32) do_inst_lib32=1;; |
| 26 --no-lib32) do_inst_lib32=0;; | 26 --no-lib32) do_inst_lib32=0;; |
| 27 *) usage;; | 27 *) usage;; |
| 28 esac | 28 esac |
| 29 shift | 29 shift |
| 30 done | 30 done |
| 31 | 31 |
| 32 if ! egrep -q \ | 32 if ! egrep -q \ |
| 33 'Ubuntu (10\.04|10\.10|11\.04|11\.10|lucid|maverick|natty|oneiric)' \ | 33 'Ubuntu (10\.04|10\.10|11\.04|11\.10|12\.04|lucid|maverick|natty|oneiric|pre
cise)' \ |
| 34 /etc/issue; then | 34 /etc/issue; then |
| 35 echo "Only Ubuntu 10.04 (lucid) through 11.10 (oneiric) are currently" \ | 35 echo "Only Ubuntu 10.04 (lucid) through 12.04 (precise) are currently" \ |
| 36 "supported" >&2 | 36 "supported" >&2 |
| 37 exit 1 | 37 exit 1 |
| 38 fi | 38 fi |
| 39 | 39 |
| 40 if ! uname -m | egrep -q "i686|x86_64"; then | 40 if ! uname -m | egrep -q "i686|x86_64"; then |
| 41 echo "Only x86 architectures are currently supported" >&2 | 41 echo "Only x86 architectures are currently supported" >&2 |
| 42 exit | 42 exit |
| 43 fi | 43 fi |
| 44 | 44 |
| 45 if [ "x$(id -u)" != x0 ]; then | 45 if [ "x$(id -u)" != x0 ]; then |
| 46 echo "Running as non-root user." | 46 echo "Running as non-root user." |
| 47 echo "You might have to enter your password one or more times for 'sudo'." | 47 echo "You might have to enter your password one or more times for 'sudo'." |
| 48 echo | 48 echo |
| 49 fi | 49 fi |
| 50 | 50 |
| 51 # Packages needed for chromeos only | 51 # Packages needed for chromeos only |
| 52 chromeos_dev_list="libpulse-dev" | 52 chromeos_dev_list="libpulse-dev" |
| 53 | 53 |
| 54 # Packages need for development | 54 # Packages need for development |
| 55 dev_list="apache2.2-bin bison curl elfutils fakeroot flex g++ gperf | 55 dev_list="apache2.2-bin bison curl elfutils fakeroot flex g++ gperf |
| 56 language-pack-fr libapache2-mod-php5 libasound2-dev libbz2-dev | 56 language-pack-fr libapache2-mod-php5 libasound2-dev libbz2-dev |
| 57 libcairo2-dev libcups2-dev libcurl4-gnutls-dev libdbus-glib-1-dev | 57 libcairo2-dev libcups2-dev libcurl4-gnutls-dev libdbus-glib-1-dev |
| 58 libelf-dev libgconf2-dev libgl1-mesa-dev libglib2.0-dev | 58 libelf-dev libgconf2-dev libgl1-mesa-dev libglib2.0-dev |
| 59 libglu1-mesa-dev libgnome-keyring-dev libgtk2.0-dev libjpeg62-dev | 59 libglu1-mesa-dev libgnome-keyring-dev libgtk2.0-dev libjpeg62-dev |
| 60 libkrb5-dev libnspr4-dev libnss3-dev libpam0g-dev libsctp-dev | 60 libkrb5-dev libnspr4-dev libnss3-dev libpam0g-dev libsctp-dev |
| 61 libsqlite3-dev libssl-dev libudev-dev libwww-perl libxslt1-dev | 61 libsqlite3-dev libssl-dev libudev-dev libwww-perl libxslt1-dev |
| 62 libxss-dev libxt-dev libxtst-dev mesa-common-dev msttcorefonts patch | 62 libxss-dev libxt-dev libxtst-dev mesa-common-dev patch |
| 63 perl php5-cgi pkg-config python python-cherrypy3 python-dev | 63 perl php5-cgi pkg-config python python-cherrypy3 python-dev |
| 64 python-psutil rpm ruby subversion ttf-dejavu-core ttf-indic-fonts | 64 python-psutil rpm ruby subversion ttf-dejavu-core ttf-indic-fonts |
| 65 ttf-kochi-gothic ttf-kochi-mincho ttf-thai-tlwg wdiff git-core | 65 ttf-kochi-gothic ttf-kochi-mincho ttf-thai-tlwg wdiff git-core |
| 66 $chromeos_dev_list" | 66 $chromeos_dev_list" |
| 67 | 67 |
| 68 # Run-time libraries required by chromeos only | 68 # Run-time libraries required by chromeos only |
| 69 chromeos_lib_list="libpulse0 libbz2-1.0 libcurl4-gnutls-dev" | 69 chromeos_lib_list="libpulse0 libbz2-1.0 libcurl4-gnutls-dev" |
| 70 | 70 |
| 71 # Full list of required run-time libraries | 71 # Full list of required run-time libraries |
| 72 lib_list="libatk1.0-0 libc6 libasound2 libcairo2 libcups2 libdbus-glib-1-2 | 72 lib_list="libatk1.0-0 libc6 libasound2 libcairo2 libcups2 libdbus-glib-1-2 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 83 libpango1.0-0-dbg libpcre3-dbg libpixman-1-0-dbg | 83 libpango1.0-0-dbg libpcre3-dbg libpixman-1-0-dbg |
| 84 libsqlite3-0-dbg | 84 libsqlite3-0-dbg |
| 85 libx11-6-dbg libxau6-dbg libxcb1-dbg libxcomposite1-dbg | 85 libx11-6-dbg libxau6-dbg libxcb1-dbg libxcomposite1-dbg |
| 86 libxcursor1-dbg libxdamage1-dbg libxdmcp6-dbg libxext6-dbg | 86 libxcursor1-dbg libxdamage1-dbg libxdmcp6-dbg libxext6-dbg |
| 87 libxfixes3-dbg libxi6-dbg libxinerama1-dbg libxrandr2-dbg | 87 libxfixes3-dbg libxi6-dbg libxinerama1-dbg libxrandr2-dbg |
| 88 libxrender1-dbg libxtst6-dbg zlib1g-dbg" | 88 libxrender1-dbg libxtst6-dbg zlib1g-dbg" |
| 89 | 89 |
| 90 # Plugin lists needed for tests. | 90 # Plugin lists needed for tests. |
| 91 plugin_list="flashplugin-installer" | 91 plugin_list="flashplugin-installer" |
| 92 | 92 |
| 93 # Some NSS packages were renamed in Natty. | 93 # Some package names have changed over time |
| 94 if egrep -q 'Ubuntu (10\.04|10\.10)' /etc/issue; then | 94 if dpkg --print-avail msttcorefonts >/dev/null 2>&1; then |
| 95 dev_list="${dev_list} msttcorefonts" |
| 96 else |
| 97 dev_list="${dev_list} ttf-mscorefonts-installer" |
| 98 fi |
| 99 if dpkg --print-avail libnspr4 >/dev/null 2>&1; then |
| 100 dbg_list="${dbg_list} libnspr4-dbg libnss3-dbg" |
| 101 lib_list="${lib_list} libnspr4 libnss3" |
| 102 else |
| 95 dbg_list="${dbg_list} libnspr4-0d-dbg libnss3-1d-dbg" | 103 dbg_list="${dbg_list} libnspr4-0d-dbg libnss3-1d-dbg" |
| 96 lib_list="${lib_list} libnspr4-0d libnss3-1d" | 104 lib_list="${lib_list} libnspr4-0d libnss3-1d" |
| 97 else | 105 fi |
| 98 dbg_list="${dbg_list} libnspr4-dbg libnss3-dbg" | 106 |
| 99 lib_list="${lib_list} libnspr4 libnss3" | 107 # Some packages are only needed, if the distribution actually supports |
| 108 # installing them. |
| 109 if dpkg --print-avail appmenu-gtk >/dev/null 2>&1; then |
| 110 lib_list="$lib_list appmenu-gtk" |
| 100 fi | 111 fi |
| 101 | 112 |
| 102 # Waits for the user to press 'Y' or 'N'. Either uppercase of lowercase is | 113 # Waits for the user to press 'Y' or 'N'. Either uppercase of lowercase is |
| 103 # accepted. Returns 0 for 'Y' and 1 for 'N'. If an optional parameter has | 114 # accepted. Returns 0 for 'Y' and 1 for 'N'. If an optional parameter has |
| 104 # been provided to yes_no(), the function also accepts RETURN as a user input. | 115 # been provided to yes_no(), the function also accepts RETURN as a user input. |
| 105 # The parameter specifies the exit code that should be returned in that case. | 116 # The parameter specifies the exit code that should be returned in that case. |
| 106 # The function will echo the user's selection followed by a newline character. | 117 # The function will echo the user's selection followed by a newline character. |
| 107 # Users can abort the function by pressing CTRL-C. This will call "exit 1". | 118 # Users can abort the function by pressing CTRL-C. This will call "exit 1". |
| 108 yes_no() { | 119 yes_no() { |
| 109 local c | 120 local c |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 fi | 165 fi |
| 155 | 166 |
| 156 sudo apt-get update | 167 sudo apt-get update |
| 157 | 168 |
| 158 # We initially run "apt-get" with the --reinstall option and parse its output. | 169 # We initially run "apt-get" with the --reinstall option and parse its output. |
| 159 # This way, we can find all the packages that need to be newly installed | 170 # This way, we can find all the packages that need to be newly installed |
| 160 # without accidentally promoting any packages from "auto" to "manual". | 171 # without accidentally promoting any packages from "auto" to "manual". |
| 161 # We then re-run "apt-get" with just the list of missing packages. | 172 # We then re-run "apt-get" with just the list of missing packages. |
| 162 echo "Finding missing packages..." | 173 echo "Finding missing packages..." |
| 163 packages="${dev_list} ${lib_list} ${dbg_list} ${plugin_list}" | 174 packages="${dev_list} ${lib_list} ${dbg_list} ${plugin_list}" |
| 164 # Intentially leaving $packages unquoted so it's more readable. | 175 # Intentionally leaving $packages unquoted so it's more readable. |
| 165 echo "Packages required: " $packages | 176 echo "Packages required: " $packages |
| 166 echo | 177 echo |
| 167 new_list_cmd="sudo apt-get install --reinstall $(echo $packages)" | 178 new_list_cmd="sudo apt-get install --reinstall $(echo $packages)" |
| 168 if new_list="$(yes n | LANG=C $new_list_cmd)"; then | 179 if new_list="$(yes n | LANG=C $new_list_cmd)"; then |
| 169 # We probably never hit this following line. | 180 # We probably never hit this following line. |
| 170 echo "No missing packages, and the packages are up-to-date." | 181 echo "No missing packages, and the packages are up-to-date." |
| 171 elif [ $? -eq 1 ]; then | 182 elif [ $? -eq 1 ]; then |
| 172 # We expect apt-get to have exit status of 1. | 183 # We expect apt-get to have exit status of 1. |
| 173 # This indicates that we canceled the install with "yes n|". | 184 # This indicates that we cancelled the install with "yes n|". |
| 174 new_list=$(echo "$new_list" | | 185 new_list=$(echo "$new_list" | |
| 175 sed -e '1,/The following NEW packages will be installed:/d;s/^ //;t;d') | 186 sed -e '1,/The following NEW packages will be installed:/d;s/^ //;t;d') |
| 176 new_list=$(echo "$new_list" | sed 's/ *$//') | 187 new_list=$(echo "$new_list" | sed 's/ *$//') |
| 177 if [ -z "$new_list" ] ; then | 188 if [ -z "$new_list" ] ; then |
| 178 echo "No missing packages, and the packages are up-to-date." | 189 echo "No missing packages, and the packages are up-to-date." |
| 179 else | 190 else |
| 180 echo "Installing missing packages: $new_list." | 191 echo "Installing missing packages: $new_list." |
| 181 sudo apt-get install ${new_list} | 192 sudo apt-get install ${new_list} |
| 182 fi | 193 fi |
| 183 echo | 194 echo |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 sed -e 's/[.]so[.][0-9].*/.so/' | | 389 sed -e 's/[.]so[.][0-9].*/.so/' | |
| 379 sort -u); do | 390 sort -u); do |
| 380 [ "x${i##*/}" = "xld-linux.so" ] && continue | 391 [ "x${i##*/}" = "xld-linux.so" ] && continue |
| 381 [ -r "$i" ] && continue | 392 [ -r "$i" ] && continue |
| 382 j="$(ls "$i."* | sed -e 's/.*[.]so[.]\([^.]*\)$/\1/;t;d' | | 393 j="$(ls "$i."* | sed -e 's/.*[.]so[.]\([^.]*\)$/\1/;t;d' | |
| 383 sort -n | tail -n 1)" | 394 sort -n | tail -n 1)" |
| 384 [ -r "$i.$j" ] || continue | 395 [ -r "$i.$j" ] || continue |
| 385 sudo ln -s "${i##*/}.$j" "$i" | 396 sudo ln -s "${i##*/}.$j" "$i" |
| 386 done | 397 done |
| 387 fi | 398 fi |
| OLD | NEW |