Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: build/install-build-deps.sh

Issue 740963002: Fix g++-multilib conflict between install-build-deps scripts (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved g++-X.Y-multilib section up closer to lib32_list definition Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | build/install-build-deps-android.sh » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "--lib32: enable installation of 32-bit libraries, e.g. for V8 snapshot"
15 echo "--[no-]arm: enable or disable installation of arm cross toolchain" 16 echo "--[no-]arm: enable or disable installation of arm cross toolchain"
16 echo "--[no-]chromeos-fonts: enable or disable installation of Chrome OS"\ 17 echo "--[no-]chromeos-fonts: enable or disable installation of Chrome OS"\
17 "fonts" 18 "fonts"
18 echo "--[no-]nacl: enable or disable installation of prerequisites for"\ 19 echo "--[no-]nacl: enable or disable installation of prerequisites for"\
19 "building standalone NaCl and all its toolchains" 20 "building standalone NaCl and all its toolchains"
20 echo "--no-prompt: silently select standard options/defaults" 21 echo "--no-prompt: silently select standard options/defaults"
21 echo "--quick-check: quickly try to determine if dependencies are installed" 22 echo "--quick-check: quickly try to determine if dependencies are installed"
22 echo " (this avoids interactive prompts and sudo commands," 23 echo " (this avoids interactive prompts and sudo commands,"
23 echo " so might not be 100% accurate)" 24 echo " so might not be 100% accurate)"
24 echo "--unsupported: attempt installation even on unsupported systems" 25 echo "--unsupported: attempt installation even on unsupported systems"
(...skipping 12 matching lines...) Expand all
37 # mode. Developers who don't want stuff they don't need installed on their 38 # mode. Developers who don't want stuff they don't need installed on their
38 # own workstations can pass --no-arm --no-nacl when running the script. 39 # own workstations can pass --no-arm --no-nacl when running the script.
39 do_inst_arm=1 40 do_inst_arm=1
40 do_inst_nacl=1 41 do_inst_nacl=1
41 42
42 while test "$1" != "" 43 while test "$1" != ""
43 do 44 do
44 case "$1" in 45 case "$1" in
45 --syms) do_inst_syms=1;; 46 --syms) do_inst_syms=1;;
46 --no-syms) do_inst_syms=0;; 47 --no-syms) do_inst_syms=0;;
47 # TODO(phajdan.jr): Remove the lib32 flags when nothing else refers to them.
48 --lib32) do_inst_lib32=1;; 48 --lib32) do_inst_lib32=1;;
49 --no-lib32) do_inst_lib32=0;;
50 --arm) do_inst_arm=1;; 49 --arm) do_inst_arm=1;;
51 --no-arm) do_inst_arm=0;; 50 --no-arm) do_inst_arm=0;;
52 --chromeos-fonts) do_inst_chromeos_fonts=1;; 51 --chromeos-fonts) do_inst_chromeos_fonts=1;;
53 --no-chromeos-fonts) do_inst_chromeos_fonts=0;; 52 --no-chromeos-fonts) do_inst_chromeos_fonts=0;;
54 --nacl) do_inst_nacl=1;; 53 --nacl) do_inst_nacl=1;;
55 --no-nacl) do_inst_nacl=0;; 54 --no-nacl) do_inst_nacl=0;;
56 --no-prompt) do_default=1 55 --no-prompt) do_default=1
57 do_quietly="-qq --assume-yes" 56 do_quietly="-qq --assume-yes"
58 ;; 57 ;;
59 --quick-check) do_quick_check=1;; 58 --quick-check) do_quick_check=1;;
60 --unsupported) do_unsupported=1;; 59 --unsupported) do_unsupported=1;;
61 *) usage;; 60 *) usage;;
62 esac 61 esac
63 shift 62 shift
64 done 63 done
65 64
65 if test "$do_inst_arm" = "1"; then
66 do_inst_lib32=1
67 fi
68
66 # Check for lsb_release command in $PATH 69 # Check for lsb_release command in $PATH
67 if ! which lsb_release > /dev/null; then 70 if ! which lsb_release > /dev/null; then
68 echo "ERROR: lsb_release not found in \$PATH" >&2 71 echo "ERROR: lsb_release not found in \$PATH" >&2
69 exit 1; 72 exit 1;
70 fi 73 fi
71 74
72 lsb_release=$(lsb_release --codename --short) 75 lsb_release=$(lsb_release --codename --short)
73 ubuntu_codenames="(precise|quantal|raring|saucy|trusty)" 76 ubuntu_codenames="(precise|quantal|raring|saucy|trusty)"
74 if [ 0 -eq "${do_unsupported-0}" ] && [ 0 -eq "${do_quick_check-0}" ] ; then 77 if [ 0 -eq "${do_unsupported-0}" ] && [ 0 -eq "${do_quick_check-0}" ] ; then
75 if [[ ! $lsb_release =~ $ubuntu_codenames ]]; then 78 if [[ ! $lsb_release =~ $ubuntu_codenames ]]; then
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 133
131 # Debugging symbols for all of the run-time libraries 134 # Debugging symbols for all of the run-time libraries
132 dbg_list="libatk1.0-dbg libc6-dbg libcairo2-dbg libfontconfig1-dbg 135 dbg_list="libatk1.0-dbg libc6-dbg libcairo2-dbg libfontconfig1-dbg
133 libglib2.0-0-dbg libgtk2.0-0-dbg libpango1.0-0-dbg libpcre3-dbg 136 libglib2.0-0-dbg libgtk2.0-0-dbg libpango1.0-0-dbg libpcre3-dbg
134 libpixman-1-0-dbg libsqlite3-0-dbg libx11-6-dbg libxau6-dbg 137 libpixman-1-0-dbg libsqlite3-0-dbg libx11-6-dbg libxau6-dbg
135 libxcb1-dbg libxcomposite1-dbg libxcursor1-dbg libxdamage1-dbg 138 libxcb1-dbg libxcomposite1-dbg libxcursor1-dbg libxdamage1-dbg
136 libxdmcp6-dbg libxext6-dbg libxfixes3-dbg libxi6-dbg libxinerama1-dbg 139 libxdmcp6-dbg libxext6-dbg libxfixes3-dbg libxi6-dbg libxinerama1-dbg
137 libxrandr2-dbg libxrender1-dbg libxtst6-dbg zlib1g-dbg 140 libxrandr2-dbg libxrender1-dbg libxtst6-dbg zlib1g-dbg
138 libstdc++6-4.6-dbg" 141 libstdc++6-4.6-dbg"
139 142
143 # 32-bit libraries needed e.g. to compile V8 snapshot for Android or armhf
144 lib32_list="linux-libc-dev:i386"
145
140 # arm cross toolchain packages needed to build chrome on armhf 146 # arm cross toolchain packages needed to build chrome on armhf
141 arm_list="libc6-dev-armhf-cross 147 arm_list="libc6-dev-armhf-cross
142 linux-libc-dev-armhf-cross 148 linux-libc-dev-armhf-cross
143 g++-arm-linux-gnueabihf 149 g++-arm-linux-gnueabihf"
144 linux-libc-dev:i386"
145 150
146 # Packages to build NaCl, its toolchains, and its ports. 151 # Packages to build NaCl, its toolchains, and its ports.
147 naclports_list="ant autoconf bison cmake gawk intltool xutils-dev xsltproc" 152 naclports_list="ant autoconf bison cmake gawk intltool xutils-dev xsltproc"
148 nacl_list="g++-mingw-w64-i686 lib32z1-dev 153 nacl_list="g++-mingw-w64-i686 lib32z1-dev
149 libasound2:i386 libcap2:i386 libelf-dev:i386 libexif12:i386 154 libasound2:i386 libcap2:i386 libelf-dev:i386 libexif12:i386
150 libfontconfig1:i386 libgconf-2-4:i386 libglib2.0-0:i386 libgpm2:i386 155 libfontconfig1:i386 libgconf-2-4:i386 libglib2.0-0:i386 libgpm2:i386
151 libgtk2.0-0:i386 libncurses5:i386 lib32ncurses5-dev 156 libgtk2.0-0:i386 libncurses5:i386 lib32ncurses5-dev
152 libnss3:i386 libpango1.0-0:i386 157 libnss3:i386 libpango1.0-0:i386
153 libssl0.9.8:i386 libtinfo-dev libtinfo-dev:i386 libtool 158 libssl0.9.8:i386 libtinfo-dev libtinfo-dev:i386 libtool
154 libxcomposite1:i386 libxcursor1:i386 libxdamage1:i386 libxi6:i386 159 libxcomposite1:i386 libxcursor1:i386 libxdamage1:i386 libxi6:i386
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 dev_list="${dev_list} libbrlapi0.6" 203 dev_list="${dev_list} libbrlapi0.6"
199 else 204 else
200 dev_list="${dev_list} libbrlapi0.5" 205 dev_list="${dev_list} libbrlapi0.5"
201 fi 206 fi
202 207
203 208
204 # Some packages are only needed if the distribution actually supports 209 # Some packages are only needed if the distribution actually supports
205 # installing them. 210 # installing them.
206 if package_exists appmenu-gtk; then 211 if package_exists appmenu-gtk; then
207 lib_list="$lib_list appmenu-gtk" 212 lib_list="$lib_list appmenu-gtk"
213
214 # When cross building for arm/Android on 64-bit systems the host binaries
Sam Clegg 2014/11/26 17:24:22 How about for building 32-bit chrome? Or is that
Primiano Tucci (use gerrit) 2014/11/26 17:27:42 When building for 32-bit chrome this is not suffic
215 # that are part of v8 need to be compiled with -m32 which means
216 # that basic multilib support is needed.
217 if file /sbin/init | grep -q 'ELF 64-bit'; then
218 # gcc-multilib conflicts with the arm cross compiler (at least in trusty) but
219 # g++-X.Y-multilib gives us the 32-bit support that we need. Find out the
220 # appropriate value of X and Y by seeing what version the current
221 # distribution's g++-multilib package depends on.
222 multilib_package=$(apt-cache depends g++-multilib --important | \
223 grep -E --color=never --only-matching '\bg\+\+-[0-9.]+-multilib\b')
224 lib32_list="$lib32_list $multilib_package"
208 fi 225 fi
209 226
210 # Waits for the user to press 'Y' or 'N'. Either uppercase of lowercase is 227 # Waits for the user to press 'Y' or 'N'. Either uppercase of lowercase is
211 # accepted. Returns 0 for 'Y' and 1 for 'N'. If an optional parameter has 228 # accepted. Returns 0 for 'Y' and 1 for 'N'. If an optional parameter has
212 # been provided to yes_no(), the function also accepts RETURN as a user input. 229 # been provided to yes_no(), the function also accepts RETURN as a user input.
213 # The parameter specifies the exit code that should be returned in that case. 230 # The parameter specifies the exit code that should be returned in that case.
214 # The function will echo the user's selection followed by a newline character. 231 # The function will echo the user's selection followed by a newline character.
215 # Users can abort the function by pressing CTRL-C. This will call "exit 1". 232 # Users can abort the function by pressing CTRL-C. This will call "exit 1".
216 yes_no() { 233 yes_no() {
217 if [ 0 -ne "${do_default-0}" ] ; then 234 if [ 0 -ne "${do_default-0}" ] ; then
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 do_inst_syms=1 275 do_inst_syms=1
259 fi 276 fi
260 fi 277 fi
261 if test "$do_inst_syms" = "1"; then 278 if test "$do_inst_syms" = "1"; then
262 echo "Including debugging symbols." 279 echo "Including debugging symbols."
263 else 280 else
264 echo "Skipping debugging symbols." 281 echo "Skipping debugging symbols."
265 dbg_list= 282 dbg_list=
266 fi 283 fi
267 284
268 # When cross building for arm on 64-bit systems the host binaries 285 if test "$do_inst_lib32" = "1" ; then
269 # that are part of v8 need to be compiled with -m32 which means 286 echo "Including 32-bit libraries for ARM/Android."
270 # that basic multilib support is needed. 287 else
271 if file /sbin/init | grep -q 'ELF 64-bit'; then 288 echo "Skipping 32-bit libraries for ARM/Android."
272 if [ "$lsb_release" = "trusty" ]; then 289 lib32_list=
273 # gcc-multilib conflicts with the arm cross compiler in trusty but
274 # g++-4.8-multilib gives us the 32-bit support that we need.
275 arm_list="$arm_list g++-4.8-multilib"
276 else
277 arm_list="$arm_list g++-multilib"
278 fi
279 fi 290 fi
280 291
281 if test "$do_inst_arm" = "1" ; then 292 if test "$do_inst_arm" = "1" ; then
282 echo "Including ARM cross toolchain." 293 echo "Including ARM cross toolchain."
283 else 294 else
284 echo "Skipping ARM cross toolchain." 295 echo "Skipping ARM cross toolchain."
285 arm_list= 296 arm_list=
286 fi 297 fi
287 298
288 if test "$do_inst_nacl" = "1"; then 299 if test "$do_inst_nacl" = "1"; then
289 echo "Including NaCl, NaCl toolchain, NaCl ports dependencies." 300 echo "Including NaCl, NaCl toolchain, NaCl ports dependencies."
290 else 301 else
291 echo "Skipping NaCl, NaCl toolchain, NaCl ports dependencies." 302 echo "Skipping NaCl, NaCl toolchain, NaCl ports dependencies."
292 nacl_list= 303 nacl_list=
293 fi 304 fi
294 305
295 packages="$( 306 packages="$(
296 echo "${dev_list} ${lib_list} ${dbg_list} ${arm_list} ${nacl_list}" | 307 echo "${dev_list} ${lib_list} ${dbg_list} ${lib32_list} ${arm_list}"\
297 tr " " "\n" | sort -u | tr "\n" " " 308 "${nacl_list}" | tr " " "\n" | sort -u | tr "\n" " "
298 )" 309 )"
299 310
300 if [ 1 -eq "${do_quick_check-0}" ] ; then 311 if [ 1 -eq "${do_quick_check-0}" ] ; then
301 failed_check="$(dpkg-query -W -f '${PackageSpec}:${Status}\n' \ 312 failed_check="$(dpkg-query -W -f '${PackageSpec}:${Status}\n' \
302 ${packages} 2>&1 | grep -v "ok installed" || :)" 313 ${packages} 2>&1 | grep -v "ok installed" || :)"
303 if [ -n "${failed_check}" ]; then 314 if [ -n "${failed_check}" ]; then
304 echo 315 echo
305 nomatch="$(echo "${failed_check}" | \ 316 nomatch="$(echo "${failed_check}" | \
306 sed -e "s/^No packages found matching \(.*\).$/\1/;t;d")" 317 sed -e "s/^No packages found matching \(.*\).$/\1/;t;d")"
307 missing="$(echo "${failed_check}" | \ 318 missing="$(echo "${failed_check}" | \
(...skipping 18 matching lines...) Expand all
326 fi 337 fi
327 if [ -n "${missing}" ]; then 338 if [ -n "${missing}" ]; then
328 echo "WARNING: The following packages are not installed:" 339 echo "WARNING: The following packages are not installed:"
329 echo -e "${missing}" | sed -e "s/^/ /" 340 echo -e "${missing}" | sed -e "s/^/ /"
330 fi 341 fi
331 exit 1 342 exit 1
332 fi 343 fi
333 exit 0 344 exit 0
334 fi 345 fi
335 346
347 if test "$do_inst_lib32" = "1" || test "$do_inst_nacl" = "1"; then
348 if [[ ! $lsb_release =~ (precise|quantal|raring) ]]; then
349 sudo dpkg --add-architecture i386
Sam Clegg 2014/11/26 17:24:22 Seems strange to me that we never needed this befo
Primiano Tucci (use gerrit) 2014/11/26 17:27:41 This is needed for the :i386 packages. Before (e.g
350 fi
351 fi
336 sudo apt-get update 352 sudo apt-get update
337 353
338 # We initially run "apt-get" with the --reinstall option and parse its output. 354 # We initially run "apt-get" with the --reinstall option and parse its output.
339 # This way, we can find all the packages that need to be newly installed 355 # This way, we can find all the packages that need to be newly installed
340 # without accidentally promoting any packages from "auto" to "manual". 356 # without accidentally promoting any packages from "auto" to "manual".
341 # We then re-run "apt-get" with just the list of missing packages. 357 # We then re-run "apt-get" with just the list of missing packages.
342 echo "Finding missing packages..." 358 echo "Finding missing packages..."
343 # Intentionally leaving $packages unquoted so it's more readable. 359 # Intentionally leaving $packages unquoted so it's more readable.
344 echo "Packages required: " $packages 360 echo "Packages required: " $packages
345 echo 361 echo
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 echo "Installing symbolic links for NaCl." 417 echo "Installing symbolic links for NaCl."
402 if [ ! -r /usr/lib/i386-linux-gnu/libcrypto.so ]; then 418 if [ ! -r /usr/lib/i386-linux-gnu/libcrypto.so ]; then
403 sudo ln -fs libcrypto.so.0.9.8 /usr/lib/i386-linux-gnu/libcrypto.so 419 sudo ln -fs libcrypto.so.0.9.8 /usr/lib/i386-linux-gnu/libcrypto.so
404 fi 420 fi
405 if [ ! -r /usr/lib/i386-linux-gnu/libssl.so ]; then 421 if [ ! -r /usr/lib/i386-linux-gnu/libssl.so ]; then
406 sudo ln -fs libssl.so.0.9.8 /usr/lib/i386-linux-gnu/libssl.so 422 sudo ln -fs libssl.so.0.9.8 /usr/lib/i386-linux-gnu/libssl.so
407 fi 423 fi
408 else 424 else
409 echo "Skipping symbolic links for NaCl." 425 echo "Skipping symbolic links for NaCl."
410 fi 426 fi
OLDNEW
« no previous file with comments | « no previous file | build/install-build-deps-android.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698