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

Side by Side Diff: src/scripts/build_chrome.sh

Issue 600027: Adding [no]runhooks, [no]chrome, and [no]official options. (Closed)
Patch Set: Removed legacy environ variable for official. Created 10 years, 10 months 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 | no next file » | 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 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 # Script for building our own custom Chrome 7 # Script for building our own custom Chrome
8 8
9 # Load common constants. This should be the first executable line. 9 # Load common constants. This should be the first executable line.
10 # The path to common.sh should be relative to your script's location. 10 # The path to common.sh should be relative to your script's location.
11 . "$(dirname "$0")/common.sh" 11 . "$(dirname "$0")/common.sh"
12 12
13 # Script must be run outside the chroot 13 # Script must be run outside the chroot
14 assert_outside_chroot 14 assert_outside_chroot
15 15
16 # This script defaults Chrome source is in ~/chrome 16 # This script defaults Chrome source is in ~/chrome
17 # You may override the Chrome source dir via the --chrome_dir option or by 17 # You may override the Chrome source dir via the --chrome_dir option or by
18 # setting CHROMEOS_CHROME_DIR (for example, in ./.chromeos_dev) 18 # setting CHROMEOS_CHROME_DIR (for example, in ./.chromeos_dev)
19 DEFAULT_CHROME_DIR="${CHROMEOS_CHROME_DIR:-/home/$USER/chrome}" 19 DEFAULT_CHROME_DIR="${CHROMEOS_CHROME_DIR:-/home/$USER/chrome}"
20 20
21 # The number of jobs to pass to tools that can run in parallel (such as make 21 # The number of jobs to pass to tools that can run in parallel (such as make
22 # and dpkg-buildpackage 22 # and dpkg-buildpackage
23 NUM_JOBS=`grep -c "^processor" /proc/cpuinfo` 23 NUM_JOBS=`grep -c "^processor" /proc/cpuinfo`
24 24
25 # Flags 25 # Flags
26 DEFINE_string chrome_dir "$DEFAULT_CHROME_DIR" \ 26 DEFINE_string chrome_dir "$DEFAULT_CHROME_DIR" \
27 "Directory to Chrome source" 27 "Directory to Chrome/Chromium source"
28 DEFINE_string mode "Release" \ 28 DEFINE_string mode "Release" \
29 "The mode to build Chrome in (Debug or Release)" 29 "The mode to build Chrome/Chromium in (Debug or Release)"
30 DEFINE_string num_jobs "$NUM_JOBS" \ 30 DEFINE_string num_jobs "$NUM_JOBS" \
31 "The number of jobs to run in parallel" 31 "The number of jobs to run in parallel"
32 DEFINE_boolean runhooks true \
33 "Execute gclient runhooks before build (if norunhooks then chrome and official are ignored)"
34 DEFINE_boolean chrome false \
35 "Builds a chrome branded version (requires src-internal)"
36 DEFINE_boolean official false \
37 "Builds an official version (additional optimizations)"
32 38
33 # Parse command line 39 # Parse command line
34 FLAGS "$@" || exit 1 40 FLAGS "$@" || exit 1
35 eval set -- "${FLAGS_ARGV}" 41 eval set -- "${FLAGS_ARGV}"
36 42
37 # Die on error; print commands 43 # Die on error; print commands
38 set -e 44 set -e
39 45
40 # Convert args to paths. Need eval to un-quote the string so that shell 46 # Convert args to paths. Need eval to un-quote the string so that shell
41 # chars like ~ are processed; just doing FOO=`readlink -f $FOO` won't work. 47 # chars like ~ are processed; just doing FOO=`readlink -f $FOO` won't work.
42 FLAGS_chrome_dir=`eval readlink -f $FLAGS_chrome_dir` 48 FLAGS_chrome_dir=`eval readlink -f $FLAGS_chrome_dir`
43 49
44 # Build Chrome 50 # Build Chrome
45 echo Building Chrome in mode $FLAGS_mode 51 echo Building Chrome in mode $FLAGS_mode
46 export GYP_GENERATORS="make" 52 export GYP_GENERATORS="make"
47 export GYP_DEFINES="target_arch=ia32 chromeos=1" 53 export GYP_DEFINES="target_arch=ia32 chromeos=1"
54
55 if [ $FLAGS_chrome -eq $FLAGS_TRUE ]
56 then
57 export GYP_DEFINES="${GYP_DEFINES} branding=Chrome ffmpeg_branding=Chrome"
58 fi
59
60 if [ $FLAGS_official -eq $FLAGS_TRUE ]
61 then
62 export GYP_DEFINES="${GYP_DEFINES} buildtype=Official"
63 fi
64
48 CHROME_DIR=$FLAGS_chrome_dir 65 CHROME_DIR=$FLAGS_chrome_dir
49 cd "$CHROME_DIR/src" 66 cd "$CHROME_DIR/src"
50 gclient runhooks --force 67
68 if [ $FLAGS_runhooks -eq $FLAGS_TRUE ]
69 then
70 gclient runhooks --force
71 fi
72
51 make BUILDTYPE=$FLAGS_mode -j$FLAGS_num_jobs -r chrome candidate_window 73 make BUILDTYPE=$FLAGS_mode -j$FLAGS_num_jobs -r chrome candidate_window
52 74
53 # Zip into chrome-chromeos.zip and put in local_assets 75 # Zip into chrome-chromeos.zip and put in local_assets
54 BUILD_DIR="$CHROME_DIR/src/out" 76 BUILD_DIR="$CHROME_DIR/src/out"
55 CHROME_LINUX_DIR="$BUILD_DIR/chrome-chromeos" 77 CHROME_LINUX_DIR="$BUILD_DIR/chrome-chromeos"
56 OUTPUT_DIR="${SRC_ROOT}/build/x86/local_assets" 78 OUTPUT_DIR="${SRC_ROOT}/build/x86/local_assets"
57 OUTPUT_ZIP="$BUILD_DIR/chrome-chromeos.zip" 79 OUTPUT_ZIP="$BUILD_DIR/chrome-chromeos.zip"
58 if [ -n "$OUTPUT_DIR" ] 80 if [ -n "$OUTPUT_DIR" ]
59 then 81 then
60 mkdir -p $OUTPUT_DIR 82 mkdir -p $OUTPUT_DIR
61 fi 83 fi
62 # create symlink so that we can create the zip file with prefix chrome-chromeos 84 # create symlink so that we can create the zip file with prefix chrome-chromeos
63 rm -f $CHROME_LINUX_DIR 85 rm -f $CHROME_LINUX_DIR
64 ln -s $BUILD_DIR/$FLAGS_mode $CHROME_LINUX_DIR 86 ln -s $BUILD_DIR/$FLAGS_mode $CHROME_LINUX_DIR
65 87
66 echo Zipping $CHROME_LINUX_DIR to $OUTPUT_ZIP 88 echo Zipping $CHROME_LINUX_DIR to $OUTPUT_ZIP
67 cd $BUILD_DIR 89 cd $BUILD_DIR
68 rm -f $OUTPUT_ZIP 90 rm -f $OUTPUT_ZIP
69 zip -r1 $OUTPUT_ZIP chrome-chromeos -i "chrome-chromeos/chrome*" \ 91 zip -r1 $OUTPUT_ZIP chrome-chromeos -i "chrome-chromeos/chrome*" \
70 "chrome-chromeos/candidate_window" \ 92 "chrome-chromeos/candidate_window" \
71 "chrome-chromeos/libffmpegsumo.so" "chrome-chromeos/xdg-settings" \ 93 "chrome-chromeos/libffmpegsumo.so" "chrome-chromeos/xdg-settings" \
72 "chrome-chromeos/locales/*" "chrome-chromeos/resources/*" \ 94 "chrome-chromeos/locales/*" "chrome-chromeos/resources/*" \
73 "chrome-chromeos/*.png" "chrome-chromeos/session" \ 95 "chrome-chromeos/*.png" "chrome-chromeos/session" \
74 "chrome-chromeos/emit_login_prompt_ready" -x "*.d" 96 "chrome-chromeos/emit_login_prompt_ready" -x "*.d"
75 cp -f $OUTPUT_ZIP $OUTPUT_DIR 97 cp -f $OUTPUT_ZIP $OUTPUT_DIR
76 echo Done. 98 echo Done.
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698