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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
152 binutils-arm-linux-gnueabi cpp-arm-linux-gnueabi | 157 binutils-arm-linux-gnueabi cpp-arm-linux-gnueabi |
153 gcc-arm-linux-gnueabi g++-arm-linux-gnueabi | 158 gcc-arm-linux-gnueabi g++-arm-linux-gnueabi |
154 libmudflap0-dbg-armel-cross" | 159 libmudflap0-dbg-armel-cross" |
155 | 160 |
156 # TODO(sbc): remove armel once the armhf transition is complete | 161 # TODO(sbc): remove armel once the armhf transition is complete |
157 arm_list="$arm_list $armel_list" | 162 arm_list="$arm_list $armel_list" |
158 | 163 |
159 # Packages to build standalone NaCl and all its toolchains. | 164 # Packages to build standalone NaCl and all its toolchains. |
160 nacl_list="g++-mingw-w64-i686 libtinfo-dev:i386" | 165 nacl_list="g++-mingw-w64-i686 libtinfo-dev:i386" |
161 | 166 |
167 # Packages to build (chromecast) cast shell | |
168 chromecast_list="libdirectfb-dev" | |
rjkroege
2014/04/24 18:49:35
Will making this not installed by default make set
| |
169 | |
162 # Some package names have changed over time | 170 # Some package names have changed over time |
163 if package_exists ttf-mscorefonts-installer; then | 171 if package_exists ttf-mscorefonts-installer; then |
164 dev_list="${dev_list} ttf-mscorefonts-installer" | 172 dev_list="${dev_list} ttf-mscorefonts-installer" |
165 else | 173 else |
166 dev_list="${dev_list} msttcorefonts" | 174 dev_list="${dev_list} msttcorefonts" |
167 fi | 175 fi |
168 if package_exists libnspr4-dbg; then | 176 if package_exists libnspr4-dbg; then |
169 dbg_list="${dbg_list} libnspr4-dbg libnss3-dbg" | 177 dbg_list="${dbg_list} libnspr4-dbg libnss3-dbg" |
170 lib_list="${lib_list} libnspr4 libnss3" | 178 lib_list="${lib_list} libnspr4 libnss3" |
171 else | 179 else |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
267 arm_list= | 275 arm_list= |
268 fi | 276 fi |
269 | 277 |
270 if test "$do_inst_nacl" = "1"; then | 278 if test "$do_inst_nacl" = "1"; then |
271 echo "Including standalone NaCl dependencies." | 279 echo "Including standalone NaCl dependencies." |
272 else | 280 else |
273 echo "Skipping standalone NaCl dependencies." | 281 echo "Skipping standalone NaCl dependencies." |
274 nacl_list= | 282 nacl_list= |
275 fi | 283 fi |
276 | 284 |
285 if test "$do_inst_chromecast" = "1"; then | |
286 echo "Including Chromecast dependencies." | |
287 else | |
288 echo "Skipping Chromecast dependencies." | |
289 chromecast_list= | |
290 fi | |
291 | |
277 packages="$( | 292 packages="$( |
278 echo "${dev_list} ${lib_list} ${dbg_list} ${arm_list} ${nacl_list}" | | 293 echo "${dev_list} ${lib_list} ${dbg_list} ${arm_list} ${nacl_list} ${chromecas t_list}" | |
279 tr " " "\n" | sort -u | tr "\n" " " | 294 tr " " "\n" | sort -u | tr "\n" " " |
280 )" | 295 )" |
281 | 296 |
282 if [ 1 -eq "${do_quick_check-0}" ] ; then | 297 if [ 1 -eq "${do_quick_check-0}" ] ; then |
283 failed_check="$(dpkg-query -W -f '${PackageSpec}:${Status}\n' \ | 298 failed_check="$(dpkg-query -W -f '${PackageSpec}:${Status}\n' \ |
284 ${packages} 2>&1 | grep -v "ok installed" || :)" | 299 ${packages} 2>&1 | grep -v "ok installed" || :)" |
285 if [ -n "${failed_check}" ]; then | 300 if [ -n "${failed_check}" ]; then |
286 echo | 301 echo |
287 nomatch="$(echo "${failed_check}" | \ | 302 nomatch="$(echo "${failed_check}" | \ |
288 sed -e "s/^No packages found matching \(.*\).$/\1/;t;d")" | 303 sed -e "s/^No packages found matching \(.*\).$/\1/;t;d")" |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
584 sed -e 's/[.]so[.][0-9].*/.so/' | | 599 sed -e 's/[.]so[.][0-9].*/.so/' | |
585 sort -u); do | 600 sort -u); do |
586 [ "x${i##*/}" = "xld-linux.so" ] && continue | 601 [ "x${i##*/}" = "xld-linux.so" ] && continue |
587 [ -r "$i" ] && continue | 602 [ -r "$i" ] && continue |
588 j="$(ls "$i."* | sed -e 's/.*[.]so[.]\([^.]*\)$/\1/;t;d' | | 603 j="$(ls "$i."* | sed -e 's/.*[.]so[.]\([^.]*\)$/\1/;t;d' | |
589 sort -n | tail -n 1)" | 604 sort -n | tail -n 1)" |
590 [ -r "$i.$j" ] || continue | 605 [ -r "$i.$j" ] || continue |
591 sudo ln -s "${i##*/}.$j" "$i" | 606 sudo ln -s "${i##*/}.$j" "$i" |
592 done | 607 done |
593 fi | 608 fi |
OLD | NEW |