OLD | NEW |
| (Empty) |
1 #!/bin/bash | |
2 | |
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 | |
5 # found in the LICENSE file. | |
6 | |
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. | |
9 . "$(dirname "$0")/common.sh" | |
10 | |
11 verbose() { | |
12 echo "$@" | |
13 "$@" | |
14 } | |
15 | |
16 assert_inside_chroot | |
17 assert_not_root_user | |
18 | |
19 # Flags | |
20 DEFINE_boolean stable $FLAGS_FALSE "Build with stable version of browser." | |
21 DEFINE_boolean new_build $FLAGS_FALSE "Use chromiumos-build." | |
22 DEFINE_string architecture i386 "The architecture to build for (--new_build only
)." a | |
23 | |
24 # Fix up the command line and parse with shflags. | |
25 FIXED_FLAGS="$@" | |
26 FIXED_FLAGS=${FIXED_FLAGS/new-build/new_build} | |
27 FLAGS $FIXED_FLAGS || exit 1 | |
28 eval set -- "${FLAGS_ARGV}" | |
29 | |
30 # Die on error | |
31 set -e | |
32 | |
33 # Number of jobs for scons calls. | |
34 NUM_JOBS=`grep -c "^processor" /proc/cpuinfo` | |
35 | |
36 PLATFORM_DIR="$SRC_ROOT/platform" | |
37 | |
38 PLATFORM_DIRS="acpi assets fake_hal init installer login_manager \ | |
39 memento_softwareupdate pam_google pam_offline window_manager \ | |
40 cros chrome screenlocker cryptohome \ | |
41 monitor_reconfig microbenchmark minijail metrics_collection \ | |
42 theme metrics_daemon" | |
43 | |
44 THIRD_PARTY_DIR="$SRC_ROOT/third_party" | |
45 THIRD_PARTY_PACKAGES="e2fsprogs/files flimflam \ | |
46 gflags google-breakpad gpt gtest gmock \ | |
47 ibus ibus-chewing ibus-anthy ibus-hangul ibus-m17n \ | |
48 ply-image slim/src synaptics \ | |
49 upstart/files wpa_supplicant \ | |
50 xscreensaver/xscreensaver-5.08 xserver-xorg-core \ | |
51 xserver-xorg-video-intel" | |
52 | |
53 if [ $FLAGS_stable -eq $FLAGS_TRUE ] | |
54 then | |
55 # Passed to copy_chrome_zip.sh to get stable version of the browser | |
56 export GET_STABLE_CHROME=1 | |
57 fi | |
58 | |
59 if [ $FLAGS_new_build -eq $FLAGS_TRUE ]; then | |
60 # chromiumos-build works out the build order for itself. | |
61 PACKAGES='dh-chromeos libchrome libchromeos' | |
62 for PKG in $PLATFORM_DIRS $THIRD_PARTY_PACKAGES; do | |
63 # Handle some special-case naming. | |
64 case $PKG in | |
65 e2fsprogs/files) | |
66 PACKAGES="$PACKAGES e4fsprogs-git" | |
67 ;; | |
68 ibus-anthy|ibus-chewing|ibus-hangul) | |
69 # These are difficult to cross-build right now, and we can live | |
70 # without them temporarily. | |
71 if [ "$FLAGS_architecture" = i386 ]; then | |
72 PACKAGES="$PACKAGES ${PKG%/*}" | |
73 else | |
74 echo "WARNING: Skipping $PKG on $FLAGS_architecture" | |
75 fi | |
76 ;; | |
77 *) | |
78 PACKAGES="$PACKAGES ${PKG%/*}" | |
79 ;; | |
80 esac | |
81 done | |
82 verbose chromiumos-build -a "$FLAGS_architecture" --apt-source $PACKAGES | |
83 else | |
84 # Build dh-chromeos really first. Some of third_party needs it. | |
85 echo "Building package dh-chromeos..." | |
86 cd "$PLATFORM_DIR/dh-chromeos" | |
87 ./make_pkg.sh | |
88 cd - | |
89 | |
90 # Build third_party packages first, since packages and libs depend on them. | |
91 for i in $THIRD_PARTY_PACKAGES | |
92 do | |
93 echo "Building package ${i}..." | |
94 cd "$THIRD_PARTY_DIR/$i" | |
95 ./make_pkg.sh | |
96 cd - | |
97 done | |
98 | |
99 # Build base lib next, since packages depend on it. | |
100 echo "Building base library..." | |
101 cd "$THIRD_PARTY_DIR/chrome" | |
102 ./make_pkg.sh | |
103 cd - | |
104 | |
105 #Build common lib next. | |
106 echo "Building common library..." | |
107 cd "$SRC_ROOT/common" | |
108 ./make_pkg.sh | |
109 cd - | |
110 | |
111 # Build platform packages | |
112 for i in $PLATFORM_DIRS | |
113 do | |
114 echo "Building package ${i}..." | |
115 cd "$PLATFORM_DIR/$i" | |
116 ./make_pkg.sh | |
117 cd - | |
118 done | |
119 fi | |
120 | |
121 echo "All packages built." | |
OLD | NEW |