pulsar/script/update-cef
Corey Johnson b436d9467e Enhance ./script/update-cef
It will now update or download a specific release of CEF and Chromium, compile CEF/Chromium, and copy the needed files to Atom.
2012-10-30 14:26:19 -07: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