diff --git a/DEPS b/DEPS index b429735570..022183984d 100644 --- a/DEPS +++ b/DEPS @@ -25,7 +25,7 @@ deps = { "third_party/externals/egl-registry" : "https://skia.googlesource.com/external/github.com/KhronosGroup/EGL-Registry@a0bca08de07c7d7651047bedc0b653cfaaa4f2ae", "third_party/externals/expat" : "https://chromium.googlesource.com/external/github.com/libexpat/libexpat.git@a28238bdeebc087071777001245df1876a11f5ee", "third_party/externals/freetype" : "https://chromium.googlesource.com/chromium/src/third_party/freetype2.git@61903609674f2a4ad18abbbcb1d40f5c8beeeaf4", - "third_party/externals/harfbuzz" : "https://chromium.googlesource.com/external/github.com/harfbuzz/harfbuzz.git@368e9578873798e2d17ed78a0474dec7d4e9d6c0", + "third_party/externals/harfbuzz" : "https://chromium.googlesource.com/external/github.com/harfbuzz/harfbuzz.git@6f1909439862cc37246aba55a85c0a072b945dff", "third_party/externals/icu" : "https://chromium.googlesource.com/chromium/deps/icu.git@a0718d4f121727e30b8d52c7a189ebf5ab52421f", "third_party/externals/imgui" : "https://skia.googlesource.com/external/github.com/ocornut/imgui.git@9418dcb69355558f70de260483424412c5ca2fce", "third_party/externals/libgifcodec" : "https://skia.googlesource.com/libgifcodec@fd59fa92a0c86788dcdd84d091e1ce81eda06a77", diff --git a/third_party/harfbuzz/roll-harfbuzz.sh b/third_party/harfbuzz/roll-harfbuzz.sh new file mode 100755 index 0000000000..bd7e6151d5 --- /dev/null +++ b/third_party/harfbuzz/roll-harfbuzz.sh @@ -0,0 +1,85 @@ +#!/bin/bash + +HB_GIT_REPO=https://chromium.googlesource.com/external/github.com/harfbuzz/harfbuzz.git +HB_GIT_REF=origin/upstream/main +HB_GIT_DIR=third_party/externals/harfbuzz +HB_BUILD_DIR=$(dirname -- "$0") + +previousrev() { + STEP="original revision" && + HB_PREVIOUS_REV=$(git grep "${HB_GIT_REPO}" HEAD~1 -- DEPS | sed 's!.*'${HB_GIT_REPO}'@\([[:xdigit:]]\{40\}\).*!\1!') +} + +nextrev() { + STEP="next revision" && + git -C ${HB_GIT_DIR} fetch && + HB_NEXT_REV=$(git -C ${HB_GIT_DIR} rev-parse ${HB_GIT_REF}) +} + +rolldeps() { + STEP="roll-deps" && + sed -i'' -e "s!${HB_GIT_REPO}@${HB_PREVIOUS_REV}!${HB_GIT_REPO}@${HB_NEXT_REV}!" DEPS && + tools/git-sync-deps && + git add DEPS +} + +check_all_files_are_categorized() { + #for each file name in ${HB_GIT_DIR}/src/hb-*.{cc,h,hh} + # if the file name is not present in BUILD.gn + # should be added to BUILD.gn (in 'unused_sources' if unwanted) + + #for each file name \"src/.*\" in BUILD.gn + # if the file name does not exist + # should be removed from BUILD.gn + + STEP="Updating BUILD.gn" && + HB_BUILD_DIR_REL=$(realpath --relative-to=${HB_GIT_DIR} ${HB_BUILD_DIR}) + ( # Create subshell for IFS, CDPATH, and cd. + # This implementation doesn't handle '"' or '\n' in file names. + IFS=$'\n' && + CDPATH= && + cd -- "${HB_GIT_DIR}" && + + HB_SOURCE_MISSING=false && + find src/ -type f \( -name "hb-*.cc" -o -name "hb-*.h" -o -name "hb-*.hh" \) | while read HB_SOURCE + do + if ! grep -qF "$HB_SOURCE" ${HB_BUILD_DIR_REL}/BUILD.gn; then + if ! ${HB_SOURCE_MISSING}; then + echo "Is in src/hb-*.{cc,h,hh} but not in BUILD.gn:" + HB_SOURCE_MISSING=true + fi + echo " \"\$_${HB_SOURCE}\"," + fi + done && + + GN_SOURCE_MISSING=false && + grep -oE "\"\\\$_src/[^\"]+\"" ${HB_BUILD_DIR_REL}/BUILD.gn | sed 's/^...\(.*\).$/\1/' | while read GN_SOURCE + do + if [ ! -f "${GN_SOURCE}" ]; then + if ! ${GN_SOURCE_MISSING}; then + echo "Is referenced in BUILD.gn but does not exist:" && + GN_SOURCE_MISSING=true + fi + echo "\"${GN_SOURCE}\"" + fi + done + ) +} + +commit() { + STEP="commit" && + HB_PREVIOUS_REV_SHORT=$(expr substr "${HB_PREVIOUS_REV}" 1 8) && + HB_NEXT_REV_SHORT=$(expr substr "${HB_NEXT_REV}" 1 8) && + HB_COMMIT_COUNT=$(git -C ${HB_GIT_DIR} rev-list --count ${HB_PREVIOUS_REV}..${HB_NEXT_REV}) && + git commit -m"Roll HarfBuzz from ${HB_PREVIOUS_REV_SHORT} to ${HB_NEXT_REV_SHORT} (${HB_COMMIT_COUNT} commits) + +${HB_GIT_REPO}/+log/${HB_PREVIOUS_REV}..${HB_NEXT_REV} +" +} + +previousrev && +nextrev && +rolldeps "$@" && +check_all_files_are_categorized && +commit && +true || { echo "Failed step ${STEP}"; exit 1; }