[arch-commits] Commit in electron13/repos/community-x86_64 (28 files)
Nicola Squartini
tensor5 at gemini.archlinux.org
Thu Nov 18 10:44:09 UTC 2021
Date: Thursday, November 18, 2021 @ 10:44:09
Author: tensor5
Revision: 1052069
archrelease: copy trunk to community-x86_64
Added:
electron13/repos/community-x86_64/PKGBUILD
(from rev 1052068, electron13/trunk/PKGBUILD)
electron13/repos/community-x86_64/add-clang-nomerge-attribute-to-CheckError.patch
(from rev 1052068, electron13/trunk/add-clang-nomerge-attribute-to-CheckError.patch)
electron13/repos/community-x86_64/chromium-freetype-2.11.patch
(from rev 1052068, electron13/trunk/chromium-freetype-2.11.patch)
electron13/repos/community-x86_64/chromium-glibc-2.33.patch
(from rev 1052068, electron13/trunk/chromium-glibc-2.33.patch)
electron13/repos/community-x86_64/chromium-harfbuzz-3.0.0.patch
(from rev 1052068, electron13/trunk/chromium-harfbuzz-3.0.0.patch)
electron13/repos/community-x86_64/default_app-icon.patch
(from rev 1052068, electron13/trunk/default_app-icon.patch)
electron13/repos/community-x86_64/electron-launcher.sh
(from rev 1052068, electron13/trunk/electron-launcher.sh)
electron13/repos/community-x86_64/electron.desktop
(from rev 1052068, electron13/trunk/electron.desktop)
electron13/repos/community-x86_64/gn-visibility-gmock.patch
(from rev 1052068, electron13/trunk/gn-visibility-gmock.patch)
electron13/repos/community-x86_64/gn-visibility-mojo.patch
(from rev 1052068, electron13/trunk/gn-visibility-mojo.patch)
electron13/repos/community-x86_64/gn-visibility-webrtc.patch
(from rev 1052068, electron13/trunk/gn-visibility-webrtc.patch)
electron13/repos/community-x86_64/skia-harfbuzz-3.0.0.patch
(from rev 1052068, electron13/trunk/skia-harfbuzz-3.0.0.patch)
electron13/repos/community-x86_64/sql-make-VirtualCursor-standard-layout-type.patch
(from rev 1052068, electron13/trunk/sql-make-VirtualCursor-standard-layout-type.patch)
electron13/repos/community-x86_64/unbundle-fix-visibility-of-build-config-freetype.patch
(from rev 1052068, electron13/trunk/unbundle-fix-visibility-of-build-config-freetype.patch)
electron13/repos/community-x86_64/unbundle-use-char16_t-as-UCHAR_TYPE.patch
(from rev 1052068, electron13/trunk/unbundle-use-char16_t-as-UCHAR_TYPE.patch)
electron13/repos/community-x86_64/use-system-libraries-in-node.patch
(from rev 1052068, electron13/trunk/use-system-libraries-in-node.patch)
Deleted:
electron13/repos/community-x86_64/PKGBUILD
electron13/repos/community-x86_64/add-clang-nomerge-attribute-to-CheckError.patch
electron13/repos/community-x86_64/chromium-freetype-2.11.patch
electron13/repos/community-x86_64/chromium-glibc-2.33.patch
electron13/repos/community-x86_64/chromium-harfbuzz-3.0.0.patch
electron13/repos/community-x86_64/default_app-icon.patch
electron13/repos/community-x86_64/electron-launcher.sh
electron13/repos/community-x86_64/electron.desktop
electron13/repos/community-x86_64/skia-harfbuzz-3.0.0.patch
electron13/repos/community-x86_64/sql-make-VirtualCursor-standard-layout-type.patch
electron13/repos/community-x86_64/unbundle-use-char16_t-as-UCHAR_TYPE.patch
electron13/repos/community-x86_64/use-system-libraries-in-node.patch
--------------------------------------------------------+
PKGBUILD | 472 +++++++-------
add-clang-nomerge-attribute-to-CheckError.patch | 88 +-
chromium-freetype-2.11.patch | 76 +-
chromium-glibc-2.33.patch | 288 ++++-----
chromium-harfbuzz-3.0.0.patch | 40 -
default_app-icon.patch | 42 -
electron-launcher.sh | 40 -
electron.desktop | 14
gn-visibility-gmock.patch | 43 +
gn-visibility-mojo.patch | 36 +
gn-visibility-webrtc.patch | 45 +
skia-harfbuzz-3.0.0.patch | 200 +++---
sql-make-VirtualCursor-standard-layout-type.patch | 476 +++++++--------
unbundle-fix-visibility-of-build-config-freetype.patch | 31
unbundle-use-char16_t-as-UCHAR_TYPE.patch | 60 -
use-system-libraries-in-node.patch | 104 +--
16 files changed, 1111 insertions(+), 944 deletions(-)
Deleted: PKGBUILD
===================================================================
--- PKGBUILD 2021-11-18 10:43:47 UTC (rev 1052068)
+++ PKGBUILD 2021-11-18 10:44:09 UTC (rev 1052069)
@@ -1,230 +0,0 @@
-# Maintainer: Nicola Squartini <tensor5 at gmail.com>
-
-pkgname=electron13
-pkgver=13.6.1
-_commit=a7f4e03e1b74d677ca729ec63cfe92ae7687a301
-_chromiumver=91.0.4472.164
-_gcc_patchset=5
-pkgrel=1
-pkgdesc='Build cross platform desktop apps with web technologies'
-arch=('x86_64')
-url='https://electronjs.org/'
-license=('MIT' 'custom')
-depends=('c-ares' 'ffmpeg' 'gtk3' 'libevent' 'libxslt' 'minizip' 'nss' 're2'
- 'snappy')
-makedepends=('clang' 'git' 'gn' 'gperf' 'harfbuzz-icu' 'http-parser'
- 'java-runtime-headless' 'jsoncpp' 'libnotify' 'lld' 'llvm' 'ninja'
- 'npm' 'pciutils' 'pipewire' 'python2' 'wget' 'yarn')
-optdepends=('kde-cli-tools: file deletion support (kioclient5)'
- 'libappindicator-gtk3: StatusNotifierItem support'
- 'pipewire: WebRTC desktop sharing under Wayland'
- 'trash-cli: file deletion support (trash-put)'
- "xdg-utils: open URLs with desktop's default (xdg-email, xdg-open)")
-source=('git+https://github.com/electron/electron.git'
- 'git+https://chromium.googlesource.com/chromium/tools/depot_tools.git#branch=main'
- "https://github.com/stha09/chromium-patches/releases/download/chromium-${_chromiumver%%.*}-patchset-${_gcc_patchset}/chromium-${_chromiumver%%.*}-patchset-${_gcc_patchset}.tar.xz"
- "electron-launcher.sh"
- "electron.desktop"
- 'default_app-icon.patch'
- 'use-system-libraries-in-node.patch'
- 'add-clang-nomerge-attribute-to-CheckError.patch'
- 'chromium-freetype-2.11.patch'
- 'chromium-glibc-2.33.patch'
- 'chromium-harfbuzz-3.0.0.patch'
- 'skia-harfbuzz-3.0.0.patch'
- 'sql-make-VirtualCursor-standard-layout-type.patch'
- 'unbundle-use-char16_t-as-UCHAR_TYPE.patch'
- )
-sha256sums=('SKIP'
- 'SKIP'
- '171525009003a9ed1182cfcb6f407d7169d9a731a474304e263029376719f55a'
- '693c0d5d79d57ac8d8195ec21f9896f6f2c9ec7b3f2deb2b849aa7966f9e0ced'
- 'c128612dcdff9d5edf488775db1cd2b5b00e06811c88bf622703cce4787fcc51'
- 'dd2d248831dd4944d385ebf008426e66efe61d6fdf66f8932c963a12167947b4'
- 'f16103daf05713dea632b5f01e45db20ff12d1770a6539b4e8d3957a0242dd54'
- '50133dd196d288ad538bb536aa51dccd6cb4aacfd9a60160f77e8fb16034b460'
- '940346d3599d09366068d88b65dfcbcab187ceb5d14dc7c7f9b6ae5e6f25ec7d'
- '2fccecdcd4509d4c36af873988ca9dbcba7fdb95122894a9fdf502c33a1d7a4b'
- '7ce947944a139e66774dfc7249bf7c3069f07f83a0f1b2c1a1b14287a7e15928'
- 'c9ed1dbadaf4be6097e25bc5577b91751799befc2d0376b143e1bd10def5754e'
- 'dd317f85e5abfdcfc89c6f23f4c8edbcdebdd5e083dcec770e5da49ee647d150'
- '59a59a60a08b335fe8647fdf0f9d2288d236ebf2cc9626396d0c4d032fd2b25d'
- )
-
-_system_libs=('ffmpeg'
- 'flac'
- 'fontconfig'
- 'freetype'
- 'harfbuzz-ng'
- 'icu'
- 'libdrm'
- 'libevent'
- 'libjpeg'
- 'libpng'
-# 'libvpx'
- 'libwebp'
- 'libxml'
- 'libxslt'
-# 'openh264'
- 'opus'
- 're2'
- 'snappy'
- 'zlib'
- )
-
-prepare() {
- mkdir -p "${srcdir}"/python2-path
- ln -sf /usr/bin/python2 "${srcdir}/python2-path/python"
- export PATH="${srcdir}/python2-path:${PATH}:${srcdir}/depot_tools"
-
- echo "Fetching chromium..."
- git clone --branch=${_chromiumver} --depth=1 \
- https://chromium.googlesource.com/chromium/src.git
-
- echo "solutions = [
- {
- \"name\": \"src/electron\",
- \"url\": \"file://${srcdir}/electron@${_commit}\",
- \"deps_file\": \"DEPS\",
- \"managed\": False,
- \"custom_deps\": {
- \"src\": None,
- },
- \"custom_vars\": {},
- },
-]" > .gclient
-
- python2 "${srcdir}/depot_tools/gclient.py" sync \
- --with_branch_heads \
- --with_tags \
- --nohooks
-
- sed -e "s/'am'/'apply'/" -i src/electron/script/lib/git.py
-
- echo "Running hooks..."
- # python2 "${srcdir}/depot_tools/gclient.py" runhooks
- python2 src/build/landmines.py
- python2 src/build/util/lastchange.py -o src/build/util/LASTCHANGE
- python2 src/build/util/lastchange.py -m GPU_LISTS_VERSION \
- --revision-id-only --header src/gpu/config/gpu_lists_version.h
- python2 src/build/util/lastchange.py -m SKIA_COMMIT_HASH \
- -s src/third_party/skia --header src/skia/ext/skia_commit_hash.h
- # Create sysmlink to system clang-format
- ln -s /usr/bin/clang-format src/buildtools/linux64
- # Create sysmlink to system Node.js
- mkdir -p src/third_party/node/linux/node-linux-x64/bin
- ln -sf /usr/bin/node src/third_party/node/linux/node-linux-x64/bin
- #python2 src/third_party/depot_tools/download_from_google_storage.py \
- # --no_resume --extract --no_auth --bucket chromium-nodejs \
- # -s src/third_party/node/node_modules.tar.gz.sha1
- cd src/third_party/node
- npm ci
- cd ../../..
- vpython src/tools/download_optimization_profile.py \
- --newest_state=src/chrome/android/profiles/newest.txt \
- --local_state=src/chrome/android/profiles/local.txt \
- --output_name=src/chrome/android/profiles/afdo.prof \
- --gs_url_base=chromeos-prebuilt/afdo-job/llvm
- #vpython src/tools/update_pgo_profiles.py \
- # --target=linux \
- # update \
- # --gs-url-base=chromium-optimization-profiles/pgo_profiles
- python2 src/electron/script/apply_all_patches.py \
- src/electron/patches/config.json
- cd src/electron
- yarn install --frozen-lockfile
- cd ..
-
- echo "Applying local patches..."
- # Fixes for building with libstdc++ instead of libc++
- patch -Np1 -i ../patches/chromium-90-ruy-include.patch
-
- patch -Rp1 -i ../add-clang-nomerge-attribute-to-CheckError.patch
- patch -Np1 -i ../chromium-freetype-2.11.patch
- patch -Np1 -i ../chromium-glibc-2.33.patch
- patch -Np1 -i ../chromium-harfbuzz-3.0.0.patch
- patch -Np1 -d third_party/skia <../skia-harfbuzz-3.0.0.patch
- patch -Np1 -i ../sql-make-VirtualCursor-standard-layout-type.patch
- patch -Np1 -i ../unbundle-use-char16_t-as-UCHAR_TYPE.patch
- patch -Np1 -i ../use-system-libraries-in-node.patch
- patch -Np1 -i ../default_app-icon.patch # Icon from .desktop file
-
- echo "Patching Chromium for using system libraries..."
- sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \
- tools/generate_shim_headers/generate_shim_headers.py
- for lib in $(printf "%s\n" "${_system_libs[@]}" | sed 's/^libjpeg$/&_turbo/'); do
- third_party_dir="third_party/${lib}"
- if [ ! -d ${third_party_dir} ]; then
- third_party_dir="base/${third_party_dir}"
- fi
- find ${third_party_dir} -type f \
- \! -path "${third_party_dir}/chromium/*" \
- \! -path "${third_party_dir}/google/*" \
- \! -path 'third_party/harfbuzz-ng/utils/hb_scoped.h' \
- \! -regex '.*\.\(gn\|gni\|isolate\)' \
- -delete
- done
- python2 build/linux/unbundle/replace_gn_files.py \
- --system-libraries \
- "${_system_libs[@]}"
-}
-
-build() {
- export CC=clang
- export CXX=clang++
- export AR=ar
- export NM=nm
-
- # Do not warn about unknown warning options
- CFLAGS+=' -Wno-unknown-warning-option'
- CXXFLAGS+=' -Wno-unknown-warning-option'
-
- cd src
- export CHROMIUM_BUILDTOOLS_PATH="${PWD}/buildtools"
- GN_EXTRA_ARGS='
- blink_symbol_level = 0
- chrome_pgo_phase = 0
- clang_use_chrome_plugins = false
- custom_toolchain = "//build/toolchain/linux/unbundle:default"
- host_toolchain = "//build/toolchain/linux/unbundle:default"
- icu_use_data_file = false
- is_component_ffmpeg = false
- link_pulseaudio = true
- rtc_use_pipewire = true
- treat_warnings_as_errors = false
- use_custom_libcxx = false
- use_gnome_keyring = false
- use_sysroot = false
- '
- gn gen out/Release \
- --args="import(\"//electron/build/args/release.gn\") ${GN_EXTRA_ARGS}"
- ninja -C out/Release electron
- # Strip before zip to avoid
- # zipfile.LargeZipFile: Filesize would require ZIP64 extensions
- strip -s out/Release/electron
- ninja -C out/Release electron_dist_zip
- # ninja -C out/Release third_party/electron_node:headers
-}
-
-package() {
- install -dm755 "${pkgdir}/usr/lib/${pkgname}"
- bsdtar -xf src/out/Release/dist.zip -C "${pkgdir}/usr/lib/${pkgname}"
-
- chmod u+s "${pkgdir}/usr/lib/${pkgname}/chrome-sandbox"
-
- install -dm755 "${pkgdir}/usr/share/licenses/${pkgname}"
- for l in "${pkgdir}/usr/lib/${pkgname}"/{LICENSE,LICENSES.chromium.html}; do
- ln -s \
- "$(realpath --relative-to="${pkgdir}/usr/share/licenses/${pkgname}" "${l}")" \
- "${pkgdir}/usr/share/licenses/${pkgname}"
- done
-
- install -Dm755 "${srcdir}/electron-launcher.sh" \
- "${pkgdir}/usr/bin/${pkgname}"
-
- # Install .desktop and icon file (see default_app-icon.patch)
- install -Dm644 "electron.desktop" \
- "${pkgdir}/usr/share/applications/${pkgname}.desktop"
- install -Dm644 src/electron/default_app/icon.png \
- "${pkgdir}/usr/share/pixmaps/${pkgname}.png" # hicolor has no 1024x1024
-}
Copied: electron13/repos/community-x86_64/PKGBUILD (from rev 1052068, electron13/trunk/PKGBUILD)
===================================================================
--- PKGBUILD (rev 0)
+++ PKGBUILD 2021-11-18 10:44:09 UTC (rev 1052069)
@@ -0,0 +1,242 @@
+# Maintainer: Nicola Squartini <tensor5 at gmail.com>
+
+pkgname=electron13
+pkgver=13.6.2
+_commit=2ee43f9ecedc50daf875c50f1a1fb11b0bd5c10d
+_chromiumver=91.0.4472.164
+_gcc_patchset=5
+pkgrel=1
+pkgdesc='Build cross platform desktop apps with web technologies'
+arch=('x86_64')
+url='https://electronjs.org/'
+license=('MIT' 'custom')
+depends=('c-ares' 'ffmpeg' 'gtk3' 'libevent' 'libxslt' 'minizip' 'nss' 're2'
+ 'snappy')
+makedepends=('clang' 'git' 'gn' 'gperf' 'harfbuzz-icu' 'http-parser'
+ 'java-runtime-headless' 'jsoncpp' 'libnotify' 'lld' 'llvm' 'ninja'
+ 'npm' 'pciutils' 'pipewire' 'python2' 'wget' 'yarn')
+optdepends=('kde-cli-tools: file deletion support (kioclient5)'
+ 'libappindicator-gtk3: StatusNotifierItem support'
+ 'pipewire: WebRTC desktop sharing under Wayland'
+ 'trash-cli: file deletion support (trash-put)'
+ "xdg-utils: open URLs with desktop's default (xdg-email, xdg-open)")
+source=('git+https://github.com/electron/electron.git'
+ 'git+https://chromium.googlesource.com/chromium/tools/depot_tools.git#branch=main'
+ "https://github.com/stha09/chromium-patches/releases/download/chromium-${_chromiumver%%.*}-patchset-${_gcc_patchset}/chromium-${_chromiumver%%.*}-patchset-${_gcc_patchset}.tar.xz"
+ "electron-launcher.sh"
+ "electron.desktop"
+ 'default_app-icon.patch'
+ 'use-system-libraries-in-node.patch'
+ 'add-clang-nomerge-attribute-to-CheckError.patch'
+ 'chromium-freetype-2.11.patch'
+ 'chromium-glibc-2.33.patch'
+ 'chromium-harfbuzz-3.0.0.patch'
+ 'skia-harfbuzz-3.0.0.patch'
+ 'unbundle-fix-visibility-of-build-config-freetype.patch'
+ 'gn-visibility-gmock.patch'
+ 'gn-visibility-mojo.patch'
+ 'gn-visibility-webrtc.patch'
+ 'sql-make-VirtualCursor-standard-layout-type.patch'
+ 'unbundle-use-char16_t-as-UCHAR_TYPE.patch'
+ )
+sha256sums=('SKIP'
+ 'SKIP'
+ '171525009003a9ed1182cfcb6f407d7169d9a731a474304e263029376719f55a'
+ '693c0d5d79d57ac8d8195ec21f9896f6f2c9ec7b3f2deb2b849aa7966f9e0ced'
+ 'c128612dcdff9d5edf488775db1cd2b5b00e06811c88bf622703cce4787fcc51'
+ 'dd2d248831dd4944d385ebf008426e66efe61d6fdf66f8932c963a12167947b4'
+ 'f16103daf05713dea632b5f01e45db20ff12d1770a6539b4e8d3957a0242dd54'
+ '50133dd196d288ad538bb536aa51dccd6cb4aacfd9a60160f77e8fb16034b460'
+ '940346d3599d09366068d88b65dfcbcab187ceb5d14dc7c7f9b6ae5e6f25ec7d'
+ '2fccecdcd4509d4c36af873988ca9dbcba7fdb95122894a9fdf502c33a1d7a4b'
+ '7ce947944a139e66774dfc7249bf7c3069f07f83a0f1b2c1a1b14287a7e15928'
+ 'c9ed1dbadaf4be6097e25bc5577b91751799befc2d0376b143e1bd10def5754e'
+ 'd0b17162211dd49e3a58c16d1697e7d8c322dcfd3b7890f0c2f920b711f52293'
+ 'b9934e01d8f39beafc8b63784fb86e6befe25ca83e9c43224c8374e5a025d8ef'
+ 'cca2d224cf2e9d7cfb4f5729ca76b5b8a7100b1ca39892b41fb296adaced1bf7'
+ '574785a21168c3e9b7aa82630713ceb6ced12f699133db66b10fc84b7bb2c631'
+ 'dd317f85e5abfdcfc89c6f23f4c8edbcdebdd5e083dcec770e5da49ee647d150'
+ '59a59a60a08b335fe8647fdf0f9d2288d236ebf2cc9626396d0c4d032fd2b25d'
+ )
+
+_system_libs=('ffmpeg'
+ 'flac'
+ 'fontconfig'
+ 'freetype'
+ 'harfbuzz-ng'
+ 'icu'
+ 'libdrm'
+ 'libevent'
+ 'libjpeg'
+ 'libpng'
+# 'libvpx'
+ 'libwebp'
+ 'libxml'
+ 'libxslt'
+# 'openh264'
+ 'opus'
+ 're2'
+ 'snappy'
+ 'zlib'
+ )
+
+prepare() {
+ mkdir -p "${srcdir}"/python2-path
+ ln -sf /usr/bin/python2 "${srcdir}/python2-path/python"
+ export PATH="${srcdir}/python2-path:${PATH}:${srcdir}/depot_tools"
+
+ echo "Fetching chromium..."
+ git clone --branch=${_chromiumver} --depth=1 \
+ https://chromium.googlesource.com/chromium/src.git
+
+ echo "solutions = [
+ {
+ \"name\": \"src/electron\",
+ \"url\": \"file://${srcdir}/electron@${_commit}\",
+ \"deps_file\": \"DEPS\",
+ \"managed\": False,
+ \"custom_deps\": {
+ \"src\": None,
+ },
+ \"custom_vars\": {},
+ },
+]" > .gclient
+
+ python2 "${srcdir}/depot_tools/gclient.py" sync \
+ --with_branch_heads \
+ --with_tags \
+ --nohooks
+
+ sed -e "s/'am'/'apply'/" -i src/electron/script/lib/git.py
+
+ echo "Running hooks..."
+ # python2 "${srcdir}/depot_tools/gclient.py" runhooks
+ python2 src/build/landmines.py
+ python2 src/build/util/lastchange.py -o src/build/util/LASTCHANGE
+ python2 src/build/util/lastchange.py -m GPU_LISTS_VERSION \
+ --revision-id-only --header src/gpu/config/gpu_lists_version.h
+ python2 src/build/util/lastchange.py -m SKIA_COMMIT_HASH \
+ -s src/third_party/skia --header src/skia/ext/skia_commit_hash.h
+ # Create sysmlink to system clang-format
+ ln -s /usr/bin/clang-format src/buildtools/linux64
+ # Create sysmlink to system Node.js
+ mkdir -p src/third_party/node/linux/node-linux-x64/bin
+ ln -sf /usr/bin/node src/third_party/node/linux/node-linux-x64/bin
+ #python2 src/third_party/depot_tools/download_from_google_storage.py \
+ # --no_resume --extract --no_auth --bucket chromium-nodejs \
+ # -s src/third_party/node/node_modules.tar.gz.sha1
+ cd src/third_party/node
+ npm ci
+ cd ../../..
+ vpython src/tools/download_optimization_profile.py \
+ --newest_state=src/chrome/android/profiles/newest.txt \
+ --local_state=src/chrome/android/profiles/local.txt \
+ --output_name=src/chrome/android/profiles/afdo.prof \
+ --gs_url_base=chromeos-prebuilt/afdo-job/llvm
+ #vpython src/tools/update_pgo_profiles.py \
+ # --target=linux \
+ # update \
+ # --gs-url-base=chromium-optimization-profiles/pgo_profiles
+ python2 src/electron/script/apply_all_patches.py \
+ src/electron/patches/config.json
+ cd src/electron
+ yarn install --frozen-lockfile
+ cd ..
+
+ echo "Applying local patches..."
+ # Fixes for building with libstdc++ instead of libc++
+ patch -Np1 -i ../patches/chromium-90-ruy-include.patch
+
+ patch -Rp1 -i ../add-clang-nomerge-attribute-to-CheckError.patch
+ patch -Np1 -i ../chromium-freetype-2.11.patch
+ patch -Np1 -i ../chromium-glibc-2.33.patch
+ patch -Np1 -i ../chromium-harfbuzz-3.0.0.patch
+ patch -Np1 -d third_party/skia <../skia-harfbuzz-3.0.0.patch
+ patch -Np1 -i ../unbundle-fix-visibility-of-build-config-freetype.patch
+ patch -Np1 -i ../gn-visibility-gmock.patch
+ patch -Np1 -i ../gn-visibility-mojo.patch
+ patch -Np1 -i ../gn-visibility-webrtc.patch
+ patch -Np1 -i ../sql-make-VirtualCursor-standard-layout-type.patch
+ patch -Np1 -i ../unbundle-use-char16_t-as-UCHAR_TYPE.patch
+ patch -Np1 -i ../use-system-libraries-in-node.patch
+ patch -Np1 -i ../default_app-icon.patch # Icon from .desktop file
+
+ echo "Patching Chromium for using system libraries..."
+ sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \
+ tools/generate_shim_headers/generate_shim_headers.py
+ for lib in $(printf "%s\n" "${_system_libs[@]}" | sed 's/^libjpeg$/&_turbo/'); do
+ third_party_dir="third_party/${lib}"
+ if [ ! -d ${third_party_dir} ]; then
+ third_party_dir="base/${third_party_dir}"
+ fi
+ find ${third_party_dir} -type f \
+ \! -path "${third_party_dir}/chromium/*" \
+ \! -path "${third_party_dir}/google/*" \
+ \! -path 'third_party/harfbuzz-ng/utils/hb_scoped.h' \
+ \! -regex '.*\.\(gn\|gni\|isolate\)' \
+ -delete
+ done
+ python2 build/linux/unbundle/replace_gn_files.py \
+ --system-libraries \
+ "${_system_libs[@]}"
+}
+
+build() {
+ export CC=clang
+ export CXX=clang++
+ export AR=ar
+ export NM=nm
+
+ # Do not warn about unknown warning options
+ CFLAGS+=' -Wno-unknown-warning-option'
+ CXXFLAGS+=' -Wno-unknown-warning-option'
+
+ cd src
+ export CHROMIUM_BUILDTOOLS_PATH="${PWD}/buildtools"
+ GN_EXTRA_ARGS='
+ blink_symbol_level = 0
+ chrome_pgo_phase = 0
+ clang_use_chrome_plugins = false
+ custom_toolchain = "//build/toolchain/linux/unbundle:default"
+ host_toolchain = "//build/toolchain/linux/unbundle:default"
+ icu_use_data_file = false
+ is_component_ffmpeg = false
+ link_pulseaudio = true
+ rtc_use_pipewire = true
+ treat_warnings_as_errors = false
+ use_custom_libcxx = false
+ use_gnome_keyring = false
+ use_sysroot = false
+ '
+ gn gen out/Release \
+ --args="import(\"//electron/build/args/release.gn\") ${GN_EXTRA_ARGS}"
+ ninja -C out/Release electron
+ # Strip before zip to avoid
+ # zipfile.LargeZipFile: Filesize would require ZIP64 extensions
+ strip -s out/Release/electron
+ ninja -C out/Release electron_dist_zip
+ # ninja -C out/Release third_party/electron_node:headers
+}
+
+package() {
+ install -dm755 "${pkgdir}/usr/lib/${pkgname}"
+ bsdtar -xf src/out/Release/dist.zip -C "${pkgdir}/usr/lib/${pkgname}"
+
+ chmod u+s "${pkgdir}/usr/lib/${pkgname}/chrome-sandbox"
+
+ install -dm755 "${pkgdir}/usr/share/licenses/${pkgname}"
+ for l in "${pkgdir}/usr/lib/${pkgname}"/{LICENSE,LICENSES.chromium.html}; do
+ ln -s \
+ "$(realpath --relative-to="${pkgdir}/usr/share/licenses/${pkgname}" "${l}")" \
+ "${pkgdir}/usr/share/licenses/${pkgname}"
+ done
+
+ install -Dm755 "${srcdir}/electron-launcher.sh" \
+ "${pkgdir}/usr/bin/${pkgname}"
+
+ # Install .desktop and icon file (see default_app-icon.patch)
+ install -Dm644 "electron.desktop" \
+ "${pkgdir}/usr/share/applications/${pkgname}.desktop"
+ install -Dm644 src/electron/default_app/icon.png \
+ "${pkgdir}/usr/share/pixmaps/${pkgname}.png" # hicolor has no 1024x1024
+}
Deleted: add-clang-nomerge-attribute-to-CheckError.patch
===================================================================
--- add-clang-nomerge-attribute-to-CheckError.patch 2021-11-18 10:43:47 UTC (rev 1052068)
+++ add-clang-nomerge-attribute-to-CheckError.patch 2021-11-18 10:44:09 UTC (rev 1052069)
@@ -1,44 +0,0 @@
-From 9909f146b28d56c9c0411329a056ed959b33f76a Mon Sep 17 00:00:00 2001
-From: Zequan Wu <zequanwu at google.com>
-Date: Wed, 10 Feb 2021 03:26:00 +0000
-Subject: [PATCH] Reland "Add [[clang::nomerge]] attribute to ~CheckError()."
-
-This is a reland of 8860253376c38c090d585bda4b20b801e3aa3ce3
-
-Original change's description:
-> Add [[clang::nomerge]] attribute to ~CheckError().
->
-> To disable merging multiple ~CheckError() destructor for accurate crash logs.
->
-> Bug: 1153188
-> Change-Id: If6d153661667a63f13b645f6d284eb3d5ea3a300
-> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2611331
-> Commit-Queue: Nico Weber <thakis at chromium.org>
-> Auto-Submit: Zequan Wu <zequanwu at google.com>
-> Reviewed-by: Nico Weber <thakis at chromium.org>
-> Cr-Commit-Position: refs/heads/master@{#844989}
-
-Bug: 1153188
-Change-Id: I303c5ff9fb88f7a30663400622b327a910d0b108
-Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2686331
-Reviewed-by: Nico Weber <thakis at chromium.org>
-Commit-Queue: Nico Weber <thakis at chromium.org>
-Commit-Queue: Zequan Wu <zequanwu at google.com>
-Cr-Commit-Position: refs/heads/master@{#852453}
----
- base/check.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/base/check.h b/base/check.h
-index c94ab68db90..17048e45539 100644
---- a/base/check.h
-+++ b/base/check.h
-@@ -85,7 +85,7 @@ class BASE_EXPORT CheckError {
- // Stream for adding optional details to the error message.
- std::ostream& stream();
-
-- ~CheckError();
-+ NOMERGE ~CheckError();
-
- CheckError(const CheckError& other) = delete;
- CheckError& operator=(const CheckError& other) = delete;
Copied: electron13/repos/community-x86_64/add-clang-nomerge-attribute-to-CheckError.patch (from rev 1052068, electron13/trunk/add-clang-nomerge-attribute-to-CheckError.patch)
===================================================================
--- add-clang-nomerge-attribute-to-CheckError.patch (rev 0)
+++ add-clang-nomerge-attribute-to-CheckError.patch 2021-11-18 10:44:09 UTC (rev 1052069)
@@ -0,0 +1,44 @@
+From 9909f146b28d56c9c0411329a056ed959b33f76a Mon Sep 17 00:00:00 2001
+From: Zequan Wu <zequanwu at google.com>
+Date: Wed, 10 Feb 2021 03:26:00 +0000
+Subject: [PATCH] Reland "Add [[clang::nomerge]] attribute to ~CheckError()."
+
+This is a reland of 8860253376c38c090d585bda4b20b801e3aa3ce3
+
+Original change's description:
+> Add [[clang::nomerge]] attribute to ~CheckError().
+>
+> To disable merging multiple ~CheckError() destructor for accurate crash logs.
+>
+> Bug: 1153188
+> Change-Id: If6d153661667a63f13b645f6d284eb3d5ea3a300
+> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2611331
+> Commit-Queue: Nico Weber <thakis at chromium.org>
+> Auto-Submit: Zequan Wu <zequanwu at google.com>
+> Reviewed-by: Nico Weber <thakis at chromium.org>
+> Cr-Commit-Position: refs/heads/master@{#844989}
+
+Bug: 1153188
+Change-Id: I303c5ff9fb88f7a30663400622b327a910d0b108
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2686331
+Reviewed-by: Nico Weber <thakis at chromium.org>
+Commit-Queue: Nico Weber <thakis at chromium.org>
+Commit-Queue: Zequan Wu <zequanwu at google.com>
+Cr-Commit-Position: refs/heads/master@{#852453}
+---
+ base/check.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/base/check.h b/base/check.h
+index c94ab68db90..17048e45539 100644
+--- a/base/check.h
++++ b/base/check.h
+@@ -85,7 +85,7 @@ class BASE_EXPORT CheckError {
+ // Stream for adding optional details to the error message.
+ std::ostream& stream();
+
+- ~CheckError();
++ NOMERGE ~CheckError();
+
+ CheckError(const CheckError& other) = delete;
+ CheckError& operator=(const CheckError& other) = delete;
Deleted: chromium-freetype-2.11.patch
===================================================================
--- chromium-freetype-2.11.patch 2021-11-18 10:43:47 UTC (rev 1052068)
+++ chromium-freetype-2.11.patch 2021-11-18 10:44:09 UTC (rev 1052069)
@@ -1,38 +0,0 @@
---- a/third_party/skia/src/ports/SkFontHost_FreeType_common.cpp
-+++ b/third_party/skia/src/ports/SkFontHost_FreeType_common.cpp
-@@ -665,8 +665,13 @@
- canvas->drawPaint(paint);
- break;
- }
-+#if FREETYPE_MAJOR == 2 && FREETYPE_MINOR >= 11
-+ case FT_COLR_PAINTFORMAT_TRANSFORM: {
-+ SkMatrix transform = ToSkMatrix(colrv1_paint.u.transform.affine);
-+#else
- case FT_COLR_PAINTFORMAT_TRANSFORMED: {
- SkMatrix transform = ToSkMatrix(colrv1_paint.u.transformed.affine);
-+#endif
-
- canvas->concat(transform);
- break;
-@@ -768,12 +773,21 @@
- traverse_result = colrv1_start_glyph(canvas, palette, face, paint.u.colr_glyph.glyphID,
- FT_COLOR_NO_ROOT_TRANSFORM);
- break;
-+#if FREETYPE_MAJOR == 2 && FREETYPE_MINOR >= 11
-+ case FT_COLR_PAINTFORMAT_TRANSFORM:
-+ canvas->saveLayer(nullptr, nullptr);
-+ // Traverse / draw operation will apply transform.
-+ colrv1_draw_paint(canvas, palette, face, paint);
-+ traverse_result =
-+ colrv1_traverse_paint(canvas, palette, face, paint.u.transform.paint);
-+#else
- case FT_COLR_PAINTFORMAT_TRANSFORMED:
- canvas->saveLayer(nullptr, nullptr);
- // Traverse / draw operation will apply transform.
- colrv1_draw_paint(canvas, palette, face, paint);
- traverse_result =
- colrv1_traverse_paint(canvas, palette, face, paint.u.transformed.paint);
-+#endif
- canvas->restore();
- break;
- case FT_COLR_PAINTFORMAT_TRANSLATE:
Copied: electron13/repos/community-x86_64/chromium-freetype-2.11.patch (from rev 1052068, electron13/trunk/chromium-freetype-2.11.patch)
===================================================================
--- chromium-freetype-2.11.patch (rev 0)
+++ chromium-freetype-2.11.patch 2021-11-18 10:44:09 UTC (rev 1052069)
@@ -0,0 +1,38 @@
+--- a/third_party/skia/src/ports/SkFontHost_FreeType_common.cpp
++++ b/third_party/skia/src/ports/SkFontHost_FreeType_common.cpp
+@@ -665,8 +665,13 @@
+ canvas->drawPaint(paint);
+ break;
+ }
++#if FREETYPE_MAJOR == 2 && FREETYPE_MINOR >= 11
++ case FT_COLR_PAINTFORMAT_TRANSFORM: {
++ SkMatrix transform = ToSkMatrix(colrv1_paint.u.transform.affine);
++#else
+ case FT_COLR_PAINTFORMAT_TRANSFORMED: {
+ SkMatrix transform = ToSkMatrix(colrv1_paint.u.transformed.affine);
++#endif
+
+ canvas->concat(transform);
+ break;
+@@ -768,12 +773,21 @@
+ traverse_result = colrv1_start_glyph(canvas, palette, face, paint.u.colr_glyph.glyphID,
+ FT_COLOR_NO_ROOT_TRANSFORM);
+ break;
++#if FREETYPE_MAJOR == 2 && FREETYPE_MINOR >= 11
++ case FT_COLR_PAINTFORMAT_TRANSFORM:
++ canvas->saveLayer(nullptr, nullptr);
++ // Traverse / draw operation will apply transform.
++ colrv1_draw_paint(canvas, palette, face, paint);
++ traverse_result =
++ colrv1_traverse_paint(canvas, palette, face, paint.u.transform.paint);
++#else
+ case FT_COLR_PAINTFORMAT_TRANSFORMED:
+ canvas->saveLayer(nullptr, nullptr);
+ // Traverse / draw operation will apply transform.
+ colrv1_draw_paint(canvas, palette, face, paint);
+ traverse_result =
+ colrv1_traverse_paint(canvas, palette, face, paint.u.transformed.paint);
++#endif
+ canvas->restore();
+ break;
+ case FT_COLR_PAINTFORMAT_TRANSLATE:
Deleted: chromium-glibc-2.33.patch
===================================================================
--- chromium-glibc-2.33.patch 2021-11-18 10:43:47 UTC (rev 1052068)
+++ chromium-glibc-2.33.patch 2021-11-18 10:44:09 UTC (rev 1052069)
@@ -1,144 +0,0 @@
-# Patch made by Kevin Kofler <Kevin at tigcc.ticalc.org>
-# https://bugzilla.redhat.com/show_bug.cgi?id=1904652
-
-diff -up chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc.fstatfix chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
---- chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc.fstatfix 2021-01-25 10:11:45.427436398 -0500
-+++ chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc 2021-01-25 10:12:51.337699003 -0500
-@@ -257,6 +257,18 @@ ResultExpr EvaluateSyscallImpl(int fs_de
- return RestrictKillTarget(current_pid, sysno);
- }
-
-+#if defined(__NR_newfstatat)
-+ if (sysno == __NR_newfstatat) {
-+ return RewriteFstatatSIGSYS();
-+ }
-+#endif
-+
-+#if defined(__NR_fstatat64)
-+ if (sysno == __NR_fstatat64) {
-+ return RewriteFstatatSIGSYS();
-+ }
-+#endif
-+
- if (SyscallSets::IsFileSystem(sysno) ||
- SyscallSets::IsCurrentDirectory(sysno)) {
- return Error(fs_denied_errno);
-diff -up chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc.fstatfix chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc
---- chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc.fstatfix 2021-01-25 10:13:10.179774081 -0500
-+++ chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc 2021-01-25 10:16:18.790525746 -0500
-@@ -6,6 +6,8 @@
-
- #include "sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h"
-
-+#include <errno.h>
-+#include <fcntl.h>
- #include <stddef.h>
- #include <stdint.h>
- #include <string.h>
-@@ -355,6 +357,35 @@ intptr_t SIGSYSSchedHandler(const struct
- return -ENOSYS;
- }
-
-+intptr_t SIGSYSFstatatHandler(const struct arch_seccomp_data& args,
-+ void* aux) {
-+ switch (args.nr) {
-+#if defined(__NR_newfstatat)
-+ case __NR_newfstatat:
-+#endif
-+#if defined(__NR_fstatat64)
-+ case __NR_fstatat64:
-+#endif
-+#if defined(__NR_newfstatat) || defined(__NR_fstatat64)
-+ if (*reinterpret_cast<const char *>(args.args[1]) == '\0'
-+ && args.args[3] == static_cast<uint64_t>(AT_EMPTY_PATH)) {
-+ return sandbox::sys_fstat64(static_cast<int>(args.args[0]),
-+ reinterpret_cast<struct stat64 *>(args.args[2]));
-+ } else {
-+ errno = EACCES;
-+ return -1;
-+ }
-+ break;
-+#endif
-+ }
-+
-+ CrashSIGSYS_Handler(args, aux);
-+
-+ // Should never be reached.
-+ RAW_CHECK(false);
-+ return -ENOSYS;
-+}
-+
- bpf_dsl::ResultExpr CrashSIGSYS() {
- return bpf_dsl::Trap(CrashSIGSYS_Handler, NULL);
- }
-@@ -387,6 +418,10 @@ bpf_dsl::ResultExpr RewriteSchedSIGSYS()
- return bpf_dsl::Trap(SIGSYSSchedHandler, NULL);
- }
-
-+bpf_dsl::ResultExpr RewriteFstatatSIGSYS() {
-+ return bpf_dsl::Trap(SIGSYSFstatatHandler, NULL);
-+}
-+
- void AllocateCrashKeys() {
- #if !defined(OS_NACL_NONSFI)
- if (seccomp_crash_key)
-diff -up chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h.fstatfix chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h
---- chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h.fstatfix 2021-01-25 10:16:36.982598236 -0500
-+++ chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h 2021-01-25 10:18:45.705111027 -0500
-@@ -62,6 +62,10 @@ SANDBOX_EXPORT intptr_t SIGSYSPtraceFail
- // sched_setparam(), sched_setscheduler()
- SANDBOX_EXPORT intptr_t SIGSYSSchedHandler(const arch_seccomp_data& args,
- void* aux);
-+// If the fstatat syscall is actually a disguised fstat, calls the regular fstat
-+// syscall, otherwise, crashes in the same way as CrashSIGSYS_Handler.
-+SANDBOX_EXPORT intptr_t SIGSYSFstatatHandler(const struct arch_seccomp_data& args,
-+ void* aux);
-
- // Variants of the above functions for use with bpf_dsl.
- SANDBOX_EXPORT bpf_dsl::ResultExpr CrashSIGSYS();
-@@ -72,6 +76,7 @@ SANDBOX_EXPORT bpf_dsl::ResultExpr Crash
- SANDBOX_EXPORT bpf_dsl::ResultExpr CrashSIGSYSFutex();
- SANDBOX_EXPORT bpf_dsl::ResultExpr CrashSIGSYSPtrace();
- SANDBOX_EXPORT bpf_dsl::ResultExpr RewriteSchedSIGSYS();
-+SANDBOX_EXPORT bpf_dsl::ResultExpr RewriteFstatatSIGSYS();
-
- // Allocates a crash key so that Seccomp information can be recorded.
- void AllocateCrashKeys();
-diff -up chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.cc.fstatfix chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.cc
---- chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.cc.fstatfix 2021-01-25 10:18:53.307141311 -0500
-+++ chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.cc 2021-01-25 10:19:46.982355293 -0500
-@@ -261,4 +261,13 @@ int sys_sigaction(int signum,
-
- #endif // defined(MEMORY_SANITIZER)
-
-+SANDBOX_EXPORT int sys_fstat64(int fd, struct stat64 *buf)
-+{
-+#if defined(__NR_fstat64)
-+ return syscall(__NR_fstat64, fd, buf);
-+#else
-+ return syscall(__NR_fstat, fd, buf);
-+#endif
-+}
-+
- } // namespace sandbox
-diff -up chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.h.fstatfix chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.h
---- chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.h.fstatfix 2021-01-25 10:19:53.115379741 -0500
-+++ chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.h 2021-01-25 10:20:45.485588421 -0500
-@@ -17,6 +17,7 @@ struct sock_fprog;
- struct rlimit64;
- struct cap_hdr;
- struct cap_data;
-+struct stat64;
-
- namespace sandbox {
-
-@@ -84,6 +85,9 @@ SANDBOX_EXPORT int sys_sigaction(int sig
- const struct sigaction* act,
- struct sigaction* oldact);
-
-+// Recent glibc rewrites fstat to fstatat.
-+SANDBOX_EXPORT int sys_fstat64(int fd, struct stat64 *buf);
-+
- } // namespace sandbox
-
- #endif // SANDBOX_LINUX_SERVICES_SYSCALL_WRAPPERS_H_
Copied: electron13/repos/community-x86_64/chromium-glibc-2.33.patch (from rev 1052068, electron13/trunk/chromium-glibc-2.33.patch)
===================================================================
--- chromium-glibc-2.33.patch (rev 0)
+++ chromium-glibc-2.33.patch 2021-11-18 10:44:09 UTC (rev 1052069)
@@ -0,0 +1,144 @@
+# Patch made by Kevin Kofler <Kevin at tigcc.ticalc.org>
+# https://bugzilla.redhat.com/show_bug.cgi?id=1904652
+
+diff -up chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc.fstatfix chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
+--- chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc.fstatfix 2021-01-25 10:11:45.427436398 -0500
++++ chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc 2021-01-25 10:12:51.337699003 -0500
+@@ -257,6 +257,18 @@ ResultExpr EvaluateSyscallImpl(int fs_de
+ return RestrictKillTarget(current_pid, sysno);
+ }
+
++#if defined(__NR_newfstatat)
++ if (sysno == __NR_newfstatat) {
++ return RewriteFstatatSIGSYS();
++ }
++#endif
++
++#if defined(__NR_fstatat64)
++ if (sysno == __NR_fstatat64) {
++ return RewriteFstatatSIGSYS();
++ }
++#endif
++
+ if (SyscallSets::IsFileSystem(sysno) ||
+ SyscallSets::IsCurrentDirectory(sysno)) {
+ return Error(fs_denied_errno);
+diff -up chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc.fstatfix chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc
+--- chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc.fstatfix 2021-01-25 10:13:10.179774081 -0500
++++ chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc 2021-01-25 10:16:18.790525746 -0500
+@@ -6,6 +6,8 @@
+
+ #include "sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h"
+
++#include <errno.h>
++#include <fcntl.h>
+ #include <stddef.h>
+ #include <stdint.h>
+ #include <string.h>
+@@ -355,6 +357,35 @@ intptr_t SIGSYSSchedHandler(const struct
+ return -ENOSYS;
+ }
+
++intptr_t SIGSYSFstatatHandler(const struct arch_seccomp_data& args,
++ void* aux) {
++ switch (args.nr) {
++#if defined(__NR_newfstatat)
++ case __NR_newfstatat:
++#endif
++#if defined(__NR_fstatat64)
++ case __NR_fstatat64:
++#endif
++#if defined(__NR_newfstatat) || defined(__NR_fstatat64)
++ if (*reinterpret_cast<const char *>(args.args[1]) == '\0'
++ && args.args[3] == static_cast<uint64_t>(AT_EMPTY_PATH)) {
++ return sandbox::sys_fstat64(static_cast<int>(args.args[0]),
++ reinterpret_cast<struct stat64 *>(args.args[2]));
++ } else {
++ errno = EACCES;
++ return -1;
++ }
++ break;
++#endif
++ }
++
++ CrashSIGSYS_Handler(args, aux);
++
++ // Should never be reached.
++ RAW_CHECK(false);
++ return -ENOSYS;
++}
++
+ bpf_dsl::ResultExpr CrashSIGSYS() {
+ return bpf_dsl::Trap(CrashSIGSYS_Handler, NULL);
+ }
+@@ -387,6 +418,10 @@ bpf_dsl::ResultExpr RewriteSchedSIGSYS()
+ return bpf_dsl::Trap(SIGSYSSchedHandler, NULL);
+ }
+
++bpf_dsl::ResultExpr RewriteFstatatSIGSYS() {
++ return bpf_dsl::Trap(SIGSYSFstatatHandler, NULL);
++}
++
+ void AllocateCrashKeys() {
+ #if !defined(OS_NACL_NONSFI)
+ if (seccomp_crash_key)
+diff -up chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h.fstatfix chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h
+--- chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h.fstatfix 2021-01-25 10:16:36.982598236 -0500
++++ chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h 2021-01-25 10:18:45.705111027 -0500
+@@ -62,6 +62,10 @@ SANDBOX_EXPORT intptr_t SIGSYSPtraceFail
+ // sched_setparam(), sched_setscheduler()
+ SANDBOX_EXPORT intptr_t SIGSYSSchedHandler(const arch_seccomp_data& args,
+ void* aux);
++// If the fstatat syscall is actually a disguised fstat, calls the regular fstat
++// syscall, otherwise, crashes in the same way as CrashSIGSYS_Handler.
++SANDBOX_EXPORT intptr_t SIGSYSFstatatHandler(const struct arch_seccomp_data& args,
++ void* aux);
+
+ // Variants of the above functions for use with bpf_dsl.
+ SANDBOX_EXPORT bpf_dsl::ResultExpr CrashSIGSYS();
+@@ -72,6 +76,7 @@ SANDBOX_EXPORT bpf_dsl::ResultExpr Crash
+ SANDBOX_EXPORT bpf_dsl::ResultExpr CrashSIGSYSFutex();
+ SANDBOX_EXPORT bpf_dsl::ResultExpr CrashSIGSYSPtrace();
+ SANDBOX_EXPORT bpf_dsl::ResultExpr RewriteSchedSIGSYS();
++SANDBOX_EXPORT bpf_dsl::ResultExpr RewriteFstatatSIGSYS();
+
+ // Allocates a crash key so that Seccomp information can be recorded.
+ void AllocateCrashKeys();
+diff -up chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.cc.fstatfix chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.cc
+--- chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.cc.fstatfix 2021-01-25 10:18:53.307141311 -0500
++++ chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.cc 2021-01-25 10:19:46.982355293 -0500
+@@ -261,4 +261,13 @@ int sys_sigaction(int signum,
+
+ #endif // defined(MEMORY_SANITIZER)
+
++SANDBOX_EXPORT int sys_fstat64(int fd, struct stat64 *buf)
++{
++#if defined(__NR_fstat64)
++ return syscall(__NR_fstat64, fd, buf);
++#else
++ return syscall(__NR_fstat, fd, buf);
++#endif
++}
++
+ } // namespace sandbox
+diff -up chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.h.fstatfix chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.h
+--- chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.h.fstatfix 2021-01-25 10:19:53.115379741 -0500
++++ chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.h 2021-01-25 10:20:45.485588421 -0500
+@@ -17,6 +17,7 @@ struct sock_fprog;
+ struct rlimit64;
+ struct cap_hdr;
+ struct cap_data;
++struct stat64;
+
+ namespace sandbox {
+
+@@ -84,6 +85,9 @@ SANDBOX_EXPORT int sys_sigaction(int sig
+ const struct sigaction* act,
+ struct sigaction* oldact);
+
++// Recent glibc rewrites fstat to fstatat.
++SANDBOX_EXPORT int sys_fstat64(int fd, struct stat64 *buf);
++
+ } // namespace sandbox
+
+ #endif // SANDBOX_LINUX_SERVICES_SYSCALL_WRAPPERS_H_
Deleted: chromium-harfbuzz-3.0.0.patch
===================================================================
--- chromium-harfbuzz-3.0.0.patch 2021-11-18 10:43:47 UTC (rev 1052068)
+++ chromium-harfbuzz-3.0.0.patch 2021-11-18 10:44:09 UTC (rev 1052069)
@@ -1,20 +0,0 @@
-# https://github.com/chromium/chromium/commit/b289f6f3fcbc
-
-diff --git a/components/paint_preview/common/subset_font.cc b/components/paint_preview/common/subset_font.cc
-index 8ff0540d9a..20a7d37474 100644
---- a/components/paint_preview/common/subset_font.cc
-+++ b/components/paint_preview/common/subset_font.cc
-@@ -72,9 +72,11 @@ sk_sp<SkData> SubsetFont(SkTypeface* typeface, const GlyphUsage& usage) {
- hb_set_t* glyphs =
- hb_subset_input_glyph_set(input.get()); // Owned by |input|.
- usage.ForEach(base::BindRepeating(&AddGlyphs, base::Unretained(glyphs)));
-- hb_subset_input_set_retain_gids(input.get(), true);
-+ hb_subset_input_set_flags(input.get(), HB_SUBSET_FLAGS_RETAIN_GIDS);
-
-- HbScoped<hb_face_t> subset_face(hb_subset(face.get(), input.get()));
-+ HbScoped<hb_face_t> subset_face(hb_subset_or_fail(face.get(), input.get()));
-+ if (!subset_face)
-+ return nullptr;
- HbScoped<hb_blob_t> subset_blob(hb_face_reference_blob(subset_face.get()));
- if (!subset_blob)
- return nullptr;
Copied: electron13/repos/community-x86_64/chromium-harfbuzz-3.0.0.patch (from rev 1052068, electron13/trunk/chromium-harfbuzz-3.0.0.patch)
===================================================================
--- chromium-harfbuzz-3.0.0.patch (rev 0)
+++ chromium-harfbuzz-3.0.0.patch 2021-11-18 10:44:09 UTC (rev 1052069)
@@ -0,0 +1,20 @@
+# https://github.com/chromium/chromium/commit/b289f6f3fcbc
+
+diff --git a/components/paint_preview/common/subset_font.cc b/components/paint_preview/common/subset_font.cc
+index 8ff0540d9a..20a7d37474 100644
+--- a/components/paint_preview/common/subset_font.cc
++++ b/components/paint_preview/common/subset_font.cc
+@@ -72,9 +72,11 @@ sk_sp<SkData> SubsetFont(SkTypeface* typeface, const GlyphUsage& usage) {
+ hb_set_t* glyphs =
+ hb_subset_input_glyph_set(input.get()); // Owned by |input|.
+ usage.ForEach(base::BindRepeating(&AddGlyphs, base::Unretained(glyphs)));
+- hb_subset_input_set_retain_gids(input.get(), true);
++ hb_subset_input_set_flags(input.get(), HB_SUBSET_FLAGS_RETAIN_GIDS);
+
+- HbScoped<hb_face_t> subset_face(hb_subset(face.get(), input.get()));
++ HbScoped<hb_face_t> subset_face(hb_subset_or_fail(face.get(), input.get()));
++ if (!subset_face)
++ return nullptr;
+ HbScoped<hb_blob_t> subset_blob(hb_face_reference_blob(subset_face.get()));
+ if (!subset_blob)
+ return nullptr;
Deleted: default_app-icon.patch
===================================================================
--- default_app-icon.patch 2021-11-18 10:43:47 UTC (rev 1052068)
+++ default_app-icon.patch 2021-11-18 10:44:09 UTC (rev 1052069)
@@ -1,21 +0,0 @@
---- a/electron/default_app/default_app.ts
-+++ b/electron/default_app/default_app.ts
-@@ -60,7 +60,7 @@
- };
-
- if (process.platform === 'linux') {
-- options.icon = path.join(__dirname, 'icon.png');
-+ options.icon = '/usr/share/pixmaps/electron.png';
- }
-
- mainWindow = new BrowserWindow(options);
---- a/electron/filenames.gni
-+++ b/electron/filenames.gni
-@@ -6,7 +6,6 @@
- ]
-
- default_app_static_sources = [
-- "default_app/icon.png",
- "default_app/index.html",
- "default_app/package.json",
- "default_app/styles.css",
Copied: electron13/repos/community-x86_64/default_app-icon.patch (from rev 1052068, electron13/trunk/default_app-icon.patch)
===================================================================
--- default_app-icon.patch (rev 0)
+++ default_app-icon.patch 2021-11-18 10:44:09 UTC (rev 1052069)
@@ -0,0 +1,21 @@
+--- a/electron/default_app/default_app.ts
++++ b/electron/default_app/default_app.ts
+@@ -60,7 +60,7 @@
+ };
+
+ if (process.platform === 'linux') {
+- options.icon = path.join(__dirname, 'icon.png');
++ options.icon = '/usr/share/pixmaps/electron.png';
+ }
+
+ mainWindow = new BrowserWindow(options);
+--- a/electron/filenames.gni
++++ b/electron/filenames.gni
+@@ -6,7 +6,6 @@
+ ]
+
+ default_app_static_sources = [
+- "default_app/icon.png",
+ "default_app/index.html",
+ "default_app/package.json",
+ "default_app/styles.css",
Deleted: electron-launcher.sh
===================================================================
--- electron-launcher.sh 2021-11-18 10:43:47 UTC (rev 1052068)
+++ electron-launcher.sh 2021-11-18 10:44:09 UTC (rev 1052069)
@@ -1,20 +0,0 @@
-#!/usr/bin/bash
-
-set -euo pipefail
-
-name=electron13
-flags_file="${XDG_CONFIG_HOME:-$HOME/.config}/${name}-flags.conf"
-
-declare -a flags
-
-if [[ -f "${flags_file}" ]]; then
- mapfile -t < "${flags_file}"
-fi
-
-for line in "${MAPFILE[@]}"; do
- if [[ ! "${line}" =~ ^[[:space:]]*#.* ]]; then
- flags+=("${line}")
- fi
-done
-
-exec /usr/lib/${name}/electron "$@" "${flags[@]}"
Copied: electron13/repos/community-x86_64/electron-launcher.sh (from rev 1052068, electron13/trunk/electron-launcher.sh)
===================================================================
--- electron-launcher.sh (rev 0)
+++ electron-launcher.sh 2021-11-18 10:44:09 UTC (rev 1052069)
@@ -0,0 +1,20 @@
+#!/usr/bin/bash
+
+set -euo pipefail
+
+name=electron13
+flags_file="${XDG_CONFIG_HOME:-$HOME/.config}/${name}-flags.conf"
+
+declare -a flags
+
+if [[ -f "${flags_file}" ]]; then
+ mapfile -t < "${flags_file}"
+fi
+
+for line in "${MAPFILE[@]}"; do
+ if [[ ! "${line}" =~ ^[[:space:]]*#.* ]]; then
+ flags+=("${line}")
+ fi
+done
+
+exec /usr/lib/${name}/electron "$@" "${flags[@]}"
Deleted: electron.desktop
===================================================================
--- electron.desktop 2021-11-18 10:43:47 UTC (rev 1052068)
+++ electron.desktop 2021-11-18 10:44:09 UTC (rev 1052069)
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Type=Application
-Name=Electron 13
-Icon=electron13
-Exec=electron13 %u
-Categories=Development;GTK;
-StartupNotify=true
Copied: electron13/repos/community-x86_64/electron.desktop (from rev 1052068, electron13/trunk/electron.desktop)
===================================================================
--- electron.desktop (rev 0)
+++ electron.desktop 2021-11-18 10:44:09 UTC (rev 1052069)
@@ -0,0 +1,7 @@
+[Desktop Entry]
+Type=Application
+Name=Electron 13
+Icon=electron13
+Exec=electron13 %u
+Categories=Development;GTK;
+StartupNotify=true
Copied: electron13/repos/community-x86_64/gn-visibility-gmock.patch (from rev 1052068, electron13/trunk/gn-visibility-gmock.patch)
===================================================================
--- gn-visibility-gmock.patch (rev 0)
+++ gn-visibility-gmock.patch 2021-11-18 10:44:09 UTC (rev 1052069)
@@ -0,0 +1,43 @@
+From fc3c737210873e9bee311391e9f6b48130e84983 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Tomasz=20=C5=9Aniatowski?= <tsniatowski at vewd.com>
+Date: Sat, 4 Sep 2021 07:13:49 +0000
+Subject: [PATCH] Fix config visibility violation in //testing/gmock
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+//third_party/googletest:gtest_config has restricted visibility, current
+code works by accident because gn only enforces visibility on 'configs'.
+Fix by not referencing the configs at all as it should be unnecessary:
+//testing/gmock gets them via a public dependency chain anyway.
+
+This is one of a few fixes needed to roll gn past the upcoming
+enforcement change, landing in small parts because removing config
+usages feels a bit subtle.
+
+Bug: gn:252
+Change-Id: Ie1438862831ecee49162d9f8f7872a568d69c2fb
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3139927
+Reviewed-by: Dirk Pranke <dpranke at google.com>
+Commit-Queue: Tomasz Śniatowski <tsniatowski at vewd.com>
+Cr-Commit-Position: refs/heads/main@{#918357}
+---
+ testing/gmock/BUILD.gn | 5 -----
+ 1 file changed, 5 deletions(-)
+
+diff --git a/testing/gmock/BUILD.gn b/testing/gmock/BUILD.gn
+index 0248d146d7397..e285fb84e471a 100644
+--- a/testing/gmock/BUILD.gn
++++ b/testing/gmock/BUILD.gn
+@@ -14,11 +14,6 @@ source_set("gmock") {
+ "include/gmock/gmock.h",
+ ]
+ public_deps = [ "//third_party/googletest:gmock" ]
+-
+- public_configs = [
+- "//third_party/googletest:gmock_config",
+- "//third_party/googletest:gtest_config",
+- ]
+ }
+
+ # The file/directory layout of Google Test is not yet considered stable. Until
Copied: electron13/repos/community-x86_64/gn-visibility-mojo.patch (from rev 1052068, electron13/trunk/gn-visibility-mojo.patch)
===================================================================
--- gn-visibility-mojo.patch (rev 0)
+++ gn-visibility-mojo.patch 2021-11-18 10:44:09 UTC (rev 1052069)
@@ -0,0 +1,36 @@
+From 40f10bf0e683f6b499b5c3c7555111193db03abf Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Tomasz=20=C5=9Aniatowski?= <tsniatowski at vewd.com>
+Date: Tue, 7 Sep 2021 20:13:53 +0000
+Subject: [PATCH] Fix config visibility violation in //mojo/public/cpp/bindings
+
+//third_party/blink/renderer:config has restricted visibility, current
+code works by accident because gn only enforces visibility on 'configs'.
+Fix by removing the direct config usage as it looks historical and not
+actually needed.
+
+This is one of a few fixes needed to roll gn past the upcoming
+enforcement change, landing in small parts because removing config
+usages feels a bit subtle.
+
+Bug: gn:252
+Change-Id: I2e0d2e314ef3714dd19b11b7ae29bdcf5074cfda
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3140593
+Commit-Queue: Ken Rockot <rockot at google.com>
+Reviewed-by: Ken Rockot <rockot at google.com>
+Cr-Commit-Position: refs/heads/main@{#918914}
+---
+ mojo/public/cpp/bindings/BUILD.gn | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/mojo/public/cpp/bindings/BUILD.gn b/mojo/public/cpp/bindings/BUILD.gn
+index 13ad53b3ed305..d90318de106e4 100644
+--- a/mojo/public/cpp/bindings/BUILD.gn
++++ b/mojo/public/cpp/bindings/BUILD.gn
+@@ -281,7 +281,5 @@ if (!is_ios) {
+ "//third_party/blink/renderer/platform:platform_export",
+ "//third_party/blink/renderer/platform/wtf",
+ ]
+-
+- public_configs = [ "//third_party/blink/renderer:config" ]
+ }
+ }
Copied: electron13/repos/community-x86_64/gn-visibility-webrtc.patch (from rev 1052068, electron13/trunk/gn-visibility-webrtc.patch)
===================================================================
--- gn-visibility-webrtc.patch (rev 0)
+++ gn-visibility-webrtc.patch 2021-11-18 10:44:09 UTC (rev 1052069)
@@ -0,0 +1,45 @@
+From 72c4d9fc95c336f61d7a8417b78f947a400ce792 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Tomasz=20=C5=9Aniatowski?= <tsniatowski at vewd.com>
+Date: Tue, 14 Sep 2021 10:33:37 +0000
+Subject: [PATCH] Relax googletest gn config visibility for webrtc
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+An upcoming gn roll will start enforcing config visibility on
+public_configs and all_dependent_configs. Normally, configs with
+limited visibility have corresponding helper targets that push the
+configs using public_configs and are propagated with public_deps.
+However, webrtc prefers to avoid public_deps, and pushes the gtest
+config using all_dependent_configs. This requires direct visibility,
+so tweak gtest BUILD.gn to make things work.
+
+Bug: gn:252, 1249254
+Change-Id: Ic7be22f7bf129255fb0ac51f437cd6dd3989e3a3
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3158065
+Commit-Queue: Tomasz Śniatowski <tsniatowski at vewd.com>
+Reviewed-by: Victor Costan <pwnall at chromium.org>
+Cr-Commit-Position: refs/heads/main@{#921126}
+---
+ third_party/googletest/BUILD.gn | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/third_party/googletest/BUILD.gn b/third_party/googletest/BUILD.gn
+index fe240ebe954b6..d2bde47d75eab 100644
+--- a/third_party/googletest/BUILD.gn
++++ b/third_party/googletest/BUILD.gn
+@@ -5,7 +5,13 @@
+ import("//build_overrides/build.gni")
+
+ config("gtest_config") {
+- visibility = [ ":*" ] # gmock also shares this config.
++ # webrtc wants to push this config without a public_dep chain
++ # TODO(crbug.com/1249254): figure out what to do with this
++ visibility = [
++ ":*", # gmock also shares this config.
++ "//test:*", # webrts standalone setup
++ "//third_party/webrtc/test:*",
++ ]
+
+ defines = [
+ # Chromium always links googletest statically, so no API qualifier is
Deleted: skia-harfbuzz-3.0.0.patch
===================================================================
--- skia-harfbuzz-3.0.0.patch 2021-11-18 10:43:47 UTC (rev 1052068)
+++ skia-harfbuzz-3.0.0.patch 2021-11-18 10:44:09 UTC (rev 1052069)
@@ -1,100 +0,0 @@
-# Minimal diff for harfbuzz 3.0.0 support; based on:
-# https://github.com/google/skia/commit/66684b17b382
-# https://github.com/google/skia/commit/51d83abcd24a
-
-diff --git a/gn/skia.gni b/gn/skia.gni
-index d98fdc19ee..199335d5c4 100644
---- a/gn/skia.gni
-+++ b/gn/skia.gni
-@@ -34,8 +34,6 @@ declare_args() {
- skia_include_multiframe_procs = false
- skia_lex = false
- skia_libgifcodec_path = "third_party/externals/libgifcodec"
-- skia_pdf_subset_harfbuzz =
-- false # TODO: set skia_pdf_subset_harfbuzz to skia_use_harfbuzz.
- skia_qt_path = getenv("QT_PATH")
- skia_skqp_global_error_tolerance = 0
- skia_tools_require_resources = false
-@@ -99,6 +97,10 @@ declare_args() {
- skia_use_libfuzzer_defaults = true
- }
-
-+declare_args() {
-+ skia_pdf_subset_harfbuzz = skia_use_harfbuzz
-+}
-+
- declare_args() {
- skia_compile_sksl_tests = skia_compile_processors
- skia_enable_fontmgr_android = skia_use_expat && skia_use_freetype
-diff --git a/src/pdf/SkPDFSubsetFont.cpp b/src/pdf/SkPDFSubsetFont.cpp
-index 81c37eef3a..2340a7937b 100644
---- a/src/pdf/SkPDFSubsetFont.cpp
-+++ b/src/pdf/SkPDFSubsetFont.cpp
-@@ -49,6 +49,37 @@ static sk_sp<SkData> to_data(HBBlob blob) {
- blob.release());
- }
-
-+template<typename...> using void_t = void;
-+template<typename T, typename = void>
-+struct SkPDFHarfBuzzSubset {
-+ // This is the HarfBuzz 3.0 interface.
-+ // hb_subset_flags_t does not exist in 2.0. It isn't dependent on T, so inline the value of
-+ // HB_SUBSET_FLAGS_RETAIN_GIDS until 2.0 is no longer supported.
-+ static HBFace Make(T input, hb_face_t* face) {
-+ // TODO: When possible, check if a font is 'tricky' with FT_IS_TRICKY.
-+ // If it isn't known if a font is 'tricky', retain the hints.
-+ hb_subset_input_set_flags(input, 2/*HB_SUBSET_FLAGS_RETAIN_GIDS*/);
-+ return HBFace(hb_subset_or_fail(face, input));
-+ }
-+};
-+template<typename T>
-+struct SkPDFHarfBuzzSubset<T, void_t<
-+ decltype(hb_subset_input_set_retain_gids(std::declval<T>(), std::declval<bool>())),
-+ decltype(hb_subset_input_set_drop_hints(std::declval<T>(), std::declval<bool>())),
-+ decltype(hb_subset(std::declval<hb_face_t*>(), std::declval<T>()))
-+ >>
-+{
-+ // This is the HarfBuzz 2.0 (non-public) interface, used if it exists.
-+ // This code should be removed as soon as all users are migrated to the newer API.
-+ static HBFace Make(T input, hb_face_t* face) {
-+ hb_subset_input_set_retain_gids(input, true);
-+ // TODO: When possible, check if a font is 'tricky' with FT_IS_TRICKY.
-+ // If it isn't known if a font is 'tricky', retain the hints.
-+ hb_subset_input_set_drop_hints(input, false);
-+ return HBFace(hb_subset(face, input));
-+ }
-+};
-+
- static sk_sp<SkData> subset_harfbuzz(sk_sp<SkData> fontData,
- const SkPDFGlyphUse& glyphUsage,
- int ttcIndex) {
-@@ -71,11 +102,10 @@ static sk_sp<SkData> subset_harfbuzz(sk_sp<SkData> fontData,
- hb_set_t* glyphs = hb_subset_input_glyph_set(input.get());
- glyphUsage.getSetValues([&glyphs](unsigned gid) { hb_set_add(glyphs, gid);});
-
-- hb_subset_input_set_retain_gids(input.get(), true);
-- // TODO: When possible, check if a font is 'tricky' with FT_IS_TRICKY.
-- // If it isn't known if a font is 'tricky', retain the hints.
-- hb_subset_input_set_drop_hints(input.get(), false);
-- HBFace subset(hb_subset(face.get(), input.get()));
-+ HBFace subset = SkPDFHarfBuzzSubset<hb_subset_input_t*>::Make(input.get(), face.get());
-+ if (!subset) {
-+ return nullptr;
-+ }
- HBBlob result(hb_face_reference_blob(subset.get()));
- return to_data(std::move(result));
- }
-diff --git a/third_party/harfbuzz/BUILD.gn b/third_party/harfbuzz/BUILD.gn
-index 173830de62..4156607ef9 100644
---- a/third_party/harfbuzz/BUILD.gn
-+++ b/third_party/harfbuzz/BUILD.gn
-@@ -14,6 +14,9 @@ if (skia_use_system_harfbuzz) {
- "harfbuzz",
- "harfbuzz-icu",
- ]
-+ if (skia_pdf_subset_harfbuzz) {
-+ libs += [ "harfbuzz-subset" ]
-+ }
- }
- } else {
- third_party("harfbuzz") {
Copied: electron13/repos/community-x86_64/skia-harfbuzz-3.0.0.patch (from rev 1052068, electron13/trunk/skia-harfbuzz-3.0.0.patch)
===================================================================
--- skia-harfbuzz-3.0.0.patch (rev 0)
+++ skia-harfbuzz-3.0.0.patch 2021-11-18 10:44:09 UTC (rev 1052069)
@@ -0,0 +1,100 @@
+# Minimal diff for harfbuzz 3.0.0 support; based on:
+# https://github.com/google/skia/commit/66684b17b382
+# https://github.com/google/skia/commit/51d83abcd24a
+
+diff --git a/gn/skia.gni b/gn/skia.gni
+index d98fdc19ee..199335d5c4 100644
+--- a/gn/skia.gni
++++ b/gn/skia.gni
+@@ -34,8 +34,6 @@ declare_args() {
+ skia_include_multiframe_procs = false
+ skia_lex = false
+ skia_libgifcodec_path = "third_party/externals/libgifcodec"
+- skia_pdf_subset_harfbuzz =
+- false # TODO: set skia_pdf_subset_harfbuzz to skia_use_harfbuzz.
+ skia_qt_path = getenv("QT_PATH")
+ skia_skqp_global_error_tolerance = 0
+ skia_tools_require_resources = false
+@@ -99,6 +97,10 @@ declare_args() {
+ skia_use_libfuzzer_defaults = true
+ }
+
++declare_args() {
++ skia_pdf_subset_harfbuzz = skia_use_harfbuzz
++}
++
+ declare_args() {
+ skia_compile_sksl_tests = skia_compile_processors
+ skia_enable_fontmgr_android = skia_use_expat && skia_use_freetype
+diff --git a/src/pdf/SkPDFSubsetFont.cpp b/src/pdf/SkPDFSubsetFont.cpp
+index 81c37eef3a..2340a7937b 100644
+--- a/src/pdf/SkPDFSubsetFont.cpp
++++ b/src/pdf/SkPDFSubsetFont.cpp
+@@ -49,6 +49,37 @@ static sk_sp<SkData> to_data(HBBlob blob) {
+ blob.release());
+ }
+
++template<typename...> using void_t = void;
++template<typename T, typename = void>
++struct SkPDFHarfBuzzSubset {
++ // This is the HarfBuzz 3.0 interface.
++ // hb_subset_flags_t does not exist in 2.0. It isn't dependent on T, so inline the value of
++ // HB_SUBSET_FLAGS_RETAIN_GIDS until 2.0 is no longer supported.
++ static HBFace Make(T input, hb_face_t* face) {
++ // TODO: When possible, check if a font is 'tricky' with FT_IS_TRICKY.
++ // If it isn't known if a font is 'tricky', retain the hints.
++ hb_subset_input_set_flags(input, 2/*HB_SUBSET_FLAGS_RETAIN_GIDS*/);
++ return HBFace(hb_subset_or_fail(face, input));
++ }
++};
++template<typename T>
++struct SkPDFHarfBuzzSubset<T, void_t<
++ decltype(hb_subset_input_set_retain_gids(std::declval<T>(), std::declval<bool>())),
++ decltype(hb_subset_input_set_drop_hints(std::declval<T>(), std::declval<bool>())),
++ decltype(hb_subset(std::declval<hb_face_t*>(), std::declval<T>()))
++ >>
++{
++ // This is the HarfBuzz 2.0 (non-public) interface, used if it exists.
++ // This code should be removed as soon as all users are migrated to the newer API.
++ static HBFace Make(T input, hb_face_t* face) {
++ hb_subset_input_set_retain_gids(input, true);
++ // TODO: When possible, check if a font is 'tricky' with FT_IS_TRICKY.
++ // If it isn't known if a font is 'tricky', retain the hints.
++ hb_subset_input_set_drop_hints(input, false);
++ return HBFace(hb_subset(face, input));
++ }
++};
++
+ static sk_sp<SkData> subset_harfbuzz(sk_sp<SkData> fontData,
+ const SkPDFGlyphUse& glyphUsage,
+ int ttcIndex) {
+@@ -71,11 +102,10 @@ static sk_sp<SkData> subset_harfbuzz(sk_sp<SkData> fontData,
+ hb_set_t* glyphs = hb_subset_input_glyph_set(input.get());
+ glyphUsage.getSetValues([&glyphs](unsigned gid) { hb_set_add(glyphs, gid);});
+
+- hb_subset_input_set_retain_gids(input.get(), true);
+- // TODO: When possible, check if a font is 'tricky' with FT_IS_TRICKY.
+- // If it isn't known if a font is 'tricky', retain the hints.
+- hb_subset_input_set_drop_hints(input.get(), false);
+- HBFace subset(hb_subset(face.get(), input.get()));
++ HBFace subset = SkPDFHarfBuzzSubset<hb_subset_input_t*>::Make(input.get(), face.get());
++ if (!subset) {
++ return nullptr;
++ }
+ HBBlob result(hb_face_reference_blob(subset.get()));
+ return to_data(std::move(result));
+ }
+diff --git a/third_party/harfbuzz/BUILD.gn b/third_party/harfbuzz/BUILD.gn
+index 173830de62..4156607ef9 100644
+--- a/third_party/harfbuzz/BUILD.gn
++++ b/third_party/harfbuzz/BUILD.gn
+@@ -14,6 +14,9 @@ if (skia_use_system_harfbuzz) {
+ "harfbuzz",
+ "harfbuzz-icu",
+ ]
++ if (skia_pdf_subset_harfbuzz) {
++ libs += [ "harfbuzz-subset" ]
++ }
+ }
+ } else {
+ third_party("harfbuzz") {
Deleted: sql-make-VirtualCursor-standard-layout-type.patch
===================================================================
--- sql-make-VirtualCursor-standard-layout-type.patch 2021-11-18 10:43:47 UTC (rev 1052068)
+++ sql-make-VirtualCursor-standard-layout-type.patch 2021-11-18 10:44:09 UTC (rev 1052069)
@@ -1,238 +0,0 @@
-From 80368f8ba7a8bab13440463a254888311efe3986 Mon Sep 17 00:00:00 2001
-From: Stephan Hartmann <stha09 at googlemail.com>
-Date: Tue, 4 May 2021 15:00:19 +0000
-Subject: [PATCH] sql: make VirtualCursor standard layout type
-
-sql::recover::VirtualCursor needs to be a standard layout type, but
-has members of type std::unique_ptr. However, std::unique_ptr is not
-guaranteed to be standard layout. Compiling with clang combined with
-gcc-11 libstdc++ fails because of this. Replace std::unique_ptr with
-raw pointers.
-
-Bug: 1189788
-Change-Id: Ia6dc388cc5ef1c0f2afc75f8ca45b9f12687ca9c
----
- sql/recover_module/btree.cc | 21 +++++++++++++++------
- sql/recover_module/btree.h | 17 +++++++++++++----
- sql/recover_module/cursor.cc | 24 ++++++++++++------------
- sql/recover_module/cursor.h | 2 +-
- sql/recover_module/pager.cc | 7 +++----
- sql/recover_module/pager.h | 5 +++--
- 6 files changed, 47 insertions(+), 29 deletions(-)
-
-diff --git a/sql/recover_module/btree.cc b/sql/recover_module/btree.cc
-index 9ecaafe8a3..839318abf9 100644
---- a/sql/recover_module/btree.cc
-+++ b/sql/recover_module/btree.cc
-@@ -135,16 +135,25 @@ static_assert(std::is_trivially_destructible<LeafPageDecoder>::value,
- "Move the destructor to the .cc file if it's non-trival");
- #endif // !DCHECK_IS_ON()
-
--LeafPageDecoder::LeafPageDecoder(DatabasePageReader* db_reader) noexcept
-- : page_id_(db_reader->page_id()),
-- db_reader_(db_reader),
-- cell_count_(ComputeCellCount(db_reader)),
-- next_read_index_(0),
-- last_record_size_(0) {
-+void LeafPageDecoder::Initialize(DatabasePageReader* db_reader) {
-+ DCHECK(db_reader);
- DCHECK(IsOnValidPage(db_reader));
-+ page_id_ = db_reader->page_id();
-+ db_reader_ = db_reader;
-+ cell_count_ = ComputeCellCount(db_reader);
-+ next_read_index_ = 0;
-+ last_record_size_ = 0;
- DCHECK(DatabasePageReader::IsValidPageId(page_id_));
- }
-
-+void LeafPageDecoder::Reset() {
-+ db_reader_ = nullptr;
-+ page_id_ = 0;
-+ cell_count_ = 0;
-+ next_read_index_ = 0;
-+ last_record_size_ = 0;
-+}
-+
- bool LeafPageDecoder::TryAdvance() {
- DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
- DCHECK(CanAdvance());
-diff --git a/sql/recover_module/btree.h b/sql/recover_module/btree.h
-index d76d076bf6..33114b01fa 100644
---- a/sql/recover_module/btree.h
-+++ b/sql/recover_module/btree.h
-@@ -102,7 +102,7 @@ class LeafPageDecoder {
- //
- // |db_reader| must have been used to read an inner page of a table B-tree.
- // |db_reader| must outlive this instance.
-- explicit LeafPageDecoder(DatabasePageReader* db_reader) noexcept;
-+ explicit LeafPageDecoder() noexcept = default;
- ~LeafPageDecoder() noexcept = default;
-
- LeafPageDecoder(const LeafPageDecoder&) = delete;
-@@ -150,6 +150,15 @@ class LeafPageDecoder {
- // read as long as CanAdvance() returns true.
- bool TryAdvance();
-
-+ // Initialize with DatabasePageReader
-+ void Initialize(DatabasePageReader* db_reader);
-+
-+ // Reset internal DatabasePageReader
-+ void Reset();
-+
-+ // True if DatabasePageReader is valid
-+ bool IsValid() { return (db_reader_ != nullptr); }
-+
- // True if the given reader may point to an inner page in a table B-tree.
- //
- // The last ReadPage() call on |db_reader| must have succeeded.
-@@ -163,14 +172,14 @@ class LeafPageDecoder {
- static int ComputeCellCount(DatabasePageReader* db_reader);
-
- // The number of the B-tree page this reader is reading.
-- const int64_t page_id_;
-+ int64_t page_id_;
- // Used to read the tree page.
- //
- // Raw pointer usage is acceptable because this instance's owner is expected
- // to ensure that the DatabasePageReader outlives this.
-- DatabasePageReader* const db_reader_;
-+ DatabasePageReader* db_reader_;
- // Caches the ComputeCellCount() value for this reader's page.
-- const int cell_count_ = ComputeCellCount(db_reader_);
-+ int cell_count_;
-
- // The reader's cursor state.
- //
-diff --git a/sql/recover_module/cursor.cc b/sql/recover_module/cursor.cc
-index 0029ff9295..42548bc4b5 100644
---- a/sql/recover_module/cursor.cc
-+++ b/sql/recover_module/cursor.cc
-@@ -26,7 +26,7 @@ VirtualCursor::~VirtualCursor() {
- int VirtualCursor::First() {
- DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
- inner_decoders_.clear();
-- leaf_decoder_ = nullptr;
-+ leaf_decoder_.Reset();
-
- AppendPageDecoder(table_->root_page_id());
- return Next();
-@@ -36,18 +36,18 @@ int VirtualCursor::Next() {
- DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
- record_reader_.Reset();
-
-- while (!inner_decoders_.empty() || leaf_decoder_.get()) {
-- if (leaf_decoder_.get()) {
-- if (!leaf_decoder_->CanAdvance()) {
-+ while (!inner_decoders_.empty() || leaf_decoder_.IsValid()) {
-+ if (leaf_decoder_.IsValid()) {
-+ if (!leaf_decoder_.CanAdvance()) {
- // The leaf has been exhausted. Remove it from the DFS stack.
-- leaf_decoder_ = nullptr;
-+ leaf_decoder_.Reset();
- continue;
- }
-- if (!leaf_decoder_->TryAdvance())
-+ if (!leaf_decoder_.TryAdvance())
- continue;
-
-- if (!payload_reader_.Initialize(leaf_decoder_->last_record_size(),
-- leaf_decoder_->last_record_offset())) {
-+ if (!payload_reader_.Initialize(leaf_decoder_.last_record_size(),
-+ leaf_decoder_.last_record_offset())) {
- continue;
- }
- if (!record_reader_.Initialize())
-@@ -99,13 +99,13 @@ int VirtualCursor::ReadColumn(int column_index,
- int64_t VirtualCursor::RowId() {
- DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
- DCHECK(record_reader_.IsInitialized());
-- DCHECK(leaf_decoder_.get());
-- return leaf_decoder_->last_record_rowid();
-+ DCHECK(leaf_decoder_.IsValid());
-+ return leaf_decoder_.last_record_rowid();
- }
-
- void VirtualCursor::AppendPageDecoder(int page_id) {
- DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
-- DCHECK(leaf_decoder_.get() == nullptr)
-+ DCHECK(!leaf_decoder_.IsValid())
- << __func__
- << " must only be called when the current path has no leaf decoder";
-
-@@ -113,7 +113,7 @@ void VirtualCursor::AppendPageDecoder(int page_id) {
- return;
-
- if (LeafPageDecoder::IsOnValidPage(&db_reader_)) {
-- leaf_decoder_ = std::make_unique<LeafPageDecoder>(&db_reader_);
-+ leaf_decoder_.Initialize(&db_reader_);
- return;
- }
-
-diff --git a/sql/recover_module/cursor.h b/sql/recover_module/cursor.h
-index afcd6900e1..b15c31d425 100644
---- a/sql/recover_module/cursor.h
-+++ b/sql/recover_module/cursor.h
-@@ -129,7 +129,7 @@ class VirtualCursor {
- std::vector<std::unique_ptr<InnerPageDecoder>> inner_decoders_;
-
- // Decodes the leaf page containing records.
-- std::unique_ptr<LeafPageDecoder> leaf_decoder_;
-+ LeafPageDecoder leaf_decoder_;
-
- SEQUENCE_CHECKER(sequence_checker_);
- };
-diff --git a/sql/recover_module/pager.cc b/sql/recover_module/pager.cc
-index 58e75de270..5fe96204e5 100644
---- a/sql/recover_module/pager.cc
-+++ b/sql/recover_module/pager.cc
-@@ -23,8 +23,7 @@ static_assert(DatabasePageReader::kMaxPageId <= std::numeric_limits<int>::max(),
- "ints are not appropriate for representing page IDs");
-
- DatabasePageReader::DatabasePageReader(VirtualTable* table)
-- : page_data_(std::make_unique<uint8_t[]>(table->page_size())),
-- table_(table) {
-+ : page_data_(), table_(table) {
- DCHECK(table != nullptr);
- DCHECK(IsValidPageSize(table->page_size()));
- }
-@@ -57,8 +56,8 @@ int DatabasePageReader::ReadPage(int page_id) {
- std::numeric_limits<int64_t>::max(),
- "The |read_offset| computation above may overflow");
-
-- int sqlite_status =
-- RawRead(sqlite_file, read_size, read_offset, page_data_.get());
-+ int sqlite_status = RawRead(sqlite_file, read_size, read_offset,
-+ const_cast<uint8_t*>(page_data_.data()));
-
- // |page_id_| needs to be set to kInvalidPageId if the read failed.
- // Otherwise, future ReadPage() calls with the previous |page_id_| value
-diff --git a/sql/recover_module/pager.h b/sql/recover_module/pager.h
-index 0e388ddc3b..99314e30ff 100644
---- a/sql/recover_module/pager.h
-+++ b/sql/recover_module/pager.h
-@@ -5,6 +5,7 @@
- #ifndef SQL_RECOVER_MODULE_PAGER_H_
- #define SQL_RECOVER_MODULE_PAGER_H_
-
-+#include <array>
- #include <cstdint>
- #include <memory>
-
-@@ -70,7 +71,7 @@ class DatabasePageReader {
- DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
- DCHECK_NE(page_id_, kInvalidPageId)
- << "Successful ReadPage() required before accessing pager state";
-- return page_data_.get();
-+ return page_data_.data();
- }
-
- // The number of bytes in the page read by the last ReadPage() call.
-@@ -137,7 +138,7 @@ class DatabasePageReader {
- int page_id_ = kInvalidPageId;
- // Stores the bytes of the last page successfully read by ReadPage().
- // The content is undefined if the last call to ReadPage() did not succeed.
-- const std::unique_ptr<uint8_t[]> page_data_;
-+ const std::array<uint8_t, kMaxPageSize> page_data_;
- // Raw pointer usage is acceptable because this instance's owner is expected
- // to ensure that the VirtualTable outlives this.
- VirtualTable* const table_;
Copied: electron13/repos/community-x86_64/sql-make-VirtualCursor-standard-layout-type.patch (from rev 1052068, electron13/trunk/sql-make-VirtualCursor-standard-layout-type.patch)
===================================================================
--- sql-make-VirtualCursor-standard-layout-type.patch (rev 0)
+++ sql-make-VirtualCursor-standard-layout-type.patch 2021-11-18 10:44:09 UTC (rev 1052069)
@@ -0,0 +1,238 @@
+From 80368f8ba7a8bab13440463a254888311efe3986 Mon Sep 17 00:00:00 2001
+From: Stephan Hartmann <stha09 at googlemail.com>
+Date: Tue, 4 May 2021 15:00:19 +0000
+Subject: [PATCH] sql: make VirtualCursor standard layout type
+
+sql::recover::VirtualCursor needs to be a standard layout type, but
+has members of type std::unique_ptr. However, std::unique_ptr is not
+guaranteed to be standard layout. Compiling with clang combined with
+gcc-11 libstdc++ fails because of this. Replace std::unique_ptr with
+raw pointers.
+
+Bug: 1189788
+Change-Id: Ia6dc388cc5ef1c0f2afc75f8ca45b9f12687ca9c
+---
+ sql/recover_module/btree.cc | 21 +++++++++++++++------
+ sql/recover_module/btree.h | 17 +++++++++++++----
+ sql/recover_module/cursor.cc | 24 ++++++++++++------------
+ sql/recover_module/cursor.h | 2 +-
+ sql/recover_module/pager.cc | 7 +++----
+ sql/recover_module/pager.h | 5 +++--
+ 6 files changed, 47 insertions(+), 29 deletions(-)
+
+diff --git a/sql/recover_module/btree.cc b/sql/recover_module/btree.cc
+index 9ecaafe8a3..839318abf9 100644
+--- a/sql/recover_module/btree.cc
++++ b/sql/recover_module/btree.cc
+@@ -135,16 +135,25 @@ static_assert(std::is_trivially_destructible<LeafPageDecoder>::value,
+ "Move the destructor to the .cc file if it's non-trival");
+ #endif // !DCHECK_IS_ON()
+
+-LeafPageDecoder::LeafPageDecoder(DatabasePageReader* db_reader) noexcept
+- : page_id_(db_reader->page_id()),
+- db_reader_(db_reader),
+- cell_count_(ComputeCellCount(db_reader)),
+- next_read_index_(0),
+- last_record_size_(0) {
++void LeafPageDecoder::Initialize(DatabasePageReader* db_reader) {
++ DCHECK(db_reader);
+ DCHECK(IsOnValidPage(db_reader));
++ page_id_ = db_reader->page_id();
++ db_reader_ = db_reader;
++ cell_count_ = ComputeCellCount(db_reader);
++ next_read_index_ = 0;
++ last_record_size_ = 0;
+ DCHECK(DatabasePageReader::IsValidPageId(page_id_));
+ }
+
++void LeafPageDecoder::Reset() {
++ db_reader_ = nullptr;
++ page_id_ = 0;
++ cell_count_ = 0;
++ next_read_index_ = 0;
++ last_record_size_ = 0;
++}
++
+ bool LeafPageDecoder::TryAdvance() {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+ DCHECK(CanAdvance());
+diff --git a/sql/recover_module/btree.h b/sql/recover_module/btree.h
+index d76d076bf6..33114b01fa 100644
+--- a/sql/recover_module/btree.h
++++ b/sql/recover_module/btree.h
+@@ -102,7 +102,7 @@ class LeafPageDecoder {
+ //
+ // |db_reader| must have been used to read an inner page of a table B-tree.
+ // |db_reader| must outlive this instance.
+- explicit LeafPageDecoder(DatabasePageReader* db_reader) noexcept;
++ explicit LeafPageDecoder() noexcept = default;
+ ~LeafPageDecoder() noexcept = default;
+
+ LeafPageDecoder(const LeafPageDecoder&) = delete;
+@@ -150,6 +150,15 @@ class LeafPageDecoder {
+ // read as long as CanAdvance() returns true.
+ bool TryAdvance();
+
++ // Initialize with DatabasePageReader
++ void Initialize(DatabasePageReader* db_reader);
++
++ // Reset internal DatabasePageReader
++ void Reset();
++
++ // True if DatabasePageReader is valid
++ bool IsValid() { return (db_reader_ != nullptr); }
++
+ // True if the given reader may point to an inner page in a table B-tree.
+ //
+ // The last ReadPage() call on |db_reader| must have succeeded.
+@@ -163,14 +172,14 @@ class LeafPageDecoder {
+ static int ComputeCellCount(DatabasePageReader* db_reader);
+
+ // The number of the B-tree page this reader is reading.
+- const int64_t page_id_;
++ int64_t page_id_;
+ // Used to read the tree page.
+ //
+ // Raw pointer usage is acceptable because this instance's owner is expected
+ // to ensure that the DatabasePageReader outlives this.
+- DatabasePageReader* const db_reader_;
++ DatabasePageReader* db_reader_;
+ // Caches the ComputeCellCount() value for this reader's page.
+- const int cell_count_ = ComputeCellCount(db_reader_);
++ int cell_count_;
+
+ // The reader's cursor state.
+ //
+diff --git a/sql/recover_module/cursor.cc b/sql/recover_module/cursor.cc
+index 0029ff9295..42548bc4b5 100644
+--- a/sql/recover_module/cursor.cc
++++ b/sql/recover_module/cursor.cc
+@@ -26,7 +26,7 @@ VirtualCursor::~VirtualCursor() {
+ int VirtualCursor::First() {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+ inner_decoders_.clear();
+- leaf_decoder_ = nullptr;
++ leaf_decoder_.Reset();
+
+ AppendPageDecoder(table_->root_page_id());
+ return Next();
+@@ -36,18 +36,18 @@ int VirtualCursor::Next() {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+ record_reader_.Reset();
+
+- while (!inner_decoders_.empty() || leaf_decoder_.get()) {
+- if (leaf_decoder_.get()) {
+- if (!leaf_decoder_->CanAdvance()) {
++ while (!inner_decoders_.empty() || leaf_decoder_.IsValid()) {
++ if (leaf_decoder_.IsValid()) {
++ if (!leaf_decoder_.CanAdvance()) {
+ // The leaf has been exhausted. Remove it from the DFS stack.
+- leaf_decoder_ = nullptr;
++ leaf_decoder_.Reset();
+ continue;
+ }
+- if (!leaf_decoder_->TryAdvance())
++ if (!leaf_decoder_.TryAdvance())
+ continue;
+
+- if (!payload_reader_.Initialize(leaf_decoder_->last_record_size(),
+- leaf_decoder_->last_record_offset())) {
++ if (!payload_reader_.Initialize(leaf_decoder_.last_record_size(),
++ leaf_decoder_.last_record_offset())) {
+ continue;
+ }
+ if (!record_reader_.Initialize())
+@@ -99,13 +99,13 @@ int VirtualCursor::ReadColumn(int column_index,
+ int64_t VirtualCursor::RowId() {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+ DCHECK(record_reader_.IsInitialized());
+- DCHECK(leaf_decoder_.get());
+- return leaf_decoder_->last_record_rowid();
++ DCHECK(leaf_decoder_.IsValid());
++ return leaf_decoder_.last_record_rowid();
+ }
+
+ void VirtualCursor::AppendPageDecoder(int page_id) {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+- DCHECK(leaf_decoder_.get() == nullptr)
++ DCHECK(!leaf_decoder_.IsValid())
+ << __func__
+ << " must only be called when the current path has no leaf decoder";
+
+@@ -113,7 +113,7 @@ void VirtualCursor::AppendPageDecoder(int page_id) {
+ return;
+
+ if (LeafPageDecoder::IsOnValidPage(&db_reader_)) {
+- leaf_decoder_ = std::make_unique<LeafPageDecoder>(&db_reader_);
++ leaf_decoder_.Initialize(&db_reader_);
+ return;
+ }
+
+diff --git a/sql/recover_module/cursor.h b/sql/recover_module/cursor.h
+index afcd6900e1..b15c31d425 100644
+--- a/sql/recover_module/cursor.h
++++ b/sql/recover_module/cursor.h
+@@ -129,7 +129,7 @@ class VirtualCursor {
+ std::vector<std::unique_ptr<InnerPageDecoder>> inner_decoders_;
+
+ // Decodes the leaf page containing records.
+- std::unique_ptr<LeafPageDecoder> leaf_decoder_;
++ LeafPageDecoder leaf_decoder_;
+
+ SEQUENCE_CHECKER(sequence_checker_);
+ };
+diff --git a/sql/recover_module/pager.cc b/sql/recover_module/pager.cc
+index 58e75de270..5fe96204e5 100644
+--- a/sql/recover_module/pager.cc
++++ b/sql/recover_module/pager.cc
+@@ -23,8 +23,7 @@ static_assert(DatabasePageReader::kMaxPageId <= std::numeric_limits<int>::max(),
+ "ints are not appropriate for representing page IDs");
+
+ DatabasePageReader::DatabasePageReader(VirtualTable* table)
+- : page_data_(std::make_unique<uint8_t[]>(table->page_size())),
+- table_(table) {
++ : page_data_(), table_(table) {
+ DCHECK(table != nullptr);
+ DCHECK(IsValidPageSize(table->page_size()));
+ }
+@@ -57,8 +56,8 @@ int DatabasePageReader::ReadPage(int page_id) {
+ std::numeric_limits<int64_t>::max(),
+ "The |read_offset| computation above may overflow");
+
+- int sqlite_status =
+- RawRead(sqlite_file, read_size, read_offset, page_data_.get());
++ int sqlite_status = RawRead(sqlite_file, read_size, read_offset,
++ const_cast<uint8_t*>(page_data_.data()));
+
+ // |page_id_| needs to be set to kInvalidPageId if the read failed.
+ // Otherwise, future ReadPage() calls with the previous |page_id_| value
+diff --git a/sql/recover_module/pager.h b/sql/recover_module/pager.h
+index 0e388ddc3b..99314e30ff 100644
+--- a/sql/recover_module/pager.h
++++ b/sql/recover_module/pager.h
+@@ -5,6 +5,7 @@
+ #ifndef SQL_RECOVER_MODULE_PAGER_H_
+ #define SQL_RECOVER_MODULE_PAGER_H_
+
++#include <array>
+ #include <cstdint>
+ #include <memory>
+
+@@ -70,7 +71,7 @@ class DatabasePageReader {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+ DCHECK_NE(page_id_, kInvalidPageId)
+ << "Successful ReadPage() required before accessing pager state";
+- return page_data_.get();
++ return page_data_.data();
+ }
+
+ // The number of bytes in the page read by the last ReadPage() call.
+@@ -137,7 +138,7 @@ class DatabasePageReader {
+ int page_id_ = kInvalidPageId;
+ // Stores the bytes of the last page successfully read by ReadPage().
+ // The content is undefined if the last call to ReadPage() did not succeed.
+- const std::unique_ptr<uint8_t[]> page_data_;
++ const std::array<uint8_t, kMaxPageSize> page_data_;
+ // Raw pointer usage is acceptable because this instance's owner is expected
+ // to ensure that the VirtualTable outlives this.
+ VirtualTable* const table_;
Copied: electron13/repos/community-x86_64/unbundle-fix-visibility-of-build-config-freetype.patch (from rev 1052068, electron13/trunk/unbundle-fix-visibility-of-build-config-freetype.patch)
===================================================================
--- unbundle-fix-visibility-of-build-config-freetype.patch (rev 0)
+++ unbundle-fix-visibility-of-build-config-freetype.patch 2021-11-18 10:44:09 UTC (rev 1052069)
@@ -0,0 +1,31 @@
+From 271e45339b7b969e98ccef7837cb1b15480b07fc Mon Sep 17 00:00:00 2001
+From: Stephan Hartmann <stha09 at googlemail.com>
+Date: Thu, 4 Nov 2021 18:58:34 +0000
+Subject: [PATCH] unbundle: fix visibility of //build/config/freetype
+
+For system freetype //build/linux:freetype_from_pkgconfig is restricted
+to //third_party:freetype_harfbuzz and //third_party/harfbuzz-ng:harfbuzz_source.
+However //build/config/freetype:freetype is accessing it too.
+
+Bug: None
+Change-Id: Ic4a37b01e4ae221372a9220cbad04c598b844c21
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3259304
+Commit-Queue: Thomas Anderson <thomasanderson at chromium.org>
+Reviewed-by: Thomas Anderson <thomasanderson at chromium.org>
+Cr-Commit-Position: refs/heads/main@{#938388}
+---
+ build/linux/BUILD.gn | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/build/linux/BUILD.gn b/build/linux/BUILD.gn
+index 54314c7687..cd49e3d524 100644
+--- a/build/linux/BUILD.gn
++++ b/build/linux/BUILD.gn
+@@ -23,6 +23,7 @@ if (use_system_freetype) {
+ # the system, use with caution,for details see build/config/freetype/BUILD.gn.
+ pkg_config("freetype_from_pkgconfig") {
+ visibility = [
++ "//build/config/freetype:freetype",
+ "//third_party:freetype_harfbuzz",
+ "//third_party/harfbuzz-ng:harfbuzz_source",
+ ]
Deleted: unbundle-use-char16_t-as-UCHAR_TYPE.patch
===================================================================
--- unbundle-use-char16_t-as-UCHAR_TYPE.patch 2021-11-18 10:43:47 UTC (rev 1052068)
+++ unbundle-use-char16_t-as-UCHAR_TYPE.patch 2021-11-18 10:44:09 UTC (rev 1052069)
@@ -1,30 +0,0 @@
-From 79819c94f27524005889def53740c97a32cd7747 Mon Sep 17 00:00:00 2001
-From: Stephan Hartmann <stha09 at googlemail.com>
-Date: Fri, 16 Apr 2021 20:57:15 +0000
-Subject: [PATCH] [unbundle] Use char16_t as UCHAR_TYPE
-
-Overriding UCHAR_TYPE was dropped with:
-https://chromium-review.googlesource.com/c/chromium/deps/icu/+/2732628
-
-Bug: 911896
-Change-Id: I4c1172aab445c82ba247b1162b8484ed0db9c381
-Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2830820
-Commit-Queue: Stephan Hartmann <stha09 at googlemail.com>
-Reviewed-by: Lei Zhang <thestig at chromium.org>
-Cr-Commit-Position: refs/heads/master@{#873470}
----
- build/linux/unbundle/icu.gn | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/build/linux/unbundle/icu.gn b/build/linux/unbundle/icu.gn
-index 0f52fc11e79e6..6f3f8438bd854 100644
---- a/build/linux/unbundle/icu.gn
-+++ b/build/linux/unbundle/icu.gn
-@@ -16,7 +16,6 @@ config("icu_config") {
- defines = [
- "USING_SYSTEM_ICU=1",
- "ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC",
-- "UCHAR_TYPE=uint16_t",
-
- # U_EXPORT (defined in unicode/platform.h) is used to set public visibility
- # on classes through the U_COMMON_API and U_I18N_API macros (among others).
Copied: electron13/repos/community-x86_64/unbundle-use-char16_t-as-UCHAR_TYPE.patch (from rev 1052068, electron13/trunk/unbundle-use-char16_t-as-UCHAR_TYPE.patch)
===================================================================
--- unbundle-use-char16_t-as-UCHAR_TYPE.patch (rev 0)
+++ unbundle-use-char16_t-as-UCHAR_TYPE.patch 2021-11-18 10:44:09 UTC (rev 1052069)
@@ -0,0 +1,30 @@
+From 79819c94f27524005889def53740c97a32cd7747 Mon Sep 17 00:00:00 2001
+From: Stephan Hartmann <stha09 at googlemail.com>
+Date: Fri, 16 Apr 2021 20:57:15 +0000
+Subject: [PATCH] [unbundle] Use char16_t as UCHAR_TYPE
+
+Overriding UCHAR_TYPE was dropped with:
+https://chromium-review.googlesource.com/c/chromium/deps/icu/+/2732628
+
+Bug: 911896
+Change-Id: I4c1172aab445c82ba247b1162b8484ed0db9c381
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2830820
+Commit-Queue: Stephan Hartmann <stha09 at googlemail.com>
+Reviewed-by: Lei Zhang <thestig at chromium.org>
+Cr-Commit-Position: refs/heads/master@{#873470}
+---
+ build/linux/unbundle/icu.gn | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/build/linux/unbundle/icu.gn b/build/linux/unbundle/icu.gn
+index 0f52fc11e79e6..6f3f8438bd854 100644
+--- a/build/linux/unbundle/icu.gn
++++ b/build/linux/unbundle/icu.gn
+@@ -16,7 +16,6 @@ config("icu_config") {
+ defines = [
+ "USING_SYSTEM_ICU=1",
+ "ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC",
+- "UCHAR_TYPE=uint16_t",
+
+ # U_EXPORT (defined in unicode/platform.h) is used to set public visibility
+ # on classes through the U_COMMON_API and U_I18N_API macros (among others).
Deleted: use-system-libraries-in-node.patch
===================================================================
--- use-system-libraries-in-node.patch 2021-11-18 10:43:47 UTC (rev 1052068)
+++ use-system-libraries-in-node.patch 2021-11-18 10:44:09 UTC (rev 1052069)
@@ -1,52 +0,0 @@
---- a/third_party/electron_node/BUILD.gn
-+++ b/third_party/electron_node/BUILD.gn
-@@ -42,6 +42,18 @@
- node_module_version = ""
- }
-
-+if (is_linux) {
-+ import("//build/config/linux/pkg_config.gni")
-+
-+ pkg_config("cares") {
-+ packages = [ "libcares" ]
-+ }
-+
-+ pkg_config("nghttp2") {
-+ packages = [ "libnghttp2" ]
-+ }
-+}
-+
- assert(!node_use_dtrace, "node_use_dtrace not supported in GN")
- assert(!node_use_etw, "node_use_etw not supported in GN")
-
-@@ -190,10 +202,8 @@
- component("node_lib") {
- deps = [
- ":node_js2c",
-- "deps/cares",
- "deps/histogram",
- "deps/llhttp",
-- "deps/nghttp2",
- "deps/uvwasi",
- "//third_party/zlib",
- "//third_party/brotli:dec",
-@@ -209,6 +219,19 @@
- public_configs = [ ":node_lib_config" ]
- include_dirs = [ "src" ]
- libs = []
-+ if (is_linux) {
-+ configs += [
-+ ":cares",
-+ ":nghttp2",
-+ ]
-+ libs += [ "http_parser" ]
-+ } else {
-+ deps += [
-+ "deps/cares",
-+ "deps/http_parser",
-+ "deps/nghttp2",
-+ ]
-+ }
- frameworks = []
- cflags_cc = [
- "-Wno-deprecated-declarations",
Copied: electron13/repos/community-x86_64/use-system-libraries-in-node.patch (from rev 1052068, electron13/trunk/use-system-libraries-in-node.patch)
===================================================================
--- use-system-libraries-in-node.patch (rev 0)
+++ use-system-libraries-in-node.patch 2021-11-18 10:44:09 UTC (rev 1052069)
@@ -0,0 +1,52 @@
+--- a/third_party/electron_node/BUILD.gn
++++ b/third_party/electron_node/BUILD.gn
+@@ -42,6 +42,18 @@
+ node_module_version = ""
+ }
+
++if (is_linux) {
++ import("//build/config/linux/pkg_config.gni")
++
++ pkg_config("cares") {
++ packages = [ "libcares" ]
++ }
++
++ pkg_config("nghttp2") {
++ packages = [ "libnghttp2" ]
++ }
++}
++
+ assert(!node_use_dtrace, "node_use_dtrace not supported in GN")
+ assert(!node_use_etw, "node_use_etw not supported in GN")
+
+@@ -190,10 +202,8 @@
+ component("node_lib") {
+ deps = [
+ ":node_js2c",
+- "deps/cares",
+ "deps/histogram",
+ "deps/llhttp",
+- "deps/nghttp2",
+ "deps/uvwasi",
+ "//third_party/zlib",
+ "//third_party/brotli:dec",
+@@ -209,6 +219,19 @@
+ public_configs = [ ":node_lib_config" ]
+ include_dirs = [ "src" ]
+ libs = []
++ if (is_linux) {
++ configs += [
++ ":cares",
++ ":nghttp2",
++ ]
++ libs += [ "http_parser" ]
++ } else {
++ deps += [
++ "deps/cares",
++ "deps/http_parser",
++ "deps/nghttp2",
++ ]
++ }
+ frameworks = []
+ cflags_cc = [
+ "-Wno-deprecated-declarations",
More information about the arch-commits
mailing list