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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
151 else | 151 else |
152 dev_list="${dev_list} libudev0" | 152 dev_list="${dev_list} libudev0" |
153 fi | 153 fi |
154 if package_exists libbrlapi0.6; then | 154 if package_exists libbrlapi0.6; then |
155 dev_list="${dev_list} libbrlapi0.6" | 155 dev_list="${dev_list} libbrlapi0.6" |
156 else | 156 else |
157 dev_list="${dev_list} libbrlapi0.5" | 157 dev_list="${dev_list} libbrlapi0.5" |
158 fi | 158 fi |
159 | 159 |
160 | 160 |
161 # Some packages are only needed, if the distribution actually supports | 161 # Some packages are only needed if the distribution actually supports |
Peter Mayo
2013/09/27 04:48:46
This is just a little readability tweak.
| |
162 # installing them. | 162 # installing them. |
163 if package_exists appmenu-gtk; then | 163 if package_exists appmenu-gtk; then |
164 lib_list="$lib_list appmenu-gtk" | 164 lib_list="$lib_list appmenu-gtk" |
165 fi | 165 fi |
166 | 166 |
167 # Waits for the user to press 'Y' or 'N'. Either uppercase of lowercase is | 167 # Waits for the user to press 'Y' or 'N'. Either uppercase of lowercase is |
168 # accepted. Returns 0 for 'Y' and 1 for 'N'. If an optional parameter has | 168 # accepted. Returns 0 for 'Y' and 1 for 'N'. If an optional parameter has |
169 # been provided to yes_no(), the function also accepts RETURN as a user input. | 169 # been provided to yes_no(), the function also accepts RETURN as a user input. |
170 # The parameter specifies the exit code that should be returned in that case. | 170 # The parameter specifies the exit code that should be returned in that case. |
171 # The function will echo the user's selection followed by a newline character. | 171 # The function will echo the user's selection followed by a newline character. |
172 # Users can abort the function by pressing CTRL-C. This will call "exit 1". | 172 # Users can abort the function by pressing CTRL-C. This will call "exit 1". |
173 yes_no() { | 173 yes_no() { |
174 if [ 0 -ne "${do_default-0}" ] ; then | 174 if [ 0 -ne "${do_default-0}" ] ; then |
175 [ $1 -eq 0 ] && echo "Y" || echo "N" | |
Peter Mayo
2013/09/27 04:48:46
Prompt messages in a log that are unclear how they
| |
175 return $1 | 176 return $1 |
176 fi | 177 fi |
177 local c | 178 local c |
178 while :; do | 179 while :; do |
179 c="$(trap 'stty echo -iuclc icanon 2>/dev/null' EXIT INT TERM QUIT | 180 c="$(trap 'stty echo -iuclc icanon 2>/dev/null' EXIT INT TERM QUIT |
180 stty -echo iuclc -icanon 2>/dev/null | 181 stty -echo iuclc -icanon 2>/dev/null |
181 dd count=1 bs=1 2>/dev/null | od -An -tx1)" | 182 dd count=1 bs=1 2>/dev/null | od -An -tx1)" |
182 case "$c" in | 183 case "$c" in |
183 " 0a") if [ -n "$1" ]; then | 184 " 0a") if [ -n "$1" ]; then |
184 [ $1 -eq 0 ] && echo "Y" || echo "N" | 185 [ $1 -eq 0 ] && echo "Y" || echo "N" |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
322 # this feature is needed. | 323 # this feature is needed. |
323 # We only even give the user the option to install these libraries, if | 324 # We only even give the user the option to install these libraries, if |
324 # they explicitly requested doing so by setting the --lib32 command line | 325 # they explicitly requested doing so by setting the --lib32 command line |
325 # flag. | 326 # flag. |
326 # And even then, we interactively ask them one more time whether they are | 327 # And even then, we interactively ask them one more time whether they are |
327 # absolutely sure. | 328 # absolutely sure. |
328 # In order for that to work, we must reset the ${do_inst_lib32} variable. | 329 # In order for that to work, we must reset the ${do_inst_lib32} variable. |
329 # There are other ways to achieve the same goal. But resetting the | 330 # There are other ways to achieve the same goal. But resetting the |
330 # variable is the best way to document the intended behavior -- and to | 331 # variable is the best way to document the intended behavior -- and to |
331 # allow us to gradually deprecate and then remove the obsolete code. | 332 # allow us to gradually deprecate and then remove the obsolete code. |
332 do_inst_lib32= | 333 if test "${do_default-0}" -ne 1; then |
334 do_inst_lib32= | |
335 fi | |
333 fi | 336 fi |
334 | 337 |
335 echo "WARNING" | 338 echo "WARNING" |
336 echo | 339 echo |
337 echo "We no longer recommend that you use this script to install" | 340 echo "We no longer recommend that you use this script to install" |
338 echo "32bit libraries on a 64bit system. Instead, consider using the" | 341 echo "32bit libraries on a 64bit system. Instead, consider using the" |
339 echo "install-chroot.sh script to help you set up a 32bit environment" | 342 echo "install-chroot.sh script to help you set up a 32bit environment" |
340 echo "for building and testing 32bit versions of Chrome." | 343 echo "for building and testing 32bit versions of Chrome." |
341 echo | 344 echo |
342 echo "The code for installing 32bit libraries on a 64bit system is" | 345 echo "The code for installing 32bit libraries on a 64bit system is" |
343 echo "unmaintained and might not work with modern versions of Ubuntu" | 346 echo "unmaintained and might not work with modern versions of Ubuntu" |
344 echo "or Debian." | 347 echo "or Debian." |
345 echo | 348 if test "$do_inst_lib32" != "" ; then |
346 echo -n "Are you sure you want to proceed (y/N) " | 349 echo |
347 if yes_no 1; then | 350 echo -n "Are you sure you want to proceed (y/N) " |
348 do_inst_lib32=1 | 351 if yes_no 1; then |
352 do_inst_lib32=1 | |
353 fi | |
349 fi | 354 fi |
350 if test "$do_inst_lib32" != "1" | 355 if test "$do_inst_lib32" != "1" |
351 then | 356 then |
352 exit 0 | 357 exit 0 |
353 fi | 358 fi |
354 | 359 |
355 # Standard 32bit compatibility libraries | 360 # Standard 32bit compatibility libraries |
356 echo "First, installing the limited existing 32-bit support..." | 361 echo "First, installing the limited existing 32-bit support..." |
357 cmp_list="ia32-libs lib32asound2-dev lib32stdc++6 lib32z1 | 362 cmp_list="ia32-libs lib32asound2-dev lib32stdc++6 lib32z1 |
358 lib32z1-dev libc6-dev-i386 libc6-i386 g++-multilib" | 363 lib32z1-dev libc6-dev-i386 libc6-i386 g++-multilib" |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
507 sed -e 's/[.]so[.][0-9].*/.so/' | | 512 sed -e 's/[.]so[.][0-9].*/.so/' | |
508 sort -u); do | 513 sort -u); do |
509 [ "x${i##*/}" = "xld-linux.so" ] && continue | 514 [ "x${i##*/}" = "xld-linux.so" ] && continue |
510 [ -r "$i" ] && continue | 515 [ -r "$i" ] && continue |
511 j="$(ls "$i."* | sed -e 's/.*[.]so[.]\([^.]*\)$/\1/;t;d' | | 516 j="$(ls "$i."* | sed -e 's/.*[.]so[.]\([^.]*\)$/\1/;t;d' | |
512 sort -n | tail -n 1)" | 517 sort -n | tail -n 1)" |
513 [ -r "$i.$j" ] || continue | 518 [ -r "$i.$j" ] || continue |
514 sudo ln -s "${i##*/}.$j" "$i" | 519 sudo ln -s "${i##*/}.$j" "$i" |
515 done | 520 done |
516 fi | 521 fi |
OLD | NEW |