kubbebrowser/tools/vendor/sync-skia.sh

29 lines
902 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
project_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
source_root="${project_root}/vendor/source"
work_root="${project_root}/vendor/work"
destination="${source_root}/skia"
revision="587c5b0f5a7b0260826a0c19094c2d952195066e"
if [[ -d "${destination}" ]]; then
printf 'Skia source already present: %s\n' "${destination}"
exit 0
fi
mkdir -p "${source_root}" "${work_root}"
temporary="${work_root}/skia-sync"
if [[ ! -d "${temporary}/.git" ]]; then
mkdir -p "${temporary}"
git -C "${temporary}" init --quiet
git -C "${temporary}" remote add origin https://skia.googlesource.com/skia.git
git -C "${temporary}" fetch --quiet --depth 1 origin "${revision}"
git -C "${temporary}" checkout --quiet --detach FETCH_HEAD
fi
python3 "${temporary}/tools/git-sync-deps"
"${temporary}/bin/fetch-gn"
mv "${temporary}" "${destination}"