50 lines
1.5 KiB
Bash
Executable File
50 lines
1.5 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
project_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
|
vendor_root="${project_root}/vendor"
|
|
source_root="${vendor_root}/source"
|
|
tool_root="${vendor_root}/tools"
|
|
work_root="${vendor_root}/work"
|
|
destination="${source_root}/v8"
|
|
depot_tools="${tool_root}/depot_tools"
|
|
depot_revision="c0148d63d4909b3f27c9df5b6273efc496bc4459"
|
|
v8_revision="49df3678d1b6a1511167b15a6b7499d3ab37a638"
|
|
|
|
if [[ -d "${destination}" ]]; then
|
|
printf 'V8 source already present: %s\n' "${destination}"
|
|
exit 0
|
|
fi
|
|
|
|
mkdir -p "${source_root}" "${tool_root}" "${work_root}"
|
|
|
|
if [[ ! -d "${depot_tools}" ]]; then
|
|
temporary_tools="$(mktemp -d "${work_root}/depot-tools.XXXXXX")"
|
|
git -C "${temporary_tools}" init --quiet
|
|
git -C "${temporary_tools}" remote add origin https://chromium.googlesource.com/chromium/tools/depot_tools.git
|
|
git -C "${temporary_tools}" fetch --quiet --depth 1 origin "${depot_revision}"
|
|
git -C "${temporary_tools}" checkout --quiet --detach FETCH_HEAD
|
|
mv "${temporary_tools}" "${depot_tools}"
|
|
fi
|
|
|
|
workspace="${work_root}/v8-sync"
|
|
mkdir -p "${workspace}"
|
|
|
|
export PATH="${depot_tools}:${PATH}"
|
|
export DEPOT_TOOLS_UPDATE=0
|
|
|
|
if [[ ! -f "${workspace}/.gclient" ]]; then
|
|
(
|
|
cd "${workspace}"
|
|
gclient config --unmanaged https://chromium.googlesource.com/v8/v8.git
|
|
)
|
|
fi
|
|
|
|
(
|
|
cd "${workspace}"
|
|
gclient sync --revision "v8@${v8_revision}" --no-history --nohooks
|
|
gclient runhooks
|
|
)
|
|
|
|
mv "${workspace}/v8" "${destination}"
|