From 555b147cc3a1f08d8c57a71a4afe244710892e6f Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Thu, 14 Jan 2010 00:13:01 +0000 Subject: [PATCH] Add optional chromiumos-build support to build_platform_packages This makes it possible to attempt a build using chromiumos-build by running './build_platform_packages.sh --new-build', with an -a option to select the architecture (e.g. -a armel). Right now, this uses --apt-source to build all build-dependencies as well, since that usually ends up being what you want when cross-compiling. I'd appreciate feedback from buildbot-oriented folks on whether this is an acceptable load in general. For the meantime, this is mainly for the convenience of people working on the cross-build project. Review URL: http://codereview.chromium.org/546042 --- build_platform_packages.sh | 76 ++++++++++++++++++++++---------------- 1 file changed, 45 insertions(+), 31 deletions(-) diff --git a/build_platform_packages.sh b/build_platform_packages.sh index 5ce38d8195..d0b10cfdff 100755 --- a/build_platform_packages.sh +++ b/build_platform_packages.sh @@ -13,9 +13,13 @@ assert_not_root_user # Flags DEFINE_boolean stable $FLAGS_FALSE "Build with stable version of browser." +DEFINE_boolean new_build $FLAGS_FALSE "Use chromiumos-build." +DEFINE_string architecture i386 "The architecture to build for (--new_build only)." a -# Parse command line -FLAGS "$@" || exit 1 +# Fix up the command line and parse with shflags. +FIXED_FLAGS="$@" +FIXED_FLAGS=${FIXED_FLAGS/new-build/new_build} +FLAGS $FIXED_FLAGS || exit 1 eval set -- "${FLAGS_ARGV}" # Die on error @@ -47,40 +51,50 @@ then export GET_STABLE_CHROME=1 fi -# Build dh-chromeos really first. Some of third_party needs it. -echo "Building package dh-chromeos..." -cd "$PLATFORM_DIR/dh-chromeos" -./make_pkg.sh -cd - - -# Build third_party packages first, since packages and libs depend on them. -for i in $THIRD_PARTY_PACKAGES -do - echo "Building package ${i}..." - cd "$THIRD_PARTY_DIR/$i" +if [ $FLAGS_new_build -eq $FLAGS_TRUE ]; then + # chromiumos-build works out the build order for itself. + PACKAGES='dh-chromeos libchrome libchromeos' + for PKG in $PLATFORM_DIRS $THIRD_PARTY_PACKAGES; do + PACKAGES="$PACKAGES ${PKG%/*}" + done + echo chromiumos-build -a "$FLAGS_architecture" --apt-source $PACKAGES + chromiumos-build -a "$FLAGS_architecture" --apt-source $PACKAGES +else + # Build dh-chromeos really first. Some of third_party needs it. + echo "Building package dh-chromeos..." + cd "$PLATFORM_DIR/dh-chromeos" ./make_pkg.sh cd - -done -# Build base lib next, since packages depend on it. -echo "Building base library..." -cd "$THIRD_PARTY_DIR/chrome" -./make_pkg.sh -cd - + # Build third_party packages first, since packages and libs depend on them. + for i in $THIRD_PARTY_PACKAGES + do + echo "Building package ${i}..." + cd "$THIRD_PARTY_DIR/$i" + ./make_pkg.sh + cd - + done -#Build common lib next. -echo "Building common library..." -cd "$SRC_ROOT/common" -./make_pkg.sh -cd - - -# Build platform packages -for i in $PLATFORM_DIRS -do - echo "Building package ${i}..." - cd "$PLATFORM_DIR/$i" + # Build base lib next, since packages depend on it. + echo "Building base library..." + cd "$THIRD_PARTY_DIR/chrome" ./make_pkg.sh cd - -done + + #Build common lib next. + echo "Building common library..." + cd "$SRC_ROOT/common" + ./make_pkg.sh + cd - + + # Build platform packages + for i in $PLATFORM_DIRS + do + echo "Building package ${i}..." + cd "$PLATFORM_DIR/$i" + ./make_pkg.sh + cd - + done +fi echo "All packages built."