Use cefode's CEF binary.

This commit is contained in:
Cheng Zhao
2013-03-05 07:39:32 +01:00
parent 887e285cce
commit f170d37479
2 changed files with 97 additions and 2 deletions

View File

@@ -20,7 +20,9 @@ end
desc "Update CEF to the latest version specified by the prebuilt-cef submodule"
task "update-cef" => "bootstrap" do
exit 1 unless system %{prebuilt-cef/script/download -f cef}
# TODO Use prebuilt-cef's script after https://github.com/github/prebuilt-cef/pull/2 is merged.
# exit 1 unless system %{prebuilt-cef/script/download -b 1410 -r 1107 -d https://gh-contractor-zcbenz.s3.amazonaws.com/cefode/prebuilt-cef -f cef}
exit 1 unless system %{script/download_cef -b 1410 -r 1107 -d https://gh-contractor-zcbenz.s3.amazonaws.com/cefode/prebuilt-cef -f cef}
Dir.glob('cef/*.gypi').each do |filename|
`sed -i '' -e "s/'include\\//'cef\\/include\\//" -e "s/'libcef_dll\\//'cef\\/libcef_dll\\//" #{filename}`
end
@@ -28,7 +30,9 @@ end
desc "Download debug symbols for CEF"
task "download-cef-symbols" => "update-cef" do
sh %{prebuilt-cef/script/download -s cef}
# TODO Use prebuilt-cef's script after https://github.com/github/prebuilt-cef/pull/2 is merged.
# sh %{prebuilt-cef/script/download -b 1410 -r 1107 -d https://gh-contractor-zcbenz.s3.amazonaws.com/cefode/prebuilt-cef -s cef}
sh %{script/download_cef -b 1410 -r 1107 -d https://gh-contractor-zcbenz.s3.amazonaws.com/cefode/prebuilt-cef -s cef}
end
task "bootstrap" do

91
script/download_cef Executable file
View File

@@ -0,0 +1,91 @@
#!/bin/sh
#/ Usage: download [-f] [-s] [-b cef-branch] [-r cef-revision] [-d url/to/prebuilt/cef] path/for/extraction
#/ Download and extract prebuilt CEF.
#/
#/ Options:
#/ -f Overwrite path/for/extraction if it already exists.
#/ -s Download debugging symbols as well.
#/ -b CEF branch.
#/ -r CEF revision.
#/ -d Where to download binaries.
#/ -h Show this message.
set -e
usage() {
grep '^#/' <"$0"| cut -c4-
}
DISTURL="https://github-janky-artifacts.s3.amazonaws.com/prebuilt-cef"
while getopts ":fsb:r:d:h" OPTION; do
case ${OPTION} in
f)
FORCE=1
;;
s)
SYMBOLS=1
;;
b)
CEF_BRANCH=${OPTARG}
;;
r)
CEF_REVISION=${OPTARG}
;;
d)
DISTURL=${OPTARG}
;;
h)
usage
exit 0
;;
?)
echo "Unknown option -${OPTARG}"
usage
exit 1
;;
esac
done
shift $((OPTIND-1))
if [ -z "${1}" ]; then
usage
exit 1
fi
if [ "$(uname)" = "Darwin" ]; then
OS_TYPE=macosx
else
OS_TYPE=linux
fi
CEF_BASENAME="cef_binary_3.${CEF_BRANCH}.${CEF_REVISION}_${OS_TYPE}"
CEF_SYMBOLS_BASENAME="${CEF_BASENAME}_symbols"
TEMP_DIR=$(mktemp -d -t prebuilt-cef-download.XXXXXX)
trap "rm -rf \"${TEMP_DIR}\"" EXIT
# See if we've already downloaded this version.
grep -E "^CEF Version:[[:space:]]+3\.${CEF_BRANCH}\.${CEF_REVISION}$" "${1}/README.txt" >/dev/null 2>&1 || {
if [ -e "${1}" ] && [ "${FORCE}" != "1" ]; then
echo >&2 "Error: ${1} already exists. Pass -f if you want to overwrite it."
exit 1
fi
rm -rf "${1}"
mkdir -p "${1}"
echo "Downloading/extracting CEF3 branch ${CEF_BRANCH} r${CEF_REVISION}..."
curl --progress-bar "${DISTURL}/${CEF_BASENAME}.zip" > "${TEMP_DIR}/cef.zip"
unzip -q "${TEMP_DIR}/cef.zip" -d "${TEMP_DIR}"
mv "${TEMP_DIR}/${CEF_BASENAME}"/* "${1}"
}
if [ "${SYMBOLS}" != "1" ]; then
exit 0
fi
echo "Downloading/extracting symbols for CEF3 branch ${CEF_BRANCH} r${CEF_REVISION}..."
curl --progress-bar "${DISTURL}/${CEF_SYMBOLS_BASENAME}.zip" > "${TEMP_DIR}/symbols.zip"
unzip -q "${TEMP_DIR}/symbols.zip" -d "${TEMP_DIR}"
mv "${TEMP_DIR}/${CEF_SYMBOLS_BASENAME}"/* "${1}/Release"