skia2/platform_tools/chromeos/bin/chromeos_make
borenet@google.com 05d550ed36 GYP Changes and Scripts for Compiling Skia for ChromeOS
For now, this requires having a complete ChromeOS checkout.

R=djsollen@google.com

Review URL: https://codereview.chromium.org/16099011

git-svn-id: http://skia.googlecode.com/svn/trunk@9505 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-06-11 15:52:19 +00:00

40 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
# This script builds Skia for ChromeOS by mounting the Skia checkout inside a
# chroot contained within an existing ChromeOS checkout, entering the chroot,
# and running the build_skia_in_chroot script.
MAKE_FLAGS=$@
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [ $(uname) != "Linux" ]; then
echo "ERROR: Can only build for ChromeOS on Linux."
exit 1
fi
if [ -z "${CHROMEOS_ROOT}" ]; then
echo "ERROR: Please set CHROMEOS_ROOT to the root of your ChromeOS checkout."
exit 1
fi
CHROMEOS_CHROOT="${CHROMEOS_ROOT}/chroot"
# Where the Skia code will pretend to live inside the chroot.
SKIA_CHROOT_PARENT="/usr/local"
SKIA_CHROOT_DIR="${SKIA_CHROOT_PARENT}/skia"
echo "Mounting Skia source at ${SKIA_CHROOT_DIR} in chroot."
sudo mkdir -p ${CHROMEOS_CHROOT}${SKIA_CHROOT_DIR}
sudo mount $(pwd) ${CHROMEOS_CHROOT}${SKIA_CHROOT_DIR} -o bind
echo "Compiling in chroot: ${CHROMEOS_CHROOT}"
sudo ${CHROMEOS_ROOT}/chromite/bin/cros_sdk -- /bin/sh -c "cd ${SKIA_CHROOT_DIR}; platform_tools/chromeos/bin/build_skia_in_chroot $MAKE_FLAGS"
returnVal=$?
sudo umount ${CHROMEOS_CHROOT}${SKIA_CHROOT_DIR}
if [ "${returnVal}" != "0" ]
then
exit 1;
fi