pulsar/script/update-cef
2012-11-08 09:51:30 -08:00

41 lines
1.5 KiB
Bash
Executable File

#!/bin/sh
usage() {
echo 'usage: `basename $0` 'chromium-dir' [cef-release-branch] 1>&2'
echo
echo 'chromium-dir is the root of the chromium directory (i.e. ~/code/chromium)'
echo 'CEF release branches can be found at http://code.google.com/p/chromiumembedded/wiki/BranchesAndBuilding'
exit 1
}
if [ ! $1 ]; then
usage
fi
ATOM_ROOT=$(cd $(dirname $0); pwd -P)/..
CHROMIUM_DIR=$1
CEF_DIR=$CHROMIUM_DIR/src/cef/
CEF_RELEASE_BRANCH=${2:-1271}
CEF_BINARY_PATH=$(echo "$CEF_DIR"/binary_distrib/cef_binary_*_macosx/) # Expand the path
# Update and compile CEF
CEF_AUTOMATE_SCRIPT_PATH=/tmp/cef-update
rm -rf $CEF_AUTOMATE_SCRIPT_PATH
svn checkout http://chromiumembedded.googlecode.com/svn/trunk/cef1/tools/automate $CEF_AUTOMATE_SCRIPT_PATH
cd $CEF_AUTOMATE_SCRIPT_PATH
python automate.py --download-dir="$(dirname $CHROMIUM_DIR)" --url=http://chromiumembedded.googlecode.com/svn/branches/$CEF_RELEASE_BRANCH/cef3
# Copy the CEF gypi files and update their paths to match Atom's file layout
for GYPI_PATH in "$CEF_DIR/cef_paths.gypi" "$CEF_DIR/cef_paths2.gypi"; do
sed "s/include\//cef\/include\//;s/libcef_dll\//cef\/libcef_dll\//" $GYPI_PATH > $ATOM_ROOT/cef/$(basename $GYPI_PATH)
done
# Copy the framework files
for FRAMEWORK_PATH in ffmpegsumo.so libcef.dylib; do
cp "$CEF_BINARY_PATH/Release/$FRAMEWORK_PATH" $ATOM_ROOT/cef/frameworks/
done
cp -R "$CEF_BINARY_PATH/include" $ATOM_ROOT/cef/
cp -R "$CEF_BINARY_PATH/libcef_dll" $ATOM_ROOT/cef/
cp -R "$CEF_BINARY_PATH/Resources/" $ATOM_ROOT/cef/Resources