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-]arm: enable or disable installation of arm cross toolchain" |
17 echo "--[no-]chromeos-fonts: enable or disable installation of Chrome OS"\ | 17 echo "--[no-]chromeos-fonts: enable or disable installation of Chrome OS"\ |
18 "fonts" | 18 "fonts" |
19 echo "--[no-]nacl: enable or disable installation of prerequisites for"\ | 19 echo "--[no-]nacl: enable or disable installation of prerequisites for"\ |
20 "building standalone NaCl and all its toolchains" | 20 "building standalone NaCl and all its toolchains" |
21 echo "--[no-]chromecast: enable or disable installation of prerequisites for"\ | |
22 "building cast shell" | |
21 echo "--no-prompt: silently select standard options/defaults" | 23 echo "--no-prompt: silently select standard options/defaults" |
22 echo "--quick-check: quickly try to determine if dependencies are installed" | 24 echo "--quick-check: quickly try to determine if dependencies are installed" |
23 echo " (this avoids interactive prompts and sudo commands," | 25 echo " (this avoids interactive prompts and sudo commands," |
24 echo " so might not be 100% accurate)" | 26 echo " so might not be 100% accurate)" |
25 echo "--unsupported: attempt installation even on unsupported systems" | 27 echo "--unsupported: attempt installation even on unsupported systems" |
26 echo "Script will prompt interactively if options not given." | 28 echo "Script will prompt interactively if options not given." |
27 exit 1 | 29 exit 1 |
28 } | 30 } |
29 | 31 |
30 # Checks whether a particular package is available in the repos. | 32 # Checks whether a particular package is available in the repos. |
31 # USAGE: $ package_exists <package name> | 33 # USAGE: $ package_exists <package name> |
32 package_exists() { | 34 package_exists() { |
33 apt-cache pkgnames | grep -x "$1" > /dev/null 2>&1 | 35 apt-cache pkgnames | grep -x "$1" > /dev/null 2>&1 |
34 } | 36 } |
35 | 37 |
36 # These default to on because (some) bots need them and it keeps things | 38 # These default to on because (some) bots need them and it keeps things |
37 # simple for the bot setup if all bots just run the script in its default | 39 # simple for the bot setup if all bots just run the script in its default |
38 # mode. Developers who don't want stuff they don't need installed on their | 40 # mode. Developers who don't want stuff they don't need installed on their |
39 # own workstations can pass --no-arm --no-nacl when running the script. | 41 # own workstations can pass --no-arm --no-nacl when running the script. |
40 do_inst_arm=1 | 42 do_inst_arm=1 |
41 do_inst_nacl=1 | 43 do_inst_nacl=1 |
44 do_inst_chromecast=1 | |
42 | 45 |
43 while test "$1" != "" | 46 while test "$1" != "" |
44 do | 47 do |
45 case "$1" in | 48 case "$1" in |
46 --syms) do_inst_syms=1;; | 49 --syms) do_inst_syms=1;; |
47 --no-syms) do_inst_syms=0;; | 50 --no-syms) do_inst_syms=0;; |
48 --lib32) do_inst_lib32=1;; | 51 --lib32) do_inst_lib32=1;; |
49 --no-lib32) do_inst_lib32=0;; | 52 --no-lib32) do_inst_lib32=0;; |
50 --arm) do_inst_arm=1;; | 53 --arm) do_inst_arm=1;; |
51 --no-arm) do_inst_arm=0;; | 54 --no-arm) do_inst_arm=0;; |
52 --chromeos-fonts) do_inst_chromeos_fonts=1;; | 55 --chromeos-fonts) do_inst_chromeos_fonts=1;; |
53 --no-chromeos-fonts) do_inst_chromeos_fonts=0;; | 56 --no-chromeos-fonts) do_inst_chromeos_fonts=0;; |
54 --nacl) do_inst_nacl=1;; | 57 --nacl) do_inst_nacl=1;; |
55 --no-nacl) do_inst_nacl=0;; | 58 --no-nacl) do_inst_nacl=0;; |
59 --chromecast) do_inst_chromecast=1;; | |
60 --no-chromecast) do_inst_chromecast=0;; | |
56 --no-prompt) do_default=1 | 61 --no-prompt) do_default=1 |
57 do_quietly="-qq --assume-yes" | 62 do_quietly="-qq --assume-yes" |
58 ;; | 63 ;; |
59 --quick-check) do_quick_check=1;; | 64 --quick-check) do_quick_check=1;; |
60 --unsupported) do_unsupported=1;; | 65 --unsupported) do_unsupported=1;; |
61 *) usage;; | 66 *) usage;; |
62 esac | 67 esac |
63 shift | 68 shift |
64 done | 69 done |
65 | 70 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
157 mesa_variant="" | 162 mesa_variant="" |
158 for variant in "-lts-quantal" "-lts-raring" "-lts-saucy"; do | 163 for variant in "-lts-quantal" "-lts-raring" "-lts-saucy"; do |
159 if $(dpkg-query -Wf'${Status}' libgl1-mesa-glx${variant} | \ | 164 if $(dpkg-query -Wf'${Status}' libgl1-mesa-glx${variant} | \ |
160 grep -q " ok installed"); then | 165 grep -q " ok installed"); then |
161 mesa_variant="${variant}" | 166 mesa_variant="${variant}" |
162 fi | 167 fi |
163 done | 168 done |
164 dev_list="${dev_list} libgbm-dev${mesa_variant}" | 169 dev_list="${dev_list} libgbm-dev${mesa_variant}" |
165 nacl_list="${nacl_list} libgl1-mesa-glx${mesa_variant}:i386" | 170 nacl_list="${nacl_list} libgl1-mesa-glx${mesa_variant}:i386" |
166 | 171 |
172 # Packages needed to build (chromecast) cast shell | |
173 chromecast_list="libgles2-mesa-dev" | |
rjkroege
2014/06/25 16:44:16
i think dnicoara landed a change already to arrang
spang
2014/06/25 19:55:46
No that was gbm.
I think this can go in the main
lcwu1
2014/06/25 22:41:02
Michael has a CL to add libgles2-mesa-dev, I will
| |
174 | |
167 # Some package names have changed over time | 175 # Some package names have changed over time |
168 if package_exists ttf-mscorefonts-installer; then | 176 if package_exists ttf-mscorefonts-installer; then |
169 dev_list="${dev_list} ttf-mscorefonts-installer" | 177 dev_list="${dev_list} ttf-mscorefonts-installer" |
170 else | 178 else |
171 dev_list="${dev_list} msttcorefonts" | 179 dev_list="${dev_list} msttcorefonts" |
172 fi | 180 fi |
173 if package_exists libnspr4-dbg; then | 181 if package_exists libnspr4-dbg; then |
174 dbg_list="${dbg_list} libnspr4-dbg libnss3-dbg" | 182 dbg_list="${dbg_list} libnspr4-dbg libnss3-dbg" |
175 lib_list="${lib_list} libnspr4 libnss3" | 183 lib_list="${lib_list} libnspr4 libnss3" |
176 else | 184 else |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
280 arm_list= | 288 arm_list= |
281 fi | 289 fi |
282 | 290 |
283 if test "$do_inst_nacl" = "1"; then | 291 if test "$do_inst_nacl" = "1"; then |
284 echo "Including NaCl, NaCl toolchain, NaCl ports dependencies." | 292 echo "Including NaCl, NaCl toolchain, NaCl ports dependencies." |
285 else | 293 else |
286 echo "Skipping NaCl, NaCl toolchain, NaCl ports dependencies." | 294 echo "Skipping NaCl, NaCl toolchain, NaCl ports dependencies." |
287 nacl_list= | 295 nacl_list= |
288 fi | 296 fi |
289 | 297 |
298 if test "$do_inst_chromecast" = "1"; then | |
299 echo "Including Chromecast dependencies." | |
300 else | |
301 echo "Skipping Chromecast dependencies." | |
302 chromecast_list= | |
303 fi | |
304 | |
290 packages="$( | 305 packages="$( |
291 echo "${dev_list} ${lib_list} ${dbg_list} ${arm_list} ${nacl_list}" | | 306 echo "${dev_list} ${lib_list} ${dbg_list} ${arm_list} ${nacl_list} ${chromecas t_list}" | |
292 tr " " "\n" | sort -u | tr "\n" " " | 307 tr " " "\n" | sort -u | tr "\n" " " |
293 )" | 308 )" |
294 | 309 |
295 if [ 1 -eq "${do_quick_check-0}" ] ; then | 310 if [ 1 -eq "${do_quick_check-0}" ] ; then |
296 failed_check="$(dpkg-query -W -f '${PackageSpec}:${Status}\n' \ | 311 failed_check="$(dpkg-query -W -f '${PackageSpec}:${Status}\n' \ |
297 ${packages} 2>&1 | grep -v "ok installed" || :)" | 312 ${packages} 2>&1 | grep -v "ok installed" || :)" |
298 if [ -n "${failed_check}" ]; then | 313 if [ -n "${failed_check}" ]; then |
299 echo | 314 echo |
300 nomatch="$(echo "${failed_check}" | \ | 315 nomatch="$(echo "${failed_check}" | \ |
301 sed -e "s/^No packages found matching \(.*\).$/\1/;t;d")" | 316 sed -e "s/^No packages found matching \(.*\).$/\1/;t;d")" |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
609 sed -e 's/[.]so[.][0-9].*/.so/' | | 624 sed -e 's/[.]so[.][0-9].*/.so/' | |
610 sort -u); do | 625 sort -u); do |
611 [ "x${i##*/}" = "xld-linux.so" ] && continue | 626 [ "x${i##*/}" = "xld-linux.so" ] && continue |
612 [ -r "$i" ] && continue | 627 [ -r "$i" ] && continue |
613 j="$(ls "$i."* | sed -e 's/.*[.]so[.]\([^.]*\)$/\1/;t;d' | | 628 j="$(ls "$i."* | sed -e 's/.*[.]so[.]\([^.]*\)$/\1/;t;d' | |
614 sort -n | tail -n 1)" | 629 sort -n | tail -n 1)" |
615 [ -r "$i.$j" ] || continue | 630 [ -r "$i.$j" ] || continue |
616 sudo ln -s "${i##*/}.$j" "$i" | 631 sudo ln -s "${i##*/}.$j" "$i" |
617 done | 632 done |
618 fi | 633 fi |
OLD | NEW |