OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 | 2 |
3 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2009 The Chromium OS 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 # Load common constants. This should be the first executable line. | 7 # Load common constants. This should be the first executable line. |
8 # The path to common.sh should be relative to your script's location. | 8 # The path to common.sh should be relative to your script's location. |
9 . "$(dirname "$0")/common.sh" | 9 . "$(dirname "$0")/common.sh" |
10 | 10 |
11 assert_inside_chroot | 11 assert_inside_chroot |
12 assert_not_root_user | 12 assert_not_root_user |
13 | 13 |
14 # Flags | 14 # Flags |
15 DEFINE_boolean stable $FLAGS_FALSE "Build with stable version of browser." | 15 DEFINE_boolean stable $FLAGS_FALSE "Build with stable version of browser." |
| 16 DEFINE_boolean new_build $FLAGS_FALSE "Use chromiumos-build." |
| 17 DEFINE_string architecture i386 "The architecture to build for (--new_build only
)." a |
16 | 18 |
17 # Parse command line | 19 # Fix up the command line and parse with shflags. |
18 FLAGS "$@" || exit 1 | 20 FIXED_FLAGS="$@" |
| 21 FIXED_FLAGS=${FIXED_FLAGS/new-build/new_build} |
| 22 FLAGS $FIXED_FLAGS || exit 1 |
19 eval set -- "${FLAGS_ARGV}" | 23 eval set -- "${FLAGS_ARGV}" |
20 | 24 |
21 # Die on error | 25 # Die on error |
22 set -e | 26 set -e |
23 | 27 |
24 # Number of jobs for scons calls. | 28 # Number of jobs for scons calls. |
25 NUM_JOBS=`grep -c "^processor" /proc/cpuinfo` | 29 NUM_JOBS=`grep -c "^processor" /proc/cpuinfo` |
26 | 30 |
27 PLATFORM_DIR="$SRC_ROOT/platform" | 31 PLATFORM_DIR="$SRC_ROOT/platform" |
28 | 32 |
(...skipping 11 matching lines...) Expand all Loading... |
40 wpa_supplicant \ | 44 wpa_supplicant \ |
41 xscreensaver/xscreensaver-5.08 xserver-xorg-core \ | 45 xscreensaver/xscreensaver-5.08 xserver-xorg-core \ |
42 xserver-xorg-video-intel" | 46 xserver-xorg-video-intel" |
43 | 47 |
44 if [ $FLAGS_stable -eq $FLAGS_TRUE ] | 48 if [ $FLAGS_stable -eq $FLAGS_TRUE ] |
45 then | 49 then |
46 # Passed to copy_chrome_zip.sh to get stable version of the browser | 50 # Passed to copy_chrome_zip.sh to get stable version of the browser |
47 export GET_STABLE_CHROME=1 | 51 export GET_STABLE_CHROME=1 |
48 fi | 52 fi |
49 | 53 |
50 # Build dh-chromeos really first. Some of third_party needs it. | 54 if [ $FLAGS_new_build -eq $FLAGS_TRUE ]; then |
51 echo "Building package dh-chromeos..." | 55 # chromiumos-build works out the build order for itself. |
52 cd "$PLATFORM_DIR/dh-chromeos" | 56 PACKAGES='dh-chromeos libchrome libchromeos' |
53 ./make_pkg.sh | 57 for PKG in $PLATFORM_DIRS $THIRD_PARTY_PACKAGES; do |
54 cd - | 58 PACKAGES="$PACKAGES ${PKG%/*}" |
55 | 59 done |
56 # Build third_party packages first, since packages and libs depend on them. | 60 echo chromiumos-build -a "$FLAGS_architecture" --apt-source $PACKAGES |
57 for i in $THIRD_PARTY_PACKAGES | 61 chromiumos-build -a "$FLAGS_architecture" --apt-source $PACKAGES |
58 do | 62 else |
59 echo "Building package ${i}..." | 63 # Build dh-chromeos really first. Some of third_party needs it. |
60 cd "$THIRD_PARTY_DIR/$i" | 64 echo "Building package dh-chromeos..." |
| 65 cd "$PLATFORM_DIR/dh-chromeos" |
61 ./make_pkg.sh | 66 ./make_pkg.sh |
62 cd - | 67 cd - |
63 done | |
64 | 68 |
65 # Build base lib next, since packages depend on it. | 69 # Build third_party packages first, since packages and libs depend on them. |
66 echo "Building base library..." | 70 for i in $THIRD_PARTY_PACKAGES |
67 cd "$THIRD_PARTY_DIR/chrome" | 71 do |
68 ./make_pkg.sh | 72 echo "Building package ${i}..." |
69 cd - | 73 cd "$THIRD_PARTY_DIR/$i" |
| 74 ./make_pkg.sh |
| 75 cd - |
| 76 done |
70 | 77 |
71 #Build common lib next. | 78 # Build base lib next, since packages depend on it. |
72 echo "Building common library..." | 79 echo "Building base library..." |
73 cd "$SRC_ROOT/common" | 80 cd "$THIRD_PARTY_DIR/chrome" |
74 ./make_pkg.sh | |
75 cd - | |
76 | |
77 # Build platform packages | |
78 for i in $PLATFORM_DIRS | |
79 do | |
80 echo "Building package ${i}..." | |
81 cd "$PLATFORM_DIR/$i" | |
82 ./make_pkg.sh | 81 ./make_pkg.sh |
83 cd - | 82 cd - |
84 done | 83 |
| 84 #Build common lib next. |
| 85 echo "Building common library..." |
| 86 cd "$SRC_ROOT/common" |
| 87 ./make_pkg.sh |
| 88 cd - |
| 89 |
| 90 # Build platform packages |
| 91 for i in $PLATFORM_DIRS |
| 92 do |
| 93 echo "Building package ${i}..." |
| 94 cd "$PLATFORM_DIR/$i" |
| 95 ./make_pkg.sh |
| 96 cd - |
| 97 done |
| 98 fi |
85 | 99 |
86 echo "All packages built." | 100 echo "All packages built." |
OLD | NEW |