[email protected] | e041ed1 | 2009-03-10 16:43:01 | [diff] [blame] | 1 | #!/bin/bash -e |
| 2 | |
[email protected] | aac39c9 | 2012-02-08 18:39:53 | [diff] [blame] | 3 | # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | e46cdae | 2009-08-25 20:59:27 | [diff] [blame] | 4 | # Use of this source code is governed by a BSD-style license that can be |
| 5 | # found in the LICENSE file. |
| 6 | |
[email protected] | cf1df40 | 2008-10-31 21:45:30 | [diff] [blame] | 7 | # Script to install everything needed to build chromium (well, ideally, anyway) |
mostynb | df175a8 | 2016-02-08 23:27:20 | [diff] [blame] | 8 | # See https://chromium.googlesource.com/chromium/src/+/master/docs/linux_build_instructions.md |
[email protected] | cf1df40 | 2008-10-31 21:45:30 | [diff] [blame] | 9 | |
[email protected] | 1eae2bfb | 2010-01-26 18:17:53 | [diff] [blame] | 10 | usage() { |
| 11 | echo "Usage: $0 [--options]" |
| 12 | echo "Options:" |
| 13 | echo "--[no-]syms: enable or disable installation of debugging symbols" |
johnme | 49bb458a | 2014-11-27 15:45:31 | [diff] [blame] | 14 | echo "--lib32: enable installation of 32-bit libraries, e.g. for V8 snapshot" |
[email protected] | f2826b6a | 2012-11-15 01:06:26 | [diff] [blame] | 15 | echo "--[no-]arm: enable or disable installation of arm cross toolchain" |
[email protected] | bd29cdd | 2013-02-22 03:49:20 | [diff] [blame] | 16 | echo "--[no-]chromeos-fonts: enable or disable installation of Chrome OS"\ |
| 17 | "fonts" |
[email protected] | 56541636 | 2014-01-16 21:26:47 | [diff] [blame] | 18 | echo "--[no-]nacl: enable or disable installation of prerequisites for"\ |
| 19 | "building standalone NaCl and all its toolchains" |
[email protected] | e2544ed4 | 2012-04-23 04:48:31 | [diff] [blame] | 20 | echo "--no-prompt: silently select standard options/defaults" |
[email protected] | ba48c4ca | 2013-10-25 16:11:46 | [diff] [blame] | 21 | echo "--quick-check: quickly try to determine if dependencies are installed" |
| 22 | echo " (this avoids interactive prompts and sudo commands," |
| 23 | echo " so might not be 100% accurate)" |
| 24 | echo "--unsupported: attempt installation even on unsupported systems" |
[email protected] | 1eae2bfb | 2010-01-26 18:17:53 | [diff] [blame] | 25 | echo "Script will prompt interactively if options not given." |
| 26 | exit 1 |
| 27 | } |
| 28 | |
thomasanderson | 4e3d30fe | 2016-12-07 18:58:34 | [diff] [blame] | 29 | # Waits for the user to press 'Y' or 'N'. Either uppercase of lowercase is |
| 30 | # accepted. Returns 0 for 'Y' and 1 for 'N'. If an optional parameter has |
| 31 | # been provided to yes_no(), the function also accepts RETURN as a user input. |
| 32 | # The parameter specifies the exit code that should be returned in that case. |
| 33 | # The function will echo the user's selection followed by a newline character. |
| 34 | # Users can abort the function by pressing CTRL-C. This will call "exit 1". |
| 35 | yes_no() { |
| 36 | if [ 0 -ne "${do_default-0}" ] ; then |
| 37 | [ $1 -eq 0 ] && echo "Y" || echo "N" |
| 38 | return $1 |
| 39 | fi |
| 40 | local c |
| 41 | while :; do |
| 42 | c="$(trap 'stty echo -iuclc icanon 2>/dev/null' EXIT INT TERM QUIT |
| 43 | stty -echo iuclc -icanon 2>/dev/null |
| 44 | dd count=1 bs=1 2>/dev/null | od -An -tx1)" |
| 45 | case "$c" in |
| 46 | " 0a") if [ -n "$1" ]; then |
| 47 | [ $1 -eq 0 ] && echo "Y" || echo "N" |
| 48 | return $1 |
| 49 | fi |
| 50 | ;; |
| 51 | " 79") echo "Y" |
| 52 | return 0 |
| 53 | ;; |
| 54 | " 6e") echo "N" |
| 55 | return 1 |
| 56 | ;; |
| 57 | "") echo "Aborted" >&2 |
| 58 | exit 1 |
| 59 | ;; |
| 60 | *) # The user pressed an unrecognized key. As we are not echoing |
| 61 | # any incorrect user input, alert the user by ringing the bell. |
| 62 | (tput bel) 2>/dev/null |
| 63 | ;; |
| 64 | esac |
| 65 | done |
| 66 | } |
| 67 | |
[email protected] | 4fc0071 | 2013-05-29 23:11:20 | [diff] [blame] | 68 | # Checks whether a particular package is available in the repos. |
| 69 | # USAGE: $ package_exists <package name> |
| 70 | package_exists() { |
thomasanderson | b4a2bca | 2016-12-08 06:46:05 | [diff] [blame] | 71 | [ ! -z "`apt-cache search --names-only "$1"`" ] |
[email protected] | 4fc0071 | 2013-05-29 23:11:20 | [diff] [blame] | 72 | } |
| 73 | |
[email protected] | fbeddf2 | 2014-01-17 23:59:01 | [diff] [blame] | 74 | # These default to on because (some) bots need them and it keeps things |
| 75 | # simple for the bot setup if all bots just run the script in its default |
| 76 | # mode. Developers who don't want stuff they don't need installed on their |
| 77 | # own workstations can pass --no-arm --no-nacl when running the script. |
| 78 | do_inst_arm=1 |
| 79 | do_inst_nacl=1 |
| 80 | |
[email protected] | 1eae2bfb | 2010-01-26 18:17:53 | [diff] [blame] | 81 | while test "$1" != "" |
| 82 | do |
| 83 | case "$1" in |
[email protected] | ce77464 | 2011-09-12 23:21:39 | [diff] [blame] | 84 | --syms) do_inst_syms=1;; |
| 85 | --no-syms) do_inst_syms=0;; |
[email protected] | ce77464 | 2011-09-12 23:21:39 | [diff] [blame] | 86 | --lib32) do_inst_lib32=1;; |
[email protected] | f2826b6a | 2012-11-15 01:06:26 | [diff] [blame] | 87 | --arm) do_inst_arm=1;; |
| 88 | --no-arm) do_inst_arm=0;; |
[email protected] | bd29cdd | 2013-02-22 03:49:20 | [diff] [blame] | 89 | --chromeos-fonts) do_inst_chromeos_fonts=1;; |
| 90 | --no-chromeos-fonts) do_inst_chromeos_fonts=0;; |
[email protected] | 56541636 | 2014-01-16 21:26:47 | [diff] [blame] | 91 | --nacl) do_inst_nacl=1;; |
| 92 | --no-nacl) do_inst_nacl=0;; |
[email protected] | e2544ed4 | 2012-04-23 04:48:31 | [diff] [blame] | 93 | --no-prompt) do_default=1 |
| 94 | do_quietly="-qq --assume-yes" |
| 95 | ;; |
[email protected] | ba48c4ca | 2013-10-25 16:11:46 | [diff] [blame] | 96 | --quick-check) do_quick_check=1;; |
[email protected] | fe63a02 | 2013-01-15 22:11:47 | [diff] [blame] | 97 | --unsupported) do_unsupported=1;; |
[email protected] | 1eae2bfb | 2010-01-26 18:17:53 | [diff] [blame] | 98 | *) usage;; |
| 99 | esac |
| 100 | shift |
| 101 | done |
| 102 | |
johnme | 49bb458a | 2014-11-27 15:45:31 | [diff] [blame] | 103 | if test "$do_inst_arm" = "1"; then |
| 104 | do_inst_lib32=1 |
| 105 | fi |
| 106 | |
[email protected] | 0febc9b | 2014-05-22 20:07:19 | [diff] [blame] | 107 | # Check for lsb_release command in $PATH |
| 108 | if ! which lsb_release > /dev/null; then |
| 109 | echo "ERROR: lsb_release not found in \$PATH" >&2 |
| 110 | exit 1; |
| 111 | fi |
[email protected] | f2826b6a | 2012-11-15 01:06:26 | [diff] [blame] | 112 | |
[email protected] | 0febc9b | 2014-05-22 20:07:19 | [diff] [blame] | 113 | lsb_release=$(lsb_release --codename --short) |
thomasanderson | 05c4029 | 2017-03-28 19:28:45 | [diff] [blame^] | 114 | supported_releases="(trusty|xenial|yakkety|jessie)" |
[email protected] | ba48c4ca | 2013-10-25 16:11:46 | [diff] [blame] | 115 | if [ 0 -eq "${do_unsupported-0}" ] && [ 0 -eq "${do_quick_check-0}" ] ; then |
thomasanderson | b4a2bca | 2016-12-08 06:46:05 | [diff] [blame] | 116 | if [[ ! $lsb_release =~ $supported_releases ]]; then |
thomasanderson | 05c4029 | 2017-03-28 19:28:45 | [diff] [blame^] | 117 | echo -e "ERROR: The only supported distros are\n" \ |
| 118 | "\tUbuntu 14.04 (trusty)\n" \ |
| 119 | "\tUbuntu 16.04 (xenial)\n" \ |
| 120 | "\tUbuntu 16.10 (yakkety)\n" \ |
| 121 | "\tDebian 8 (jessie)" >&2 |
anthonyvd | 2ae919e5 | 2016-11-21 19:47:12 | [diff] [blame] | 122 | exit 1 |
[email protected] | fe63a02 | 2013-01-15 22:11:47 | [diff] [blame] | 123 | fi |
[email protected] | cf1df40 | 2008-10-31 21:45:30 | [diff] [blame] | 124 | |
[email protected] | fe63a02 | 2013-01-15 22:11:47 | [diff] [blame] | 125 | if ! uname -m | egrep -q "i686|x86_64"; then |
anthonyvd | 2ae919e5 | 2016-11-21 19:47:12 | [diff] [blame] | 126 | echo "Only x86 architectures are currently supported" >&2 |
[email protected] | fe63a02 | 2013-01-15 22:11:47 | [diff] [blame] | 127 | exit |
| 128 | fi |
[email protected] | e041ed1 | 2009-03-10 16:43:01 | [diff] [blame] | 129 | fi |
| 130 | |
[email protected] | ba48c4ca | 2013-10-25 16:11:46 | [diff] [blame] | 131 | if [ "x$(id -u)" != x0 ] && [ 0 -eq "${do_quick_check-0}" ]; then |
[email protected] | e041ed1 | 2009-03-10 16:43:01 | [diff] [blame] | 132 | echo "Running as non-root user." |
| 133 | echo "You might have to enter your password one or more times for 'sudo'." |
[email protected] | 8ada8c5 | 2009-03-10 21:53:08 | [diff] [blame] | 134 | echo |
[email protected] | e041ed1 | 2009-03-10 16:43:01 | [diff] [blame] | 135 | fi |
| 136 | |
[email protected] | fdc6bf5 | 2010-06-07 22:01:57 | [diff] [blame] | 137 | # Packages needed for chromeos only |
dnj | 6a8491d1 | 2015-05-26 21:08:12 | [diff] [blame] | 138 | chromeos_dev_list="libbluetooth-dev libxkbcommon-dev realpath" |
[email protected] | fdc6bf5 | 2010-06-07 22:01:57 | [diff] [blame] | 139 | |
[email protected] | b61f688 | 2013-11-14 20:41:41 | [diff] [blame] | 140 | # Packages needed for development |
thomasanderson | 20032a5c | 2017-03-02 00:28:20 | [diff] [blame] | 141 | dev_list="\ |
| 142 | bison |
| 143 | cdbs |
| 144 | curl |
| 145 | dpkg-dev |
| 146 | elfutils |
| 147 | devscripts |
| 148 | fakeroot |
| 149 | flex |
| 150 | fonts-ipafont |
| 151 | fonts-thai-tlwg |
| 152 | g++ |
| 153 | git-core |
| 154 | git-svn |
| 155 | gperf |
| 156 | libasound2-dev |
| 157 | libbrlapi-dev |
| 158 | libav-tools |
| 159 | libbz2-dev |
| 160 | libcairo2-dev |
| 161 | libcap-dev |
| 162 | libcups2-dev |
| 163 | libcurl4-gnutls-dev |
| 164 | libdrm-dev |
| 165 | libelf-dev |
| 166 | libffi-dev |
| 167 | libgconf2-dev |
| 168 | libglib2.0-dev |
| 169 | libglu1-mesa-dev |
| 170 | libgnome-keyring-dev |
| 171 | libgtk2.0-dev |
| 172 | libgtk-3-dev |
| 173 | libkrb5-dev |
| 174 | libnspr4-dev |
| 175 | libnss3-dev |
| 176 | libpam0g-dev |
| 177 | libpci-dev |
| 178 | libpulse-dev |
| 179 | libsctp-dev |
| 180 | libspeechd-dev |
| 181 | libsqlite3-dev |
| 182 | libssl-dev |
| 183 | libudev-dev |
| 184 | libwww-perl |
| 185 | libxslt1-dev |
| 186 | libxss-dev |
| 187 | libxt-dev |
| 188 | libxtst-dev |
| 189 | openbox |
| 190 | patch |
| 191 | perl |
| 192 | pkg-config |
| 193 | python |
| 194 | python-cherrypy3 |
| 195 | python-crypto |
| 196 | python-dev |
| 197 | python-numpy |
| 198 | python-opencv |
| 199 | python-openssl |
| 200 | python-psutil |
| 201 | python-yaml |
| 202 | rpm |
| 203 | ruby |
| 204 | subversion |
| 205 | ttf-dejavu-core |
| 206 | wdiff |
| 207 | xcompmgr |
| 208 | zip |
| 209 | $chromeos_dev_list |
| 210 | " |
[email protected] | fdc6bf5 | 2010-06-07 22:01:57 | [diff] [blame] | 211 | |
[email protected] | f16aabf | 2012-08-15 21:00:14 | [diff] [blame] | 212 | # 64-bit systems need a minimum set of 32-bit compat packages for the pre-built |
[email protected] | f8ceadb | 2014-08-18 12:30:23 | [diff] [blame] | 213 | # NaCl binaries. |
ki.stfu | 0a79d699 | 2015-09-17 07:27:12 | [diff] [blame] | 214 | if file -L /sbin/init | grep -q 'ELF 64-bit'; then |
[email protected] | d93d68b1 | 2012-10-15 06:39:53 | [diff] [blame] | 215 | dev_list="${dev_list} libc6-i386 lib32gcc1 lib32stdc++6" |
[email protected] | f16aabf | 2012-08-15 21:00:14 | [diff] [blame] | 216 | fi |
| 217 | |
[email protected] | fdc6bf5 | 2010-06-07 22:01:57 | [diff] [blame] | 218 | # Run-time libraries required by chromeos only |
[email protected] | ba48c4ca | 2013-10-25 16:11:46 | [diff] [blame] | 219 | chromeos_lib_list="libpulse0 libbz2-1.0" |
[email protected] | e041ed1 | 2009-03-10 16:43:01 | [diff] [blame] | 220 | |
| 221 | # Full list of required run-time libraries |
thomasanderson | 20032a5c | 2017-03-02 00:28:20 | [diff] [blame] | 222 | lib_list="\ |
| 223 | libatk1.0-0 |
| 224 | libc6 |
| 225 | libasound2 |
| 226 | libcairo2 |
| 227 | libcap2 |
| 228 | libcups2 |
| 229 | libexpat1 |
| 230 | libffi6 |
| 231 | libfontconfig1 |
| 232 | libfreetype6 |
| 233 | libglib2.0-0 |
| 234 | libgnome-keyring0 |
| 235 | libgtk2.0-0 |
| 236 | libgtk-3-0 |
| 237 | libpam0g |
| 238 | libpango1.0-0 |
| 239 | libpci3 |
| 240 | libpcre3 |
| 241 | libpixman-1-0 |
| 242 | libspeechd2 |
| 243 | libstdc++6 |
| 244 | libsqlite3-0 |
| 245 | libx11-6 |
| 246 | libx11-xcb1 |
| 247 | libxau6 |
| 248 | libxcb1 |
| 249 | libxcomposite1 |
| 250 | libxcursor1 |
| 251 | libxdamage1 |
| 252 | libxdmcp6 |
| 253 | libxext6 |
| 254 | libxfixes3 |
| 255 | libxi6 |
| 256 | libxinerama1 |
| 257 | libxrandr2 |
| 258 | libxrender1 |
| 259 | libxtst6 |
| 260 | zlib1g |
| 261 | $chromeos_lib_list |
| 262 | " |
[email protected] | e041ed1 | 2009-03-10 16:43:01 | [diff] [blame] | 263 | |
| 264 | # Debugging symbols for all of the run-time libraries |
thomasanderson | 20032a5c | 2017-03-02 00:28:20 | [diff] [blame] | 265 | dbg_list="\ |
| 266 | libatk1.0-dbg |
| 267 | libc6-dbg |
| 268 | libcairo2-dbg |
| 269 | libffi6-dbg |
| 270 | libfontconfig1-dbg |
| 271 | libglib2.0-0-dbg |
| 272 | libgtk2.0-0-dbg |
| 273 | libgtk-3-0-dbg |
| 274 | libpango1.0-0-dbg |
| 275 | libpcre3-dbg |
| 276 | libpixman-1-0-dbg |
| 277 | libsqlite3-0-dbg |
| 278 | libx11-6-dbg |
| 279 | libx11-xcb1-dbg |
| 280 | libxau6-dbg |
| 281 | libxcb1-dbg |
| 282 | libxcomposite1-dbg |
| 283 | libxcursor1-dbg |
| 284 | libxdamage1-dbg |
| 285 | libxdmcp6-dbg |
| 286 | libxext6-dbg |
thomasanderson | 20032a5c | 2017-03-02 00:28:20 | [diff] [blame] | 287 | libxi6-dbg |
| 288 | libxinerama1-dbg |
| 289 | libxrandr2-dbg |
| 290 | libxrender1-dbg |
| 291 | libxtst6-dbg |
| 292 | zlib1g-dbg |
| 293 | " |
lfg | ad917d1 | 2015-03-17 23:28:00 | [diff] [blame] | 294 | |
thomasanderson | 05c4029 | 2017-03-28 19:28:45 | [diff] [blame^] | 295 | if [[ ! $lsb_release =~ "yakkety" ]]; then |
| 296 | dbg_list="${dbg_list} libxfixes3-dbg" |
| 297 | fi |
| 298 | |
lfg | ad917d1 | 2015-03-17 23:28:00 | [diff] [blame] | 299 | # Find the proper version of libstdc++6-4.x-dbg. |
thomasanderson | 05c4029 | 2017-03-28 19:28:45 | [diff] [blame^] | 300 | if [ "x$lsb_release" = "xtrusty" ]; then |
lfg | ad917d1 | 2015-03-17 23:28:00 | [diff] [blame] | 301 | dbg_list="${dbg_list} libstdc++6-4.8-dbg" |
| 302 | else |
| 303 | dbg_list="${dbg_list} libstdc++6-4.9-dbg" |
| 304 | fi |
[email protected] | e041ed1 | 2009-03-10 16:43:01 | [diff] [blame] | 305 | |
johnme | 49bb458a | 2014-11-27 15:45:31 | [diff] [blame] | 306 | # 32-bit libraries needed e.g. to compile V8 snapshot for Android or armhf |
| 307 | lib32_list="linux-libc-dev:i386" |
| 308 | |
[email protected] | 3f85dac3 | 2013-10-29 02:38:46 | [diff] [blame] | 309 | # arm cross toolchain packages needed to build chrome on armhf |
thomasanderson | 4e3d30fe | 2016-12-07 18:58:34 | [diff] [blame] | 310 | EM_REPO="deb http://emdebian.org/tools/debian/ jessie main" |
| 311 | EM_SOURCE=$(cat <<EOF |
| 312 | # Repo added by Chromium $0 |
| 313 | ${EM_REPO} |
| 314 | # deb-src http://emdebian.org/tools/debian/ jessie main |
| 315 | EOF |
| 316 | ) |
| 317 | EM_ARCHIVE_KEY_FINGER="084C6C6F39159EDB67969AA87DE089671804772E" |
| 318 | GPP_ARM_PACKAGE="g++-arm-linux-gnueabihf" |
| 319 | case $lsb_release in |
| 320 | "jessie") |
| 321 | eval $(apt-config shell APT_SOURCESDIR 'Dir::Etc::sourceparts/d') |
| 322 | CROSSTOOLS_LIST="${APT_SOURCESDIR}/crosstools.list" |
| 323 | arm_list="libc6-dev:armhf |
| 324 | linux-libc-dev:armhf" |
| 325 | if test "$do_inst_arm" = "1"; then |
| 326 | if $(dpkg-query -W ${GPP_ARM_PACKAGE} &>/dev/null); then |
| 327 | arm_list+=" ${GPP_ARM_PACKAGE}" |
| 328 | else |
| 329 | echo "The Debian Cross-toolchains repository is necessary to" |
| 330 | echo "cross-compile Chromium for arm." |
| 331 | echo -n "Do you want me to add it for you (y/N) " |
| 332 | if yes_no 1; then |
| 333 | gpg --keyserver pgp.mit.edu --recv-keys ${EM_ARCHIVE_KEY_FINGER} |
| 334 | gpg -a --export ${EM_ARCHIVE_KEY_FINGER} | sudo apt-key add - |
| 335 | if ! grep "^${EM_REPO}" "${CROSSTOOLS_LIST}" &>/dev/null; then |
| 336 | echo "${EM_SOURCE}" | sudo tee -a "${CROSSTOOLS_LIST}" >/dev/null |
| 337 | fi |
| 338 | arm_list+=" ${GPP_ARM_PACKAGE}" |
| 339 | fi |
| 340 | fi |
| 341 | fi |
| 342 | ;; |
friedman | 0eef9e4 | 2017-02-22 22:21:22 | [diff] [blame] | 343 | "*") |
kjellander | 74c7e4b | 2017-01-27 13:15:44 | [diff] [blame] | 344 | arm_list="binutils-aarch64-linux-gnu |
| 345 | libc6-dev-armhf-cross |
thomasanderson | 4e3d30fe | 2016-12-07 18:58:34 | [diff] [blame] | 346 | linux-libc-dev-armhf-cross |
| 347 | ${GPP_ARM_PACKAGE}" |
| 348 | ;; |
| 349 | esac |
[email protected] | 31a60553 | 2011-08-23 22:27:35 | [diff] [blame] | 350 | |
sbc | b5d4ded | 2015-04-01 17:49:03 | [diff] [blame] | 351 | # Work around for dependency issue Ubuntu/Trusty: http://crbug.com/435056 |
friedman | bf8b90a | 2016-04-21 01:15:48 | [diff] [blame] | 352 | case $lsb_release in |
| 353 | trusty) |
| 354 | arm_list+=" g++-4.8-multilib-arm-linux-gnueabihf |
| 355 | gcc-4.8-multilib-arm-linux-gnueabihf" |
| 356 | ;; |
thomasanderson | 05c4029 | 2017-03-28 19:28:45 | [diff] [blame^] | 357 | xenial|yakkety) |
krasin | eef3d4b | 2016-04-22 00:52:18 | [diff] [blame] | 358 | arm_list+=" g++-5-multilib-arm-linux-gnueabihf |
| 359 | gcc-5-multilib-arm-linux-gnueabihf |
| 360 | gcc-arm-linux-gnueabihf" |
| 361 | ;; |
friedman | bf8b90a | 2016-04-21 01:15:48 | [diff] [blame] | 362 | esac |
sbc | b5d4ded | 2015-04-01 17:49:03 | [diff] [blame] | 363 | |
[email protected] | 713eac6 | 2014-06-02 23:10:03 | [diff] [blame] | 364 | # Packages to build NaCl, its toolchains, and its ports. |
Brad Nelson | 5e59c2c | 2014-09-06 06:18:45 | [diff] [blame] | 365 | naclports_list="ant autoconf bison cmake gawk intltool xutils-dev xsltproc" |
thomasanderson | 20032a5c | 2017-03-02 00:28:20 | [diff] [blame] | 366 | nacl_list="\ |
| 367 | g++-mingw-w64-i686 |
| 368 | lib32z1-dev |
| 369 | libasound2:i386 |
| 370 | libcap2:i386 |
| 371 | libelf-dev:i386 |
| 372 | libfontconfig1:i386 |
| 373 | libgconf-2-4:i386 |
| 374 | libglib2.0-0:i386 |
| 375 | libgpm2:i386 |
| 376 | libgtk2.0-0:i386 |
| 377 | libgtk-3-0:i386 |
| 378 | libncurses5:i386 |
| 379 | lib32ncurses5-dev |
| 380 | libnss3:i386 |
| 381 | libpango1.0-0:i386 |
| 382 | libssl1.0.0:i386 |
| 383 | libtinfo-dev |
| 384 | libtinfo-dev:i386 |
| 385 | libtool |
| 386 | libxcomposite1:i386 |
| 387 | libxcursor1:i386 |
| 388 | libxdamage1:i386 |
| 389 | libxi6:i386 |
| 390 | libxrandr2:i386 |
| 391 | libxss1:i386 |
| 392 | libxtst6:i386 |
| 393 | texinfo |
| 394 | xvfb |
| 395 | ${naclports_list} |
| 396 | " |
[email protected] | 419a9a6 | 2014-06-19 18:26:18 | [diff] [blame] | 397 | |
torne | 8a6eb69 | 2015-11-05 12:43:08 | [diff] [blame] | 398 | # Find the proper version of packages that depend on mesa. Only one -lts variant |
| 399 | # of mesa can be installed and everything that depends on it must match. |
| 400 | |
| 401 | # Query for the name and status of all mesa LTS variants, filter for only |
| 402 | # installed packages, extract just the name, and eliminate duplicates (there can |
| 403 | # be more than one with the same name in the case of multiarch). Expand into an |
| 404 | # array. |
| 405 | mesa_packages=($(dpkg-query -Wf'${package} ${status}\n' \ |
torne | 12cd9f6c | 2016-02-24 18:52:23 | [diff] [blame] | 406 | libgl1-mesa-glx-lts-\* 2>/dev/null | \ |
torne | 8a6eb69 | 2015-11-05 12:43:08 | [diff] [blame] | 407 | grep " ok installed" | cut -d " " -f 1 | sort -u)) |
| 408 | if [ "${#mesa_packages[@]}" -eq 0 ]; then |
| 409 | mesa_variant="" |
| 410 | elif [ "${#mesa_packages[@]}" -eq 1 ]; then |
| 411 | # Strip the base package name and leave just "-lts-whatever" |
| 412 | mesa_variant="${mesa_packages[0]#libgl1-mesa-glx}" |
| 413 | else |
| 414 | echo "ERROR: unable to determine which libgl1-mesa-glx variant is installed." |
| 415 | exit 1 |
| 416 | fi |
[email protected] | 3a4bd5d | 2014-06-25 23:55:04 | [diff] [blame] | 417 | dev_list="${dev_list} libgbm-dev${mesa_variant} |
vabr | f1e8b17f | 2015-03-17 10:56:37 | [diff] [blame] | 418 | libgles2-mesa-dev${mesa_variant} libgl1-mesa-dev${mesa_variant} |
| 419 | mesa-common-dev${mesa_variant}" |
[email protected] | 419a9a6 | 2014-06-19 18:26:18 | [diff] [blame] | 420 | nacl_list="${nacl_list} libgl1-mesa-glx${mesa_variant}:i386" |
[email protected] | 56541636 | 2014-01-16 21:26:47 | [diff] [blame] | 421 | |
[email protected] | 757c296 | 2012-03-15 19:05:18 | [diff] [blame] | 422 | # Some package names have changed over time |
marcin | 73929a7 | 2017-01-04 22:04:58 | [diff] [blame] | 423 | if package_exists libpng12-0; then |
| 424 | lib_list="${lib_list} libpng12-0" |
| 425 | else |
| 426 | lib_list="${lib_list} libpng16-16" |
| 427 | fi |
[email protected] | 4fc0071 | 2013-05-29 23:11:20 | [diff] [blame] | 428 | if package_exists libnspr4-dbg; then |
[email protected] | 1a0f64a | 2011-05-20 17:53:55 | [diff] [blame] | 429 | dbg_list="${dbg_list} libnspr4-dbg libnss3-dbg" |
| 430 | lib_list="${lib_list} libnspr4 libnss3" |
[email protected] | 757c296 | 2012-03-15 19:05:18 | [diff] [blame] | 431 | else |
| 432 | dbg_list="${dbg_list} libnspr4-0d-dbg libnss3-1d-dbg" |
| 433 | lib_list="${lib_list} libnspr4-0d libnss3-1d" |
| 434 | fi |
[email protected] | 4fc0071 | 2013-05-29 23:11:20 | [diff] [blame] | 435 | if package_exists libjpeg-dev; then |
[email protected] | 9e89596 | 2013-05-21 08:26:42 | [diff] [blame] | 436 | dev_list="${dev_list} libjpeg-dev" |
[email protected] | b11411c | 2012-03-21 22:09:41 | [diff] [blame] | 437 | else |
[email protected] | 9e89596 | 2013-05-21 08:26:42 | [diff] [blame] | 438 | dev_list="${dev_list} libjpeg62-dev" |
[email protected] | b11411c | 2012-03-21 22:09:41 | [diff] [blame] | 439 | fi |
[email protected] | 4fc0071 | 2013-05-29 23:11:20 | [diff] [blame] | 440 | if package_exists libudev1; then |
[email protected] | 9e89596 | 2013-05-21 08:26:42 | [diff] [blame] | 441 | dev_list="${dev_list} libudev1" |
[email protected] | ab9e6908 | 2014-06-05 15:28:52 | [diff] [blame] | 442 | nacl_list="${nacl_list} libudev1:i386" |
[email protected] | 9e89596 | 2013-05-21 08:26:42 | [diff] [blame] | 443 | else |
| 444 | dev_list="${dev_list} libudev0" |
[email protected] | ab9e6908 | 2014-06-05 15:28:52 | [diff] [blame] | 445 | nacl_list="${nacl_list} libudev0:i386" |
[email protected] | 9e89596 | 2013-05-21 08:26:42 | [diff] [blame] | 446 | fi |
[email protected] | 3ea4291 | 2013-09-06 06:23:57 | [diff] [blame] | 447 | if package_exists libbrlapi0.6; then |
| 448 | dev_list="${dev_list} libbrlapi0.6" |
| 449 | else |
| 450 | dev_list="${dev_list} libbrlapi0.5" |
| 451 | fi |
halton.huo | 3e728c4 | 2016-01-20 05:12:23 | [diff] [blame] | 452 | if package_exists apache2-bin; then |
| 453 | dev_list="${dev_list} apache2-bin" |
| 454 | else |
| 455 | dev_list="${dev_list} apache2.2-bin" |
| 456 | fi |
vadimsh | 278ff066 | 2016-05-19 00:06:28 | [diff] [blame] | 457 | if package_exists xfonts-mathml; then |
halton.huo | 3e728c4 | 2016-01-20 05:12:23 | [diff] [blame] | 458 | dev_list="${dev_list} xfonts-mathml" |
| 459 | fi |
krasin | eef3d4b | 2016-04-22 00:52:18 | [diff] [blame] | 460 | if package_exists fonts-indic; then |
vadimsh | 278ff066 | 2016-05-19 00:06:28 | [diff] [blame] | 461 | dev_list="${dev_list} fonts-indic" |
krasin | eef3d4b | 2016-04-22 00:52:18 | [diff] [blame] | 462 | else |
vadimsh | 278ff066 | 2016-05-19 00:06:28 | [diff] [blame] | 463 | dev_list="${dev_list} ttf-indic-fonts" |
krasin | eef3d4b | 2016-04-22 00:52:18 | [diff] [blame] | 464 | fi |
| 465 | if package_exists php7.0-cgi; then |
vadimsh | 278ff066 | 2016-05-19 00:06:28 | [diff] [blame] | 466 | dev_list="${dev_list} php7.0-cgi libapache2-mod-php7.0" |
krasin | eef3d4b | 2016-04-22 00:52:18 | [diff] [blame] | 467 | else |
vadimsh | 278ff066 | 2016-05-19 00:06:28 | [diff] [blame] | 468 | dev_list="${dev_list} php5-cgi libapache2-mod-php5" |
krasin | eef3d4b | 2016-04-22 00:52:18 | [diff] [blame] | 469 | fi |
thomasanderson | b4a2bca | 2016-12-08 06:46:05 | [diff] [blame] | 470 | # ttf-mscorefonts-installer is in the Debian contrib repo, which has |
| 471 | # dependencies on non-free software. Install it only if the user has already |
| 472 | # enabled contrib. |
| 473 | if package_exists ttf-mscorefonts-installer; then |
| 474 | dev_list="${dev_list} ttf-mscorefonts-installer" |
| 475 | elif package_exists msttcorefonts; then |
| 476 | dev_list="${dev_list} msttcorefonts" |
| 477 | fi |
horo | 233d31c | 2016-11-16 03:43:00 | [diff] [blame] | 478 | # Ubuntu 16.04 has this package deleted. |
| 479 | if package_exists ttf-kochi-gothic; then |
| 480 | dev_list="${dev_list} ttf-kochi-gothic" |
| 481 | fi |
| 482 | # Ubuntu 16.04 has this package deleted. |
| 483 | if package_exists ttf-kochi-mincho; then |
| 484 | dev_list="${dev_list} ttf-kochi-mincho" |
| 485 | fi |
[email protected] | 757c296 | 2012-03-15 19:05:18 | [diff] [blame] | 486 | |
[email protected] | dc09977 | 2013-09-30 22:06:58 | [diff] [blame] | 487 | # Some packages are only needed if the distribution actually supports |
[email protected] | 757c296 | 2012-03-15 19:05:18 | [diff] [blame] | 488 | # installing them. |
[email protected] | 4fc0071 | 2013-05-29 23:11:20 | [diff] [blame] | 489 | if package_exists appmenu-gtk; then |
[email protected] | 757c296 | 2012-03-15 19:05:18 | [diff] [blame] | 490 | lib_list="$lib_list appmenu-gtk" |
[email protected] | 4da8fad | 2011-04-11 18:42:42 | [diff] [blame] | 491 | fi |
| 492 | |
johnme | 49bb458a | 2014-11-27 15:45:31 | [diff] [blame] | 493 | # When cross building for arm/Android on 64-bit systems the host binaries |
| 494 | # that are part of v8 need to be compiled with -m32 which means |
| 495 | # that basic multilib support is needed. |
ki.stfu | 0a79d699 | 2015-09-17 07:27:12 | [diff] [blame] | 496 | if file -L /sbin/init | grep -q 'ELF 64-bit'; then |
johnme | 49bb458a | 2014-11-27 15:45:31 | [diff] [blame] | 497 | # gcc-multilib conflicts with the arm cross compiler (at least in trusty) but |
| 498 | # g++-X.Y-multilib gives us the 32-bit support that we need. Find out the |
| 499 | # appropriate value of X and Y by seeing what version the current |
| 500 | # distribution's g++-multilib package depends on. |
| 501 | multilib_package=$(apt-cache depends g++-multilib --important | \ |
| 502 | grep -E --color=never --only-matching '\bg\+\+-[0-9.]+-multilib\b') |
| 503 | lib32_list="$lib32_list $multilib_package" |
| 504 | fi |
| 505 | |
[email protected] | ba48c4ca | 2013-10-25 16:11:46 | [diff] [blame] | 506 | if test "$do_inst_syms" = "" && test 0 -eq ${do_quick_check-0} |
[email protected] | 1eae2bfb | 2010-01-26 18:17:53 | [diff] [blame] | 507 | then |
| 508 | echo "This script installs all tools and libraries needed to build Chromium." |
| 509 | echo "" |
| 510 | echo "For most of the libraries, it can also install debugging symbols, which" |
| 511 | echo "will allow you to debug code in the system libraries. Most developers" |
| 512 | echo "won't need these symbols." |
| 513 | echo -n "Do you want me to install them for you (y/N) " |
| 514 | if yes_no 1; then |
| 515 | do_inst_syms=1 |
| 516 | fi |
| 517 | fi |
| 518 | if test "$do_inst_syms" = "1"; then |
[email protected] | ba48c4ca | 2013-10-25 16:11:46 | [diff] [blame] | 519 | echo "Including debugging symbols." |
[email protected] | 8ada8c5 | 2009-03-10 21:53:08 | [diff] [blame] | 520 | else |
[email protected] | ba48c4ca | 2013-10-25 16:11:46 | [diff] [blame] | 521 | echo "Skipping debugging symbols." |
[email protected] | 8ada8c5 | 2009-03-10 21:53:08 | [diff] [blame] | 522 | dbg_list= |
| 523 | fi |
| 524 | |
johnme | 49bb458a | 2014-11-27 15:45:31 | [diff] [blame] | 525 | if test "$do_inst_lib32" = "1" ; then |
| 526 | echo "Including 32-bit libraries for ARM/Android." |
| 527 | else |
| 528 | echo "Skipping 32-bit libraries for ARM/Android." |
| 529 | lib32_list= |
[email protected] | 9f28a9cf | 2012-12-17 23:31:40 | [diff] [blame] | 530 | fi |
| 531 | |
[email protected] | ba48c4ca | 2013-10-25 16:11:46 | [diff] [blame] | 532 | if test "$do_inst_arm" = "1" ; then |
[email protected] | ba48c4ca | 2013-10-25 16:11:46 | [diff] [blame] | 533 | echo "Including ARM cross toolchain." |
[email protected] | f2826b6a | 2012-11-15 01:06:26 | [diff] [blame] | 534 | else |
[email protected] | ba48c4ca | 2013-10-25 16:11:46 | [diff] [blame] | 535 | echo "Skipping ARM cross toolchain." |
[email protected] | f2826b6a | 2012-11-15 01:06:26 | [diff] [blame] | 536 | arm_list= |
| 537 | fi |
| 538 | |
[email protected] | 56541636 | 2014-01-16 21:26:47 | [diff] [blame] | 539 | if test "$do_inst_nacl" = "1"; then |
[email protected] | 713eac6 | 2014-06-02 23:10:03 | [diff] [blame] | 540 | echo "Including NaCl, NaCl toolchain, NaCl ports dependencies." |
[email protected] | 56541636 | 2014-01-16 21:26:47 | [diff] [blame] | 541 | else |
[email protected] | 713eac6 | 2014-06-02 23:10:03 | [diff] [blame] | 542 | echo "Skipping NaCl, NaCl toolchain, NaCl ports dependencies." |
[email protected] | 56541636 | 2014-01-16 21:26:47 | [diff] [blame] | 543 | nacl_list= |
| 544 | fi |
| 545 | |
johnme | 4bd1030 | 2015-01-06 11:25:52 | [diff] [blame] | 546 | # The `sort -r -s -t: -k2` sorts all the :i386 packages to the front, to avoid |
| 547 | # confusing dpkg-query (crbug.com/446172). |
[email protected] | 56541636 | 2014-01-16 21:26:47 | [diff] [blame] | 548 | packages="$( |
johnme | 49bb458a | 2014-11-27 15:45:31 | [diff] [blame] | 549 | echo "${dev_list} ${lib_list} ${dbg_list} ${lib32_list} ${arm_list}"\ |
johnme | 4bd1030 | 2015-01-06 11:25:52 | [diff] [blame] | 550 | "${nacl_list}" | tr " " "\n" | sort -u | sort -r -s -t: -k2 | tr "\n" " " |
[email protected] | 56541636 | 2014-01-16 21:26:47 | [diff] [blame] | 551 | )" |
[email protected] | ba48c4ca | 2013-10-25 16:11:46 | [diff] [blame] | 552 | |
| 553 | if [ 1 -eq "${do_quick_check-0}" ] ; then |
thomasanderson | 73b3a441 | 2016-11-18 23:16:07 | [diff] [blame] | 554 | if ! missing_packages="$(dpkg-query -W -f ' ' ${packages} 2>&1)"; then |
| 555 | # Distinguish between packages that actually aren't available to the |
| 556 | # system (i.e. not in any repo) and packages that just aren't known to |
| 557 | # dpkg (i.e. managed by apt). |
| 558 | missing_packages="$(echo "${missing_packages}" | awk '{print $NF}')" |
| 559 | not_installed="" |
| 560 | unknown="" |
| 561 | for p in ${missing_packages}; do |
| 562 | if apt-cache show ${p} > /dev/null 2>&1; then |
| 563 | not_installed="${p}\n${not_installed}" |
| 564 | else |
| 565 | unknown="${p}\n${unknown}" |
[email protected] | ba48c4ca | 2013-10-25 16:11:46 | [diff] [blame] | 566 | fi |
thomasanderson | 73b3a441 | 2016-11-18 23:16:07 | [diff] [blame] | 567 | done |
| 568 | if [ -n "${not_installed}" ]; then |
[email protected] | ba48c4ca | 2013-10-25 16:11:46 | [diff] [blame] | 569 | echo "WARNING: The following packages are not installed:" |
thomasanderson | 73b3a441 | 2016-11-18 23:16:07 | [diff] [blame] | 570 | echo -e "${not_installed}" | sed -e "s/^/ /" |
| 571 | fi |
| 572 | if [ -n "${unknown}" ]; then |
| 573 | echo "WARNING: The following packages are unknown to your system" |
| 574 | echo "(maybe missing a repo or need to 'sudo apt-get update'):" |
| 575 | echo -e "${unknown}" | sed -e "s/^/ /" |
[email protected] | ba48c4ca | 2013-10-25 16:11:46 | [diff] [blame] | 576 | fi |
| 577 | exit 1 |
| 578 | fi |
| 579 | exit 0 |
| 580 | fi |
| 581 | |
johnme | 49bb458a | 2014-11-27 15:45:31 | [diff] [blame] | 582 | if test "$do_inst_lib32" = "1" || test "$do_inst_nacl" = "1"; then |
thomasanderson | 05c4029 | 2017-03-28 19:28:45 | [diff] [blame^] | 583 | sudo dpkg --add-architecture i386 |
thomasanderson | 4e3d30fe | 2016-12-07 18:58:34 | [diff] [blame] | 584 | if [[ $lsb_release = "jessie" ]]; then |
| 585 | sudo dpkg --add-architecture armhf |
| 586 | fi |
johnme | 49bb458a | 2014-11-27 15:45:31 | [diff] [blame] | 587 | fi |
sbc | 4256409 | 2015-04-01 01:01:28 | [diff] [blame] | 588 | sudo apt-get update |
[email protected] | e041ed1 | 2009-03-10 16:43:01 | [diff] [blame] | 589 | |
| 590 | # We initially run "apt-get" with the --reinstall option and parse its output. |
| 591 | # This way, we can find all the packages that need to be newly installed |
| 592 | # without accidentally promoting any packages from "auto" to "manual". |
| 593 | # We then re-run "apt-get" with just the list of missing packages. |
| 594 | echo "Finding missing packages..." |
[email protected] | 757c296 | 2012-03-15 19:05:18 | [diff] [blame] | 595 | # Intentionally leaving $packages unquoted so it's more readable. |
[email protected] | b6e06452 | 2009-08-10 18:47:51 | [diff] [blame] | 596 | echo "Packages required: " $packages |
| 597 | echo |
[email protected] | 79a9d296 | 2009-08-06 21:10:58 | [diff] [blame] | 598 | new_list_cmd="sudo apt-get install --reinstall $(echo $packages)" |
[email protected] | c3d8b15 | 2013-05-10 10:10:03 | [diff] [blame] | 599 | if new_list="$(yes n | LANGUAGE=en LANG=C $new_list_cmd)"; then |
[email protected] | b6e06452 | 2009-08-10 18:47:51 | [diff] [blame] | 600 | # We probably never hit this following line. |
thakis | 3e861de | 2016-06-14 14:24:01 | [diff] [blame] | 601 | echo "No missing packages, and the packages are up to date." |
[email protected] | b62f11e7 | 2010-05-03 17:20:45 | [diff] [blame] | 602 | elif [ $? -eq 1 ]; then |
[email protected] | 79a9d296 | 2009-08-06 21:10:58 | [diff] [blame] | 603 | # We expect apt-get to have exit status of 1. |
[email protected] | 757c296 | 2012-03-15 19:05:18 | [diff] [blame] | 604 | # This indicates that we cancelled the install with "yes n|". |
[email protected] | b6e06452 | 2009-08-10 18:47:51 | [diff] [blame] | 605 | new_list=$(echo "$new_list" | |
[email protected] | 79a9d296 | 2009-08-06 21:10:58 | [diff] [blame] | 606 | sed -e '1,/The following NEW packages will be installed:/d;s/^ //;t;d') |
[email protected] | b6e06452 | 2009-08-10 18:47:51 | [diff] [blame] | 607 | new_list=$(echo "$new_list" | sed 's/ *$//') |
| 608 | if [ -z "$new_list" ] ; then |
thakis | 3e861de | 2016-06-14 14:24:01 | [diff] [blame] | 609 | echo "No missing packages, and the packages are up to date." |
[email protected] | b6e06452 | 2009-08-10 18:47:51 | [diff] [blame] | 610 | else |
| 611 | echo "Installing missing packages: $new_list." |
[email protected] | e2544ed4 | 2012-04-23 04:48:31 | [diff] [blame] | 612 | sudo apt-get install ${do_quietly-} ${new_list} |
[email protected] | b6e06452 | 2009-08-10 18:47:51 | [diff] [blame] | 613 | fi |
| 614 | echo |
[email protected] | 79a9d296 | 2009-08-06 21:10:58 | [diff] [blame] | 615 | else |
| 616 | # An apt-get exit status of 100 indicates that a real error has occurred. |
[email protected] | e041ed1 | 2009-03-10 16:43:01 | [diff] [blame] | 617 | |
[email protected] | 79a9d296 | 2009-08-06 21:10:58 | [diff] [blame] | 618 | # I am intentionally leaving out the '"'s around new_list_cmd, |
| 619 | # as this makes it easier to cut and paste the output |
[email protected] | 79a9d296 | 2009-08-06 21:10:58 | [diff] [blame] | 620 | echo "The following command failed: " ${new_list_cmd} |
| 621 | echo |
| 622 | echo "It produces the following output:" |
| 623 | yes n | $new_list_cmd || true |
| 624 | echo |
| 625 | echo "You will have to install the above packages yourself." |
| 626 | echo |
| 627 | exit 100 |
| 628 | fi |
[email protected] | e041ed1 | 2009-03-10 16:43:01 | [diff] [blame] | 629 | |
[email protected] | d96cc347 | 2013-09-19 00:53:30 | [diff] [blame] | 630 | # Install the Chrome OS default fonts. This must go after running |
| 631 | # apt-get, since install-chromeos-fonts depends on curl. |
| 632 | if test "$do_inst_chromeos_fonts" != "0"; then |
| 633 | echo |
| 634 | echo "Installing Chrome OS fonts." |
| 635 | dir=`echo $0 | sed -r -e 's/\/[^/]+$//'` |
| 636 | if ! sudo $dir/linux/install-chromeos-fonts.py; then |
| 637 | echo "ERROR: The installation of the Chrome OS default fonts failed." |
| 638 | if [ `stat -f -c %T $dir` == "nfs" ]; then |
| 639 | echo "The reason is that your repo is installed on a remote file system." |
| 640 | else |
| 641 | echo "This is expected if your repo is installed on a remote file system." |
| 642 | fi |
| 643 | echo "It is recommended to install your repo on a local file system." |
| 644 | echo "You can skip the installation of the Chrome OS default founts with" |
| 645 | echo "the command line option: --no-chromeos-fonts." |
| 646 | exit 1 |
| 647 | fi |
| 648 | else |
| 649 | echo "Skipping installation of Chrome OS fonts." |
| 650 | fi |
| 651 | |
sbc | 6ab44c3 | 2015-02-13 23:19:17 | [diff] [blame] | 652 | # $1 - target name |
| 653 | # $2 - link name |
| 654 | create_library_symlink() { |
| 655 | target=$1 |
| 656 | linkname=$2 |
| 657 | if [ -L $linkname ]; then |
| 658 | if [ "$(basename $(readlink $linkname))" != "$(basename $target)" ]; then |
| 659 | sudo rm $linkname |
| 660 | fi |
| 661 | fi |
| 662 | if [ ! -r $linkname ]; then |
| 663 | echo "Creating link: $linkname" |
| 664 | sudo ln -fs $target $linkname |
| 665 | fi |
| 666 | } |
| 667 | |
[email protected] | 713eac6 | 2014-06-02 23:10:03 | [diff] [blame] | 668 | if test "$do_inst_nacl" = "1"; then |
| 669 | echo "Installing symbolic links for NaCl." |
sbc | 6ab44c3 | 2015-02-13 23:19:17 | [diff] [blame] | 670 | # naclports needs to cross build python for i386, but libssl1.0.0:i386 |
| 671 | # only contains libcrypto.so.1.0.0 and not the symlink needed for |
| 672 | # linking (libcrypto.so). |
| 673 | create_library_symlink /lib/i386-linux-gnu/libcrypto.so.1.0.0 \ |
| 674 | /usr/lib/i386-linux-gnu/libcrypto.so |
| 675 | |
| 676 | create_library_symlink /lib/i386-linux-gnu/libssl.so.1.0.0 \ |
| 677 | /usr/lib/i386-linux-gnu/libssl.so |
[email protected] | 713eac6 | 2014-06-02 23:10:03 | [diff] [blame] | 678 | else |
| 679 | echo "Skipping symbolic links for NaCl." |
| 680 | fi |
thomasanderson | 5ef5c3d | 2016-12-08 01:59:19 | [diff] [blame] | 681 | |
| 682 | echo "Installing locales." |
| 683 | CHROMIUM_LOCALES="da_DK.UTF-8 fr_FR.UTF-8 he_IL.UTF-8 zh_TW.UTF-8" |
| 684 | LOCALE_GEN=/etc/locale.gen |
| 685 | if [ -e ${LOCALE_GEN} ]; then |
| 686 | OLD_LOCALE_GEN="$(cat /etc/locale.gen)" |
| 687 | for CHROMIUM_LOCALE in ${CHROMIUM_LOCALES}; do |
| 688 | sudo sed -i "s/^# ${CHROMIUM_LOCALE}/${CHROMIUM_LOCALE}/" ${LOCALE_GEN} |
| 689 | done |
| 690 | # Regenerating locales can take a while, so only do it if we need to. |
| 691 | if (echo "${OLD_LOCALE_GEN}" | cmp -s ${LOCALE_GEN}); then |
| 692 | echo "Locales already up-to-date." |
| 693 | else |
| 694 | sudo locale-gen |
| 695 | fi |
| 696 | else |
| 697 | for CHROMIUM_LOCALE in ${CHROMIUM_LOCALES}; do |
| 698 | sudo locale-gen ${CHROMIUM_LOCALE} |
| 699 | done |
| 700 | fi |