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 https://chromium.googlesource.com/chromium/src/+/master/docs/linux_build_i
nstructions.md | 8 # See https://chromium.googlesource.com/chromium/src/+/master/docs/linux_build_i
nstructions.md |
9 | 9 |
10 usage() { | 10 usage() { |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 # any incorrect user input, alert the user by ringing the bell. | 61 # any incorrect user input, alert the user by ringing the bell. |
62 (tput bel) 2>/dev/null | 62 (tput bel) 2>/dev/null |
63 ;; | 63 ;; |
64 esac | 64 esac |
65 done | 65 done |
66 } | 66 } |
67 | 67 |
68 # Checks whether a particular package is available in the repos. | 68 # Checks whether a particular package is available in the repos. |
69 # USAGE: $ package_exists <package name> | 69 # USAGE: $ package_exists <package name> |
70 package_exists() { | 70 package_exists() { |
71 apt-cache pkgnames | grep -x "$1" > /dev/null 2>&1 | 71 [ ! -z "`apt-cache search --names-only "$1"`" ] |
72 } | 72 } |
73 | 73 |
74 # These default to on because (some) bots need them and it keeps things | 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 | 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 | 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. | 77 # own workstations can pass --no-arm --no-nacl when running the script. |
78 do_inst_arm=1 | 78 do_inst_arm=1 |
79 do_inst_nacl=1 | 79 do_inst_nacl=1 |
80 | 80 |
81 while test "$1" != "" | 81 while test "$1" != "" |
(...skipping 22 matching lines...) Expand all Loading... |
104 do_inst_lib32=1 | 104 do_inst_lib32=1 |
105 fi | 105 fi |
106 | 106 |
107 # Check for lsb_release command in $PATH | 107 # Check for lsb_release command in $PATH |
108 if ! which lsb_release > /dev/null; then | 108 if ! which lsb_release > /dev/null; then |
109 echo "ERROR: lsb_release not found in \$PATH" >&2 | 109 echo "ERROR: lsb_release not found in \$PATH" >&2 |
110 exit 1; | 110 exit 1; |
111 fi | 111 fi |
112 | 112 |
113 lsb_release=$(lsb_release --codename --short) | 113 lsb_release=$(lsb_release --codename --short) |
114 ubuntu_codenames="(precise|trusty|utopic|vivid|wily|xenial)" | 114 supported_releases="(precise|trusty|utopic|vivid|wily|xenial|jessie)" |
115 if [ 0 -eq "${do_unsupported-0}" ] && [ 0 -eq "${do_quick_check-0}" ] ; then | 115 if [ 0 -eq "${do_unsupported-0}" ] && [ 0 -eq "${do_quick_check-0}" ] ; then |
116 if [[ ! $lsb_release =~ $ubuntu_codenames ]]; then | 116 if [[ ! $lsb_release =~ $supported_releases ]]; then |
117 echo "ERROR: Only Ubuntu 12.04 (precise), 14.04 (trusty), " \ | 117 echo "ERROR: Only Ubuntu 12.04 (precise), 14.04 (trusty), " \ |
118 "14.10 (utopic), 15.04 (vivid), 15.10 (wily) and 16.04 (xenial) " \ | 118 "14.10 (utopic), 15.04 (vivid), 15.10 (wily) and 16.04 (xenial), " \ |
119 "are currently supported" >&2 | 119 "and Debian 8 (jessie) are currently supported" >&2 |
120 exit 1 | 120 exit 1 |
121 fi | 121 fi |
122 | 122 |
123 if ! uname -m | egrep -q "i686|x86_64"; then | 123 if ! uname -m | egrep -q "i686|x86_64"; then |
124 echo "Only x86 architectures are currently supported" >&2 | 124 echo "Only x86 architectures are currently supported" >&2 |
125 exit | 125 exit |
126 fi | 126 fi |
127 fi | 127 fi |
128 | 128 |
129 if [ "x$(id -u)" != x0 ] && [ 0 -eq "${do_quick_check-0}" ]; then | 129 if [ "x$(id -u)" != x0 ] && [ 0 -eq "${do_quick_check-0}" ]; then |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 else | 277 else |
278 echo "ERROR: unable to determine which libgl1-mesa-glx variant is installed." | 278 echo "ERROR: unable to determine which libgl1-mesa-glx variant is installed." |
279 exit 1 | 279 exit 1 |
280 fi | 280 fi |
281 dev_list="${dev_list} libgbm-dev${mesa_variant} | 281 dev_list="${dev_list} libgbm-dev${mesa_variant} |
282 libgles2-mesa-dev${mesa_variant} libgl1-mesa-dev${mesa_variant} | 282 libgles2-mesa-dev${mesa_variant} libgl1-mesa-dev${mesa_variant} |
283 mesa-common-dev${mesa_variant}" | 283 mesa-common-dev${mesa_variant}" |
284 nacl_list="${nacl_list} libgl1-mesa-glx${mesa_variant}:i386" | 284 nacl_list="${nacl_list} libgl1-mesa-glx${mesa_variant}:i386" |
285 | 285 |
286 # Some package names have changed over time | 286 # Some package names have changed over time |
287 if package_exists ttf-mscorefonts-installer; then | |
288 dev_list="${dev_list} ttf-mscorefonts-installer" | |
289 else | |
290 dev_list="${dev_list} msttcorefonts" | |
291 fi | |
292 if package_exists libnspr4-dbg; then | 287 if package_exists libnspr4-dbg; then |
293 dbg_list="${dbg_list} libnspr4-dbg libnss3-dbg" | 288 dbg_list="${dbg_list} libnspr4-dbg libnss3-dbg" |
294 lib_list="${lib_list} libnspr4 libnss3" | 289 lib_list="${lib_list} libnspr4 libnss3" |
295 else | 290 else |
296 dbg_list="${dbg_list} libnspr4-0d-dbg libnss3-1d-dbg" | 291 dbg_list="${dbg_list} libnspr4-0d-dbg libnss3-1d-dbg" |
297 lib_list="${lib_list} libnspr4-0d libnss3-1d" | 292 lib_list="${lib_list} libnspr4-0d libnss3-1d" |
298 fi | 293 fi |
299 if package_exists libjpeg-dev; then | 294 if package_exists libjpeg-dev; then |
300 dev_list="${dev_list} libjpeg-dev" | 295 dev_list="${dev_list} libjpeg-dev" |
301 else | 296 else |
(...skipping 22 matching lines...) Expand all Loading... |
324 if package_exists fonts-indic; then | 319 if package_exists fonts-indic; then |
325 dev_list="${dev_list} fonts-indic" | 320 dev_list="${dev_list} fonts-indic" |
326 else | 321 else |
327 dev_list="${dev_list} ttf-indic-fonts" | 322 dev_list="${dev_list} ttf-indic-fonts" |
328 fi | 323 fi |
329 if package_exists php7.0-cgi; then | 324 if package_exists php7.0-cgi; then |
330 dev_list="${dev_list} php7.0-cgi libapache2-mod-php7.0" | 325 dev_list="${dev_list} php7.0-cgi libapache2-mod-php7.0" |
331 else | 326 else |
332 dev_list="${dev_list} php5-cgi libapache2-mod-php5" | 327 dev_list="${dev_list} php5-cgi libapache2-mod-php5" |
333 fi | 328 fi |
| 329 # ttf-mscorefonts-installer is in the Debian contrib repo, which has |
| 330 # dependencies on non-free software. Install it only if the user has already |
| 331 # enabled contrib. |
| 332 if package_exists ttf-mscorefonts-installer; then |
| 333 dev_list="${dev_list} ttf-mscorefonts-installer" |
| 334 elif package_exists msttcorefonts; then |
| 335 dev_list="${dev_list} msttcorefonts" |
| 336 fi |
334 # Ubuntu 16.04 has this package deleted. | 337 # Ubuntu 16.04 has this package deleted. |
335 if package_exists ttf-kochi-gothic; then | 338 if package_exists ttf-kochi-gothic; then |
336 dev_list="${dev_list} ttf-kochi-gothic" | 339 dev_list="${dev_list} ttf-kochi-gothic" |
337 fi | 340 fi |
338 # Ubuntu 16.04 has this package deleted. | 341 # Ubuntu 16.04 has this package deleted. |
339 if package_exists ttf-kochi-mincho; then | 342 if package_exists ttf-kochi-mincho; then |
340 dev_list="${dev_list} ttf-kochi-mincho" | 343 dev_list="${dev_list} ttf-kochi-mincho" |
341 fi | 344 fi |
342 | 345 |
343 # Some packages are only needed if the distribution actually supports | 346 # Some packages are only needed if the distribution actually supports |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
549 if (echo "${OLD_LOCALE_GEN}" | cmp -s ${LOCALE_GEN}); then | 552 if (echo "${OLD_LOCALE_GEN}" | cmp -s ${LOCALE_GEN}); then |
550 echo "Locales already up-to-date." | 553 echo "Locales already up-to-date." |
551 else | 554 else |
552 sudo locale-gen | 555 sudo locale-gen |
553 fi | 556 fi |
554 else | 557 else |
555 for CHROMIUM_LOCALE in ${CHROMIUM_LOCALES}; do | 558 for CHROMIUM_LOCALE in ${CHROMIUM_LOCALES}; do |
556 sudo locale-gen ${CHROMIUM_LOCALE} | 559 sudo locale-gen ${CHROMIUM_LOCALE} |
557 done | 560 done |
558 fi | 561 fi |
OLD | NEW |