├── README.md ├── _scripts ├── atom.template.ebuild ├── ebuild-gen.py ├── get-chromium-source-for-electron.py └── vscode.template.ebuild ├── app-editors └── vscode │ ├── Manifest │ ├── files │ ├── gyp-unbundle.py │ ├── unbundle-electron-insiders.patch │ ├── unbundle-electron-r2.patch │ ├── unbundle-electron-r3.patch │ └── unbundle-ripgrep-r2.patch │ ├── metadata.xml │ ├── vscode-1.74.2.ebuild │ ├── vscode-1.75.1.ebuild │ ├── vscode-1.79.2.ebuild │ ├── vscode-1.80.1.ebuild │ ├── vscode-1.90.0.ebuild │ ├── vscode-1.90.2.ebuild │ ├── vscode-1.93.1.ebuild │ ├── vscode-1.94.2.ebuild │ └── vscode-1.95.1.ebuild ├── app-eselect └── eselect-electron │ ├── Manifest │ ├── eselect-electron-2.1.ebuild │ └── metadata.xml ├── dev-util └── electron │ ├── Manifest │ ├── electron-19.0.16-r1.ebuild │ ├── electron-19.1.9.ebuild │ ├── electron-22.3.11.ebuild │ ├── electron-29.4.3.ebuild │ ├── electron-30.5.1.ebuild │ ├── electron-32.2.2.ebuild │ ├── files │ ├── chromium-101-libxml-unbundle.patch │ ├── chromium-106-python3_11.patch │ ├── chromium-107-system-zlib.patch │ ├── chromium-108-DocumentLoader-private.patch │ ├── chromium-108-EnumTable-crash.patch │ ├── chromium-108-binutils-2.41.patch │ ├── chromium-108-debug-build-fixes.patch │ ├── chromium-108-glslang.patch │ ├── chromium-108-revert-GlobalMediaControlsCastStartStop.patch │ ├── chromium-109-system-zlib.patch │ ├── chromium-111-InkDropHost-crash.patch │ ├── chromium-112-sql-relax.patch │ ├── chromium-117-system-zstd.patch │ ├── chromium-119.0.6045.159-icu-74.patch │ ├── chromium-124-libwebp-shim-sharpyuv.patch │ ├── chromium-125-ninja-1-12.patch │ ├── chromium-126-oauth2-client-switches.patch │ ├── chromium-127-bindgen-custom-toolchain.patch │ ├── chromium-127-updater-systemd.patch │ ├── chromium-87-sql-make-VirtualCursor-standard-layout-type.patch │ ├── chromium-89-EnumTable-crash.patch │ ├── chromium-93-InkDropHost-crash.patch │ ├── chromium-97-arm-tflite-cast.patch │ ├── chromium-98-EnumTable-crash.patch │ ├── chromium-98-gtk4-build.patch │ ├── chromium-cross-compile.patch │ ├── chromium-shim_headers.patch │ ├── chromium-use-oauth2-client-switches-as-default.patch │ ├── electron-carve-out-binary-patches.patch │ ├── electron-enable-qt-support-r1.patch │ ├── electron-enable-qt-support.patch │ ├── electron-fix-node-openssl3-build.patch │ ├── electron-gcc-fixes.patch │ ├── electron-gn-config.patch │ ├── electron-launcher.sh │ ├── electron-node-config-r1.patch │ ├── electron-node-config.patch │ ├── electron-node-unbundle-deps.patch │ ├── electron-patch-fixup-r1.patch │ ├── electron-patch-fixup.patch │ ├── electron-remove-reliance-on-git-repo.patch │ ├── electron-std-vector-non-const.patch │ ├── electron-use-published-nan.patch │ ├── fix_patches.py │ ├── fix_patches_r1.py │ └── node-openssl-fips-decl-r1.patch │ └── metadata.xml ├── electron-overlay.xml ├── licenses └── MS-vscode ├── metadata ├── .gitignore └── layout.conf └── profiles ├── eapi ├── package.mask ├── package.use.mask └── repo_name /README.md: -------------------------------------------------------------------------------- 1 | Gentoo Overlay for Electron and some Electron-based apps 2 | ======================================================== 3 | 4 | Installation 5 | ------------ 6 | 7 | layman -a electron 8 | -------------------------------------------------------------------------------- /_scripts/atom.template.ebuild: -------------------------------------------------------------------------------- 1 | # Copyright 1999-2018 Gentoo Authors 2 | # Distributed under the terms of the GNU General Public License v2 3 | 4 | # NOTE: this ebuild has been generated by atom-ebuild-gen.py from the 5 | # atom overlay. If you would like to make changes, please consider 6 | # modifying the ebuild template and submitting a PR to 7 | # https://github.com/elprans/atom-overlay. 8 | 9 | EAPI=7 10 | 11 | PYTHON_COMPAT=( python2_7 ) 12 | inherit multiprocessing python-single-r1 rpm xdg-utils 13 | 14 | DESCRIPTION="A hackable text editor for the 21st Century" 15 | HOMEPAGE="https://atom.io" 16 | MY_PV="${PV//_/-}" 17 | 18 | ELECTRON_V=@@{ELECTRON_V} 19 | ELECTRON_SLOT=@@{ELECTRON_S} 20 | 21 | ASAR_V=0.14.3 22 | # All binary packages depend on this 23 | NAN_V=2.11.1 24 | 25 | @@{BINMOD_VERSIONS} 26 | 27 | # The x86_64 arch below is irrelevant, as we will rebuild all binary packages. 28 | SRC_URI=" 29 | https://github.com/${PN}/${PN}/releases/download/v${MY_PV}/atom.x86_64.rpm -> atom-bin-${MY_PV}.rpm 30 | https://github.com/${PN}/${PN}/archive/v${MY_PV}.tar.gz -> atom-${MY_PV}.tar.gz 31 | https://github.com/elprans/asar/releases/download/v${ASAR_V}-gentoo/asar-build.tar.gz -> asar-${ASAR_V}.tar.gz 32 | https://github.com/nodejs/nan/archive/v${NAN_V}.tar.gz -> nodejs-nan-${NAN_V}.tar.gz 33 | @@{SRC_URI} 34 | " 35 | 36 | BINMODS=( 37 | @@{BINMODS} 38 | ) 39 | 40 | LICENSE="MIT" 41 | SLOT="@@{SLOT}" 42 | KEYWORDS="@@{KEYWORDS}" 43 | IUSE="" 44 | REQUIRED_USE="${PYTHON_REQUIRED_USE}" 45 | 46 | BDEPEND=" 47 | ${PYTHON_DEPS} 48 | >=dev-util/electron-${ELECTRON_V}:${ELECTRON_SLOT} 49 | " 50 | 51 | DEPEND=" 52 | >=app-text/hunspell-1.3.3:= 53 | >=dev-libs/libgit2-0.23:=[ssh] 54 | >=dev-libs/libpcre2-10.22:=[jit,pcre16] 55 | >=dev-libs/oniguruma-6.6.0:= 56 | >=dev-util/ctags-5.8 57 | >=gnome-base/libgnome-keyring-3.12:= 58 | x11-libs/libxkbfile 59 | " 60 | 61 | RDEPEND=" 62 | ${DEPEND} 63 | >=dev-util/electron-${ELECTRON_V}:${ELECTRON_SLOT} 64 | dev-vcs/git 65 | !sys-apps/apmd 66 | " 67 | 68 | S="${WORKDIR}/${PN}-${MY_PV}" 69 | BIN_S="${WORKDIR}/${PN}-bin-${MY_PV}" 70 | BUILD_DIR="${S}/out" 71 | 72 | pkg_setup() { 73 | python-single-r1_pkg_setup 74 | } 75 | 76 | src_unpack() { 77 | local a 78 | 79 | mkdir "${BIN_S}" || die 80 | 81 | for a in ${A} ; do 82 | case "${a}" in 83 | *.rpm) 84 | pushd "${BIN_S}" >/dev/null || die 85 | srcrpm_unpack "${a}" 86 | popd >/dev/null || die 87 | ;; 88 | 89 | *.tar|*.tar.gz|*.tar.bz2|*.tar.xz) 90 | # Tarballs on registry.npmjs.org are wildly inconsistent, 91 | # and violate the convention of having ${P} as the top 92 | # directory name, so we strip the first component and 93 | # unpack into a correct directory explicitly. 94 | local basename=${a%.tar.*} 95 | local destdir=${WORKDIR}/${basename#atomdep-} 96 | mkdir "${destdir}" || die 97 | tar -C "${destdir}" -x -o --strip-components 1 \ 98 | -f "${DISTDIR}/${a}" || die 99 | ;; 100 | 101 | *) 102 | # Fallback to the default unpacker. 103 | unpack "${a}" 104 | ;; 105 | esac 106 | done 107 | } 108 | 109 | src_prepare() { 110 | local suffix="$(get_install_suffix)" 111 | local atom_rpmdir=$(get_atom_rpmdir) 112 | local install_dir="${EPREFIX}$(get_install_dir)" 113 | local electron_dir="${EPREFIX}$(get_electron_dir)" 114 | local electron_path="${electron_dir}/electron" 115 | local node_path="${electron_dir}/node" 116 | local node_includes="${EPREFIX}$(get_node_includedir)" 117 | local binmod 118 | local pkgdir 119 | 120 | mkdir "${BUILD_DIR}" || die 121 | cp -a "${BIN_S}/${atom_rpmdir}/resources/app" \ 122 | "${BUILD_DIR}/app" || die 123 | 124 | # Add source files omitted from the upstream binary distribution, 125 | # and which we want to include in ours. 126 | cp -a "${S}/spec" "${BUILD_DIR}/app" || die 127 | 128 | # Unpack app.asar 129 | easar extract "${BIN_S}/${atom_rpmdir}/resources/app.asar" \ 130 | "${BUILD_DIR}/app" 131 | 132 | cd "${BUILD_DIR}/app" || die 133 | 134 | eapply "${FILESDIR}/apm-python.patch" 135 | eapply "${FILESDIR}/atom-unbundle-electron-r3.patch" 136 | eapply "${FILESDIR}/atom-python-r1.patch" 137 | eapply "${FILESDIR}/atom-apm-path-r2.patch" 138 | eapply "${FILESDIR}/atom-fix-app-restart-r2.patch" 139 | eapply "${FILESDIR}/atom-marker-layer-r1.patch" 140 | eapply "${FILESDIR}/atom-fix-config-watcher-r1.patch" 141 | 142 | sed -i -e "s|path.join(process.resourcesPath, 'LICENSE.md')|'/usr/share/licenses/$(get_atom_appname)/LICENSE.md'|g" \ 143 | ./src/main-process/atom-application.js \ 144 | || die 145 | 146 | sed -i -e "s|{{NPM_CONFIG_NODEDIR}}|${node_includes}|g" \ 147 | -e "s|{{ATOM_PATH}}|${electron_path}|g" \ 148 | -e "s|{{ATOM_RESOURCE_PATH}}|${install_dir}/app.asar|g" \ 149 | -e "s|{{ATOM_PREFIX}}|${EPREFIX}|g" \ 150 | -e "s|^#!/bin/bash|#!${EPREFIX}/bin/bash|g" \ 151 | ./atom.sh \ 152 | || die 153 | 154 | local env="export NPM_CONFIG_NODEDIR=${node_includes}\nexport ELECTRON_NO_ASAR=1" 155 | sed -i -e \ 156 | "s|\"\$binDir/\$nodeBin\"|${env}\nexec \"${node_path}\"|g" \ 157 | apm/bin/apm || die 158 | 159 | sed -i -e \ 160 | "s|^\([[:space:]]*\)node[[:space:]]\+|\1\"${node_path}\" |g" \ 161 | apm/node_modules/npm/bin/node-gyp-bin/node-gyp || die 162 | 163 | sed -i -e \ 164 | "s|atomCommand = 'atom';|atomCommand = '${EPREFIX}/usr/bin/atom${suffix}'|g" \ 165 | apm/lib/test.js || die 166 | 167 | rm apm/bin/node || die 168 | 169 | sed -i -e "s|/${atom_rpmdir}/atom|${EPREFIX}/usr/bin/atom${suffix}|g" \ 170 | "${BIN_S}/usr/share/applications/$(get_atom_appname).desktop" || die 171 | 172 | for binmod in "${BINMODS[@]}"; do 173 | pkgdir="${WORKDIR}/$(package_dir ${binmod})" 174 | cd "${pkgdir}" || die 175 | if have_patches_for "${binmod}"; then 176 | eapply "${FILESDIR}"/${binmod}-*.patch 177 | fi 178 | done 179 | 180 | cd "${BUILD_DIR}/app" || die 181 | 182 | # Unbundle bundled libs from modules 183 | 184 | pkgdir="${WORKDIR}/$(package_dir git-utils)" 185 | ${EPYTHON} "${FILESDIR}/gyp-unbundle.py" \ 186 | --inplace --unbundle "git;libgit2;git2" \ 187 | "${pkgdir}/binding.gyp" || die 188 | 189 | pkgdir="${WORKDIR}/$(package_dir oniguruma)" 190 | ${EPYTHON} "${FILESDIR}/gyp-unbundle.py" \ 191 | --inplace --unbundle "onig_scanner;oniguruma;onig" \ 192 | "${pkgdir}/binding.gyp" || die 193 | 194 | pkgdir="${WORKDIR}/$(package_dir spellchecker)" 195 | ${EPYTHON} "${FILESDIR}/gyp-unbundle.py" \ 196 | --inplace --unbundle "spellchecker;hunspell;hunspell" \ 197 | "${pkgdir}/binding.gyp" || die 198 | 199 | pkgdir="${WORKDIR}/$(package_dir superstring)" 200 | ${EPYTHON} "${FILESDIR}/gyp-unbundle.py" \ 201 | --inplace --unbundle \ 202 | "superstring_core;./vendor/pcre/pcre.gyp:pcre;pcre2-16; \ 203 | -DPCRE2_CODE_UNIT_WIDTH=16" \ 204 | "${pkgdir}/binding.gyp" || die 205 | 206 | for binmod in "${BINMODS[@]}"; do 207 | pkgdir="${WORKDIR}/$(package_dir ${binmod})" 208 | mkdir -p "${pkgdir}/node_modules" || die 209 | ln -s "${WORKDIR}/nodejs-nan-${NAN_V}" \ 210 | "${pkgdir}/node_modules/nan" || die 211 | done 212 | 213 | sed -i -e "s|{{ATOM_PREFIX}}|${EPREFIX}|g" \ 214 | "${BUILD_DIR}/app/src/config-schema.js" || die 215 | 216 | sed -i -e "s|{{ATOM_SUFFIX}}|${suffix}|g" \ 217 | "${BUILD_DIR}/app/src/config-schema.js" || die 218 | 219 | eapply_user 220 | } 221 | 222 | src_configure() { 223 | local binmod 224 | 225 | for binmod in "${BINMODS[@]}"; do 226 | einfo "Configuring ${binmod}..." 227 | cd "${WORKDIR}/$(package_dir ${binmod})" || die 228 | enodegyp_atom configure 229 | done 230 | } 231 | 232 | src_compile() { 233 | local binmod 234 | local ctags_d="node_modules/symbols-view/vendor" 235 | local jobs=$(makeopts_jobs) 236 | local unpacked_paths 237 | 238 | # Transpile any yet untranspiled files. 239 | ecoffeescript "${BUILD_DIR}"/app/spec/'*.coffee' 240 | 241 | mkdir -p "${BUILD_DIR}/modules/" || die 242 | 243 | for binmod in "${BINMODS[@]}"; do 244 | local binmod_name=${binmod##node-} 245 | 246 | einfo "Building ${binmod}..." 247 | cd "${WORKDIR}/$(package_dir ${binmod})" || die 248 | enodegyp_atom --verbose --jobs="$(makeopts_jobs)" build 249 | mkdir -p "${BUILD_DIR}/modules/${binmod_name}" || die 250 | cp build/Release/*.node "${BUILD_DIR}/modules/${binmod_name}" || die 251 | done 252 | 253 | # Put compiled binary modules in place 254 | fix_binmods "${BUILD_DIR}/app" "apm" 255 | fix_binmods "${BUILD_DIR}/app" "node_modules" 256 | 257 | # Remove non-Linux vendored ctags binaries 258 | rm "${BUILD_DIR}/app/${ctags_d}/ctags-darwin" \ 259 | "${BUILD_DIR}/app/${ctags_d}/ctags-win32.exe" || die 260 | 261 | # Remove bundled git 262 | rm -r "${BUILD_DIR}/app/node_modules/dugite/git" || die 263 | 264 | # Re-pack app.asar 265 | # Keep unpack rules in sync with buildAsarUnpackGlobExpression() 266 | # in script/lib/package-application.js 267 | unpacked_paths=( 268 | "*.node" 269 | "ctags-config" 270 | "ctags-linux" 271 | "**/spec/fixtures/**" 272 | "**/node_modules/github/bin/**" 273 | "**/node_modules/spellchecker/**" 274 | "**/resources/atom.png") 275 | 276 | unpacked_paths=$(IFS=,; echo "${unpacked_paths[*]}") 277 | 278 | cd "${BUILD_DIR}" || die 279 | easar pack --unpack="{${unpacked_paths}}" --unpack-dir=apm "app" "app.asar" 280 | 281 | rm -r "${BUILD_DIR}/app.asar.unpacked/apm" || die 282 | 283 | # Replace vendored ctags with a symlink to system ctags 284 | rm "${BUILD_DIR}/app.asar.unpacked/${ctags_d}/ctags-linux" || die 285 | ln -s "${EPREFIX}/usr/bin/ctags" \ 286 | "${BUILD_DIR}/app.asar.unpacked/${ctags_d}/ctags-linux" || die 287 | } 288 | 289 | src_install() { 290 | local install_dir="$(get_install_dir)" 291 | local suffix="$(get_install_suffix)" 292 | 293 | insinto "${install_dir}" 294 | 295 | doins "${BUILD_DIR}/app.asar" 296 | doins -r "${BUILD_DIR}/app.asar.unpacked" 297 | 298 | insinto "${install_dir}/app" 299 | doins -r "${BUILD_DIR}/app/apm" 300 | 301 | insinto "/usr/share/applications/" 302 | newins "${BIN_S}/usr/share/applications/$(get_atom_appname).desktop" \ 303 | "atom${suffix}.desktop" 304 | 305 | insinto "/usr/share/icons/" 306 | doins -r "${BIN_S}/usr/share/icons/hicolor" 307 | 308 | exeinto "${install_dir}" 309 | newexe "${BUILD_DIR}/app/atom.sh" atom 310 | insinto "/usr/share/licenses/${PN}${suffix}" 311 | doins "${BIN_S}/$(get_atom_rpmdir)/resources/LICENSE.md" 312 | dosym "../..${install_dir}/atom" "/usr/bin/atom${suffix}" 313 | dosym "../..${install_dir}/app/apm/bin/apm" "/usr/bin/apm${suffix}" 314 | 315 | fix_executables "${install_dir}/app/apm/bin" 316 | fix_executables "${install_dir}/app/apm/node_modules/.bin" 317 | fix_executables "${install_dir}/app/apm/node_modules/npm/bin" 318 | fix_executables "${install_dir}/app/apm/node_modules/npm/bin/node-gyp-bin" 319 | fix_executables "${install_dir}/app/apm/node_modules/node-gyp/bin" 320 | } 321 | 322 | pkg_postinst() { 323 | xdg_desktop_database_update 324 | xdg_mimeinfo_database_update 325 | } 326 | 327 | pkg_postrm() { 328 | xdg_desktop_database_update 329 | xdg_mimeinfo_database_update 330 | } 331 | 332 | # Helpers 333 | # ------- 334 | 335 | # Return the installation suffix appropriate for the slot. 336 | get_install_suffix() { 337 | local slot=${SLOT%%/*} 338 | local suffix 339 | 340 | if [[ "${slot}" == "0" ]]; then 341 | suffix="" 342 | else 343 | suffix="-${slot}" 344 | fi 345 | 346 | echo "${suffix}" 347 | } 348 | 349 | # Return the upstream app name appropriate for $PV. 350 | get_atom_appname() { 351 | if [[ "${PV}" == *beta* ]]; then 352 | echo "atom-beta" 353 | else 354 | echo "atom" 355 | fi 356 | } 357 | 358 | # Return the app installation path inside the upstream archive. 359 | get_atom_rpmdir() { 360 | echo "usr/share/$(get_atom_appname)" 361 | } 362 | 363 | # Return the installation target directory. 364 | get_install_dir() { 365 | echo "/usr/$(get_libdir)/atom$(get_install_suffix)" 366 | } 367 | 368 | # Return the Electron installation directory. 369 | get_electron_dir() { 370 | echo "/usr/$(get_libdir)/electron-${ELECTRON_SLOT}" 371 | } 372 | 373 | # Return the directory containing appropriate Node headers 374 | # for the required version of Electron. 375 | get_node_includedir() { 376 | echo "/usr/include/electron-${ELECTRON_SLOT}/node/" 377 | } 378 | 379 | # Run JavaScript using Electron's version of Node. 380 | enode_electron() { 381 | "${BROOT}/$(get_electron_dir)"/node "${@}" 382 | } 383 | 384 | # Run node-gyp using Electron's version of Node. 385 | enodegyp_atom() { 386 | local apmpath="$(get_atom_rpmdir)/resources/app/apm" 387 | local nodegyp="${BIN_S}/${apmpath}/node_modules/node-gyp/bin/node-gyp.js" 388 | 389 | PATH="${BROOT}/$(get_electron_dir):${PATH}" \ 390 | enode_electron "${nodegyp}" \ 391 | --nodedir="${BROOT}/$(get_node_includedir)" "${@}" || die 392 | } 393 | 394 | # Coffee Script wrapper. 395 | ecoffeescript() { 396 | local cscript="${FILESDIR}/transpile-coffee-script.js" 397 | 398 | echo "ecoffeescript" "${@}" 399 | echo ATOM_HOME="${T}/.atom" ATOM_SRC_ROOT="${BUILD_DIR}/app" \ 400 | NODE_PATH="${BUILD_DIR}/app/node_modules" \ 401 | enode_electron "${cscript}" "${@}" || die 402 | ATOM_HOME="${T}/.atom" ATOM_SRC_ROOT="${BUILD_DIR}/app" \ 403 | NODE_PATH="${BUILD_DIR}/app/node_modules" \ 404 | enode_electron "${cscript}" "${@}" || die 405 | } 406 | 407 | # asar wrapper. 408 | easar() { 409 | local asar="${WORKDIR}/$(package_dir asar)/node_modules/asar/bin/asar" 410 | echo "asar" "${@}" 411 | enode_electron "${asar}" "${@}" || die 412 | } 413 | 414 | # Return a $WORKDIR directory for a given package name. 415 | package_dir() { 416 | local binmod="${1//-/_}" 417 | local binmod_v="${binmod^^}_V" 418 | if [[ -z "${binmod_v}" ]]; then 419 | die "${binmod_v} is not set." 420 | fi 421 | 422 | echo ${1}-${!binmod_v} 423 | } 424 | 425 | # Check if there are patches for a given package. 426 | have_patches_for() { 427 | local patches="${1}-*.patch" 428 | local found 429 | found=$(find "${FILESDIR}" -maxdepth 1 -name "${patches}" -print -quit) 430 | test -n "${found}" 431 | } 432 | 433 | # Replace binary node modules with the newly compiled versions thereof. 434 | fix_binmods() { 435 | local dir="${2}" 436 | local prefix="${1}" 437 | local path 438 | local relpath 439 | local modpath 440 | local mod 441 | local cruft 442 | 443 | while IFS= read -r -d '' path; do 444 | relpath=${path#${prefix}} 445 | relpath=${relpath##/} 446 | relpath=${relpath#W${dir}} 447 | modpath=$(dirname ${relpath}) 448 | modpath=${modpath%build/Release} 449 | mod=$(basename ${modpath}) 450 | 451 | # Check if the binary node module is actually a valid dependency. 452 | # Sometimes the upstream removes a dependency from package.json but 453 | # forgets to remove the module from node_modules. 454 | has "${mod}" "${BINMODS[@]}" || continue 455 | 456 | # Must copy here as symlinks will cause the module loading to fail. 457 | cp -f "${BUILD_DIR}/modules/${mod}/${path##*/}" "${path}" || die 458 | 459 | # Drop unnecessary static libraries. 460 | find "${path%/*}" -name '*.a' -delete || die 461 | done < <(find "${prefix}/${dir}" -name '*.node' -print0 || die) 462 | } 463 | 464 | # Fix script permissions and shebangs to point to the correct version 465 | # of Node. 466 | fix_executables() { 467 | local dir="${1}" 468 | local node_sb="#!${EPREFIX}$(get_electron_dir)"/node 469 | 470 | while IFS= read -r -d '' f; do 471 | IFS= read -r shebang < "${f}" 472 | 473 | if [[ ${shebang} == '#!'* ]]; then 474 | fperms +x "${f#${ED}}" 475 | if [[ "${shebang}" == "#!/usr/bin/env node" || \ 476 | "${shebang}" == "#!/usr/bin/node" ]]; then 477 | einfo "Fixing node shebang in ${f#${ED}}" 478 | sed --follow-symlinks -i \ 479 | -e "1s:${shebang}$:${node_sb}:" "${f}" || die 480 | fi 481 | fi 482 | done < <(find -L "${ED}${dir}" -maxdepth 1 -mindepth 1 -type f -print0 || die) 483 | } 484 | -------------------------------------------------------------------------------- /_scripts/get-chromium-source-for-electron.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # 3 | # This script is used to get and patch the chromium source code 4 | # appropriate for the given electron ebuild version. 5 | 6 | 7 | import argparse 8 | import collections 9 | import os 10 | import os.path 11 | import pathlib 12 | import re 13 | import shutil 14 | import subprocess 15 | import sys 16 | import tarfile 17 | import tempfile 18 | import urllib.error 19 | import urllib.parse 20 | import urllib.request 21 | 22 | 23 | CHROMIUM_URL = \ 24 | 'https://commondatastorage.googleapis.com/chromium-browser-official/' 25 | 26 | LIBCC_REPO = 'https://github.com/elprans/libchromiumcontent.git' 27 | 28 | CACHEHOME = os.environ.get( 29 | 'XDG_CACHE_HOME', os.path.expandvars('$HOME/.cache')) 30 | 31 | CACHEDIR = os.path.join(CACHEHOME, 'get-chromium-source-for-electron') 32 | 33 | 34 | def main(): 35 | args = parse_args() 36 | ebuild = args.ebuild 37 | 38 | info = parse_electron_ebuild(ebuild) 39 | 40 | if not os.path.exists(os.path.join(args.target, '.git')): 41 | git('init', cwd=args.target) 42 | 43 | if args.download: 44 | stuff = git('status', '--porcelain', cwd=args.target) 45 | if stuff: 46 | die('there are uncommitted or untracked files in {}'.format( 47 | args.target)) 48 | 49 | git('checkout', '--orphan', info.chromium_version, cwd=args.target) 50 | git('rm', '-rf', '--ignore-unmatch', '.', cwd=args.target) 51 | git('clean', '-fdx', cwd=args.target) 52 | 53 | download_and_unpack_chromium_source(info.chromium_version, args.target) 54 | 55 | git('add', '--force', '.', cwd=args.target) 56 | git('commit', '-m', 'Import chromium-{}'.format(info.chromium_version), 57 | cwd=args.target) 58 | 59 | if args.apply_patches: 60 | apply_libcc_patches(info.libcc_version, args.target) 61 | git('add', '--force', '.', cwd=args.target) 62 | git('commit', '-m', 'libchromiumcontent patches', cwd=args.target) 63 | 64 | # unbundle_libs(info, args.target) 65 | # git('add', '--force', '.', cwd=args.target) 66 | # git('commit', '-m', 'unbundled libraries', cwd=args.target) 67 | 68 | return 0 69 | 70 | 71 | def parse_args(): 72 | parser = argparse.ArgumentParser() 73 | parser.add_argument('--apply-patches', action='store_true', default=False, 74 | help='Apply Electron and Gentoo patches.') 75 | parser.add_argument('--download', action='store_true', default=False, 76 | help='Download and import Chromium source.') 77 | parser.add_argument('ebuild', help='Path to electron ebuild.') 78 | parser.add_argument('target', help='Path to target directory.') 79 | return parser.parse_args() 80 | 81 | 82 | def die(msg, *, exitcode=1): 83 | print(msg, file=sys.stderr) 84 | sys.exit(exitcode) 85 | 86 | 87 | _ver_re = re.compile(r'CHROMIUM_VERSION="([^"]+)"') 88 | _libcc_re = re.compile(r'LIBCHROMIUMCONTENT_COMMIT="([^"]+)"') 89 | _patch_re = re.compile(r'CHROMIUM_PATCHES="([^"]+)"', re.M) 90 | _bundled_re = re.compile(r'keeplibs=\(([^)]+)\)', re.M) 91 | _gn_syslibs_re = re.compile(r'gn_system_libraries=\(([^)]+)\)', re.M) 92 | 93 | 94 | ElectronInfo = collections.namedtuple( 95 | 'ElectronInfo', [ 96 | 'chromium_version', 97 | 'libcc_version', 98 | 'bundled_libraries', 99 | 'gn_system_libraries', 100 | ] 101 | ) 102 | 103 | 104 | def parse_electron_ebuild(ebuild_fn): 105 | with open(ebuild_fn, 'r') as f: 106 | ebuild = f.read() 107 | 108 | ver = _ver_re.search(ebuild) 109 | if not ver: 110 | die('could not find Chromium version in {}'.format(ebuild_fn)) 111 | ver = ver.group(1) 112 | 113 | libcc_ver = _libcc_re.search(ebuild) 114 | if not libcc_ver: 115 | die('could not find libchromiumcontent version in {}'.format( 116 | ebuild_fn)) 117 | libcc_ver = libcc_ver.group(1) 118 | 119 | bundled = _bundled_re.search(ebuild) 120 | if not bundled: 121 | die('could not find keeplibs in {}'.format( 122 | ebuild_fn)) 123 | bundled_libs = list(filter( 124 | lambda f: f and not f.startswith('#'), 125 | (l.strip(' \n\t') for l in bundled.group(1).split('\n')) 126 | )) 127 | 128 | gn_syslibs = _gn_syslibs_re.search(ebuild) 129 | if not gn_syslibs: 130 | die('could not find gn_system_libraries in {}'.format( 131 | ebuild_fn)) 132 | gn_syslibs = list(filter( 133 | None, (l.strip(' \n\t') for l in gn_syslibs.group(1).split('\n')))) 134 | 135 | gn_syslibs.append('ffmpeg') 136 | 137 | return ElectronInfo( 138 | chromium_version=ver, 139 | libcc_version=libcc_ver, 140 | bundled_libraries=bundled_libs, 141 | gn_system_libraries=gn_syslibs, 142 | ) 143 | 144 | 145 | def apply_libcc_patches(libcc_version, target): 146 | repo_dir = os.path.join(CACHEDIR, repodir(LIBCC_REPO)) 147 | update_repo(LIBCC_REPO) 148 | 149 | libcc_version = 'd6da7bc' 150 | #git('reset', '--hard', libcc_version, cwd=repo_dir) 151 | ap = pathlib.Path(repo_dir) / 'script' / 'apply-patches' 152 | run('python2', str(ap), cwd=target, stdout=sys.stdout) 153 | 154 | 155 | def repodir(repo_url): 156 | u = urllib.parse.urlparse(repo_url) 157 | base = os.path.basename(u.path) 158 | name, _ = os.path.splitext(base) 159 | return name 160 | 161 | 162 | def git(*cmdline, **kwargs): 163 | cmd = ['git'] + list(cmdline) 164 | return run(*cmd, **kwargs) 165 | 166 | 167 | def run(*cmdline, **kwargs): 168 | default_kwargs = { 169 | 'stderr': sys.stderr, 170 | 'stdout': subprocess.PIPE, 171 | 'encoding': 'utf8', 172 | } 173 | 174 | default_kwargs.update(kwargs) 175 | 176 | p = subprocess.run(cmdline, **default_kwargs) 177 | 178 | if p.returncode != 0: 179 | die('{} failed with exit code {}'.format( 180 | ' '.join(cmdline), p.returncode)) 181 | 182 | return p.stdout 183 | 184 | 185 | def list_files_in_repo(repo, treeish, path): 186 | repo_dir = os.path.join(CACHEDIR, repodir(repo)) 187 | files = git('ls-tree', '-r', '--name-only', '--full-name', 188 | treeish, '--', path, cwd=repo_dir).split('\n') 189 | return [f.strip() for f in files if f.strip()] 190 | 191 | 192 | def get_file_in_repo(repo, commitish, path): 193 | repo_dir = os.path.join(CACHEDIR, repodir(repo)) 194 | return git('show', '{}:{}'.format(commitish, path), cwd=repo_dir) 195 | 196 | 197 | def update_repo(repo_url): 198 | repo_dir = os.path.join(CACHEDIR, repodir(repo_url)) 199 | repo_gitdir = os.path.join(repo_dir, '.git') 200 | 201 | if os.path.exists(repo_gitdir): 202 | git('fetch', cwd=repo_dir) 203 | else: 204 | if os.path.exists(repo_dir): 205 | # Repo dir exists for some reason, remove it. 206 | shutil.rmtree(repo_dir) 207 | 208 | git('clone', repo_url, repo_dir) 209 | 210 | 211 | def download_and_unpack_chromium_source(version, target_dir): 212 | os.makedirs(target_dir, exist_ok=True) 213 | archive_name = 'chromium-{}.tar.xz'.format(version) 214 | distfile = '/usr/portage/distfiles/{}'.format(archive_name) 215 | if os.path.exists(distfile): 216 | archive = distfile 217 | else: 218 | archive = download_chromium_source(version) 219 | 220 | print('Extracting {} to {}...'.format(archive_name, target_dir), 221 | end='', flush=True) 222 | tf = tarfile.open(archive) 223 | members = tf.getmembers() 224 | print('', end='\r') 225 | for i, member in enumerate(members): 226 | print('Extracting {} to {}: {}%'.format(archive_name, target_dir, 227 | round(i / len(members) * 100)), 228 | end='\r') 229 | 230 | try: 231 | i = member.name.index('/') 232 | except ValueError: 233 | continue 234 | 235 | proper_name = member.name[(i + 1):] 236 | 237 | proper_path = os.path.join(target_dir, proper_name) 238 | if proper_name: 239 | if os.path.isfile(proper_path): 240 | os.unlink(proper_path) 241 | elif os.path.isdir(proper_path): 242 | shutil.rmtree(proper_path) 243 | tf.extract(member, target_dir) 244 | if proper_name: 245 | member_path = os.path.join(target_dir, member.name) 246 | os.rename(member_path, proper_path) 247 | 248 | print() 249 | 250 | 251 | def download_chromium_source(version): 252 | archive_name = 'chromium-{}.tar.xz'.format(version) 253 | url = '{}{}'.format(CHROMIUM_URL, archive_name) 254 | archive = os.path.join(CACHEDIR, archive_name) 255 | 256 | print('Downloading {}...'.format(url), end='') 257 | 258 | def progress(block_count, block_size, total_size): 259 | if total_size > 0: 260 | pc = round(block_count * block_size / total_size * 100) 261 | print('Downloading {}: {}%'.format(archive_name, pc), end='\r') 262 | 263 | urllib.request.urlretrieve(url, filename=archive, reporthook=progress) 264 | print() 265 | 266 | return archive 267 | 268 | 269 | def unbundle_libs(info, target): 270 | p = subprocess.run( 271 | (['build/linux/unbundle/remove_bundled_libraries.py'] + 272 | info.bundled_libraries + ['--do-remove']), 273 | cwd=target 274 | ) 275 | if p.returncode != 0: 276 | die('could not unbundle libraries') 277 | 278 | p = subprocess.run( 279 | (['build/linux/unbundle/replace_gn_files.py'] + 280 | ['--system-libraries'] + info.gn_system_libraries), 281 | cwd=target 282 | ) 283 | if p.returncode != 0: 284 | die('could not unbundle libraries') 285 | 286 | 287 | if __name__ == '__main__': 288 | sys.exit(main()) 289 | -------------------------------------------------------------------------------- /_scripts/vscode.template.ebuild: -------------------------------------------------------------------------------- 1 | # Copyright 1999-2022 Gentoo Authors 2 | # Distributed under the terms of the GNU General Public License v2 3 | 4 | # NOTE: this ebuild has been generated by ebuild-gen.py from the 5 | # electron overlay. If you would like to make changes, please 6 | # consider modifying the ebuild template and submitting a PR to 7 | # https://github.com/elprans/electron-overlay. 8 | 9 | EAPI=7 10 | 11 | PYTHON_COMPAT=( python3_{10..13} ) 12 | inherit desktop multiprocessing python-any-r1 rpm xdg-utils 13 | 14 | DESCRIPTION="Visual Studio Code" 15 | HOMEPAGE="https://code.visualstudio.com/" 16 | 17 | if [[ ${PV} == *9999* ]]; then 18 | UPSTREAM_PV="latest" 19 | UPSTREAM_CHANNEL="insider" 20 | else 21 | UPSTREAM_PV="${PV}" 22 | UPSTREAM_CHANNEL="stable" 23 | fi 24 | 25 | ELECTRON_V=@@{ELECTRON_V} 26 | ELECTRON_SLOT=@@{ELECTRON_S} 27 | 28 | ASAR_V=0.14.3 29 | # All binary packages depend on this 30 | NAN_V=2.19.0 31 | NODE_ADDON_API_V=7.1.0 32 | 33 | @@{BINMOD_VERSIONS} 34 | 35 | # The x86_64 arch below is irrelevant, as we will rebuild all binary packages. 36 | SRC_URI=" 37 | https://update.code.visualstudio.com/${UPSTREAM_PV}/linux-rpm-x64/${UPSTREAM_CHANNEL} -> vscode-x64-${PV}.rpm 38 | https://github.com/elprans/asar/releases/download/v${ASAR_V}-gentoo/asar-build.tar.gz -> asar-${ASAR_V}.tar.gz 39 | https://github.com/nodejs/nan/archive/v${NAN_V}.tar.gz -> nodejs-nan-${NAN_V}.tar.gz 40 | https://github.com/nodejs/node-addon-api/archive/v${NODE_ADDON_API_V}.tar.gz -> nodejs-node-addon-api-${NODE_ADDON_API_V}.tar.gz 41 | @@{SRC_URI} 42 | " 43 | 44 | BINMODS=( 45 | @@{BINMODS} 46 | ) 47 | 48 | RESTRICT="mirror bindist" 49 | LICENSE=" 50 | Apache-2.0 51 | BSD 52 | BSD-1 53 | BSD-2 54 | BSD-4 55 | CC-BY-4.0 56 | ISC 57 | LGPL-2.1+ 58 | Microsoft-vscode 59 | MIT 60 | MPL-2.0 61 | openssl 62 | PYTHON 63 | TextMate-bundle 64 | Unlicense 65 | UoI-NCSA 66 | W3C 67 | " 68 | SLOT="@@{SLOT}" 69 | KEYWORDS="@@{KEYWORDS}" 70 | IUSE="" 71 | 72 | BDEPEND=" 73 | ${PYTHON_DEPS} 74 | >=dev-util/electron-${ELECTRON_V}:${ELECTRON_SLOT} 75 | " 76 | 77 | DEPEND=" 78 | >=app-crypt/libsecret-0.18.6:= 79 | >=app-text/hunspell-1.3.3:= 80 | >=dev-db/sqlite-3.24:= 81 | >=dev-libs/glib-2.52.0:= 82 | >=dev-libs/libgit2-0.23:=[ssh] 83 | >=dev-libs/libpcre2-10.22:=[jit,pcre16] 84 | x11-libs/libX11 85 | x11-libs/libxkbfile 86 | " 87 | 88 | RDEPEND=" 89 | ${DEPEND} 90 | >=dev-util/ctags-5.8 91 | >=dev-util/electron-${ELECTRON_V}:${ELECTRON_SLOT} 92 | app-crypt/libsecret[crypt] 93 | app-misc/ca-certificates 94 | dev-vcs/git 95 | sys-apps/ripgrep 96 | " 97 | 98 | S="${WORKDIR}/${PN}-${PV}" 99 | BIN_S="${WORKDIR}/${PN}-bin-${PV}" 100 | BUILD_DIR="${S}/out" 101 | 102 | src_unpack() { 103 | local a 104 | 105 | mkdir "${S}" || die 106 | mkdir "${BIN_S}" || die 107 | 108 | for a in ${A} ; do 109 | case "${a}" in 110 | *.rpm) 111 | pushd "${BIN_S}" >/dev/null || die 112 | srcrpm_unpack "${a}" 113 | popd >/dev/null || die 114 | ;; 115 | 116 | *.tar|*.tar.gz|*.tar.bz2|*.tar.xz) 117 | # Tarballs on registry.npmjs.org are wildly inconsistent, 118 | # and violate the convention of having ${P} as the top 119 | # directory name, so we strip the first component and 120 | # unpack into a correct directory explicitly. 121 | local basename=${a%.tar.*} 122 | local destdir=${WORKDIR}/${basename#vscodedep-} 123 | mkdir "${destdir}" || die 124 | tar -C "${destdir}" -x -o --strip-components 1 \ 125 | -f "${DISTDIR}/${a}" || die 126 | ;; 127 | 128 | *) 129 | # Fallback to the default unpacker. 130 | unpack "${a}" 131 | ;; 132 | esac 133 | done 134 | } 135 | 136 | src_prepare() { 137 | local suffix="$(get_install_suffix)" 138 | local vscode_rpmdir=$(get_vscode_rpmdir) 139 | local vscode_appname=$(get_vscode_appname) 140 | local install_dir="${EPREFIX}$(get_install_dir)" 141 | local electron_dir="${EPREFIX}$(get_electron_dir)" 142 | local electron_path="${electron_dir}/electron" 143 | local node_path="${electron_dir}/node" 144 | local node_includes="${EPREFIX}$(get_node_includedir)" 145 | local binmod 146 | local pkgdir 147 | local pyscript 148 | local wb_css_path="vs/workbench/workbench.desktop.main.css" 149 | local wb_css_local_path="vs/workbench/workbench.desktop.local.css" 150 | local wb_css_csum 151 | 152 | # Calling this here supports resumption via FEATURES=keepwork 153 | python_setup 154 | 155 | mkdir "${BUILD_DIR}" || die 156 | cp -a "${BIN_S}/${vscode_rpmdir}/resources/app" \ 157 | "${BUILD_DIR}/app" || die 158 | 159 | cp -a "${BIN_S}/${vscode_rpmdir}/bin/${vscode_appname}" \ 160 | "${BUILD_DIR}/app/code" || die 161 | 162 | # Unpack app.asar 163 | easar extract "${BIN_S}/${vscode_rpmdir}/resources/app/node_modules.asar" \ 164 | "${BUILD_DIR}/app/node_modules" 165 | 166 | cd "${BUILD_DIR}/app" || die 167 | rm -r "node_modules.asar.unpacked" || die 168 | 169 | if [[ "${PV}" == *9999* ]]; then 170 | eapply "${FILESDIR}/unbundle-electron-insiders.patch" 171 | else 172 | eapply "${FILESDIR}/unbundle-electron-r3.patch" 173 | fi 174 | eapply "${FILESDIR}/unbundle-ripgrep-r2.patch" 175 | 176 | sed -i -e "s|{{NPM_CONFIG_NODEDIR}}|${node_includes}|g" \ 177 | -e "s|{{ELECTRON_PATH}}|${electron_path}|g" \ 178 | -e "s|{{VSCODE_PATH}}|${install_dir}|g" \ 179 | -e "s|{{EPREFIX}}|${EPREFIX}|g" \ 180 | code \ 181 | || die 182 | 183 | sed -i -e "s|/${vscode_rpmdir}/${vscode_appname}|${EPREFIX}/usr/bin/code${suffix}|g" \ 184 | "${BIN_S}/usr/share/applications/$(get_vscode_appname).desktop" || die 185 | 186 | for binmod in "${BINMODS[@]}"; do 187 | pkgdir="${WORKDIR}/$(package_dir ${binmod})" 188 | cd "${pkgdir}" || die 189 | if have_patches_for "${binmod}"; then 190 | eapply "${FILESDIR}"/${binmod}-*.patch 191 | fi 192 | done 193 | 194 | cd "${BUILD_DIR}/app" || die 195 | 196 | # Unbundle bundled libs from modules 197 | 198 | for binmod in "${BINMODS[@]}"; do 199 | pkgdir="${WORKDIR}/$(package_dir ${binmod})" 200 | mkdir -p "${pkgdir}/node_modules" || die 201 | ln -s "${WORKDIR}/nodejs-nan-${NAN_V}" \ 202 | "${pkgdir}/node_modules/nan" || die 203 | ln -s "${WORKDIR}/nodejs-node-addon-api-${NODE_ADDON_API_V}" \ 204 | "${pkgdir}/node_modules/node-addon-api" || die 205 | done 206 | 207 | eapply_user 208 | 209 | cd "${BUILD_DIR}/app" || die 210 | 211 | if [ -e "out/${wb_css_local_path}" ]; then 212 | cat "out/${wb_css_local_path}" >> "out/${wb_css_path}" 213 | 214 | IFS= read -r -d '' pyscript <;;[;lib][;-DMACRO]') 98 | parser.add_argument( 99 | '-i', '--inplace', action='store_true', 100 | help='modify gyp file in-place') 101 | 102 | args = parser.parse_args() 103 | 104 | targets = {} 105 | 106 | for unbundle in args.unbundle: 107 | rule = list(filter(None, (i.strip() for i in unbundle.split(';')))) 108 | if len(rule) < 3: 109 | die('Invalid unbundle rule: {!r}'.format(unbundle)) 110 | target, dep = rule[:2] 111 | 112 | defines = [] 113 | libs = [] 114 | 115 | for item in rule[2:]: 116 | if item.startswith('-D'): 117 | defines.append(item[2:]) 118 | else: 119 | libs.append(item) 120 | 121 | try: 122 | target_unbundlings = targets[target] 123 | except KeyError: 124 | target_unbundlings = targets[target] = {} 125 | 126 | target_unbundlings[dep] = libs, defines 127 | 128 | with open(args.gypfile, 'rt') as f: 129 | gypdata = eval(f.read()) 130 | 131 | do_unbundle(gypdata, targets) 132 | 133 | if args.inplace: 134 | with open(args.gypfile, 'wt') as f: 135 | pprint.pprint(gypdata, stream=f) 136 | else: 137 | pprint.pprint(gypdata) 138 | 139 | 140 | if __name__ == '__main__': 141 | main() 142 | -------------------------------------------------------------------------------- /app-editors/vscode/files/unbundle-electron-insiders.patch: -------------------------------------------------------------------------------- 1 | diff --git a/code b/code 2 | index 96b1755..5b50aad 100755 3 | --- a/code 4 | +++ b/code 5 | @@ -1,4 +1,4 @@ 6 | -#!/usr/bin/env bash 7 | +#!{{EPREFIX}}/usr/bin/env bash 8 | # 9 | # Copyright (c) Microsoft Corporation. All rights reserved. 10 | # Licensed under the MIT License. See License.txt in the project root for license information. 11 | @@ -30,7 +30,10 @@ else 12 | fi 13 | fi 14 | 15 | -ELECTRON="$VSCODE_PATH/code-insiders" 16 | -CLI="$VSCODE_PATH/resources/app/out/cli.js" 17 | -ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@" 18 | -exit $? 19 | +VSCODE_PATH="{{VSCODE_PATH}}" 20 | +ELECTRON="{{ELECTRON_PATH}}" 21 | +CLI="${VSCODE_PATH}/out/cli.js" 22 | +exec {{EPREFIX}}/usr/bin/env \ 23 | + ELECTRON_RUN_AS_NODE=1 \ 24 | + NPM_CONFIG_NODEDIR="{{NPM_CONFIG_NODEDIR}}" \ 25 | + "${ELECTRON}" "${CLI}" --app="${VSCODE_PATH}" "$@" 26 | -------------------------------------------------------------------------------- /app-editors/vscode/files/unbundle-electron-r2.patch: -------------------------------------------------------------------------------- 1 | From 3d42ee626ee69418465d399c1ed40b8d1d2f9d53 Mon Sep 17 00:00:00 2001 2 | From: Elvis Pranskevichus 3 | Date: Wed, 8 Dec 2021 14:00:50 -0800 4 | Subject: [PATCH] Unbundle Electron 5 | 6 | --- 7 | code | 13 ++++++++----- 8 | 1 file changed, 8 insertions(+), 5 deletions(-) 9 | 10 | diff --git a/code b/code 11 | index 4e092de..affd571 100755 12 | --- a/code 13 | +++ b/code 14 | @@ -1,4 +1,4 @@ 15 | -#!/usr/bin/env sh 16 | +#!{{EPREFIX}}/usr/bin/env sh 17 | # 18 | # Copyright (c) Microsoft Corporation. All rights reserved. 19 | # Licensed under the MIT License. See License.txt in the project root for license information. 20 | @@ -48,7 +48,10 @@ else 21 | fi 22 | fi 23 | 24 | -ELECTRON="$VSCODE_PATH/code" 25 | -CLI="$VSCODE_PATH/resources/app/out/cli.js" 26 | -ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" --ms-enable-electron-run-as-node "$@" 27 | -exit $? 28 | +VSCODE_PATH="{{VSCODE_PATH}}" 29 | +ELECTRON="{{ELECTRON_PATH}}" 30 | +CLI="${VSCODE_PATH}/out/cli.js" 31 | +exec {{EPREFIX}}/usr/bin/env \ 32 | + ELECTRON_RUN_AS_NODE=1 \ 33 | + NPM_CONFIG_NODEDIR="{{NPM_CONFIG_NODEDIR}}" \ 34 | + "${ELECTRON}" "${CLI}" --app="${VSCODE_PATH}" "$@" 35 | -- 36 | 2.32.0 37 | 38 | -------------------------------------------------------------------------------- /app-editors/vscode/files/unbundle-electron-r3.patch: -------------------------------------------------------------------------------- 1 | diff --git a/code.orig b/code 2 | index 97e909e..0b624e6 100755 3 | --- a/code.orig 4 | +++ b/code 5 | @@ -1,4 +1,4 @@ 6 | -#!/usr/bin/env sh 7 | +#!{{EPREFIX}}/usr/bin/env sh 8 | # 9 | # Copyright (c) Microsoft Corporation. All rights reserved. 10 | # Licensed under the MIT License. See License.txt in the project root for license information. 11 | @@ -57,7 +57,10 @@ else 12 | fi 13 | fi 14 | 15 | -ELECTRON="$VSCODE_PATH/code" 16 | -CLI="$VSCODE_PATH/resources/app/out/cli.js" 17 | -ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@" 18 | -exit $? 19 | +VSCODE_PATH="{{VSCODE_PATH}}" 20 | +ELECTRON="{{ELECTRON_PATH}}" 21 | +CLI="${VSCODE_PATH}/out/cli.js" 22 | +exec {{EPREFIX}}/usr/bin/env \ 23 | + ELECTRON_RUN_AS_NODE=1 \ 24 | + NPM_CONFIG_NODEDIR="{{NPM_CONFIG_NODEDIR}}" \ 25 | + "${ELECTRON}" "${CLI}" --app="${VSCODE_PATH}" "$@" 26 | -------------------------------------------------------------------------------- /app-editors/vscode/files/unbundle-ripgrep-r2.patch: -------------------------------------------------------------------------------- 1 | diff --git a/node_modules/@vscode/ripgrep/lib/index.js b/node_modules/@vscode/ripgrep/lib/index.js 2 | index f89c1cc..1f1f41e 100644 3 | --- a/node_modules/@vscode/ripgrep/lib/index.js 4 | +++ b/node_modules/@vscode/ripgrep/lib/index.js 5 | @@ -2,4 +2,4 @@ 6 | 7 | const path = require('path'); 8 | 9 | -module.exports.rgPath = path.join(__dirname, `../bin/rg${process.platform === 'win32' ? '.exe' : ''}`); 10 | \ No newline at end of file 11 | +module.exports.rgPath = '/usr/bin/rg'; 12 | -------------------------------------------------------------------------------- /app-editors/vscode/metadata.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Microsoft/vscode 6 | https://github.com/Microsoft/vscode/issues 7 | 8 | Microsoft 9 | opensource@microsoft.com 10 | 11 | 12 | 13 | elvis@magic.io 14 | Elvis Pranskevichus 15 | Atom Overlay 16 | 17 | 18 | -------------------------------------------------------------------------------- /app-editors/vscode/vscode-1.74.2.ebuild: -------------------------------------------------------------------------------- 1 | # Copyright 1999-2022 Gentoo Authors 2 | # Distributed under the terms of the GNU General Public License v2 3 | 4 | # NOTE: this ebuild has been generated by ebuild-gen.py from the 5 | # electron overlay. If you would like to make changes, please 6 | # consider modifying the ebuild template and submitting a PR to 7 | # https://github.com/elprans/electron-overlay. 8 | 9 | EAPI=7 10 | 11 | PYTHON_COMPAT=( python3_{8..11} ) 12 | inherit desktop multiprocessing python-any-r1 rpm xdg-utils 13 | 14 | DESCRIPTION="Visual Studio Code" 15 | HOMEPAGE="https://code.visualstudio.com/" 16 | 17 | if [[ ${PV} == *9999* ]]; then 18 | UPSTREAM_PV="latest" 19 | UPSTREAM_CHANNEL="insider" 20 | else 21 | UPSTREAM_PV="${PV}" 22 | UPSTREAM_CHANNEL="stable" 23 | fi 24 | 25 | ELECTRON_V=19.1.8 26 | ELECTRON_SLOT=19.1 27 | 28 | ASAR_V=0.14.3 29 | # All binary packages depend on this 30 | NAN_V=2.17.0 31 | NODE_ADDON_API_V=5.0.0 32 | 33 | VSCODE__SQLITE3_V=5.1.2-vscode 34 | KEYTAR_V=7.9.0 35 | NATIVE_IS_ELEVATED_V=0.4.3 36 | NATIVE_KEYMAP_V=3.3.2 37 | NATIVE_WATCHDOG_V=1.4.1 38 | NODE_PTY_V=0.11.0-beta11 39 | SPDLOG_V=0.13.7 40 | VSCODE_POLICY_WATCHER_V=1.1.1 41 | 42 | # The x86_64 arch below is irrelevant, as we will rebuild all binary packages. 43 | SRC_URI=" 44 | https://update.code.visualstudio.com/${UPSTREAM_PV}/linux-rpm-x64/${UPSTREAM_CHANNEL} -> vscode-x64-${PV}.rpm 45 | https://github.com/elprans/asar/releases/download/v${ASAR_V}-gentoo/asar-build.tar.gz -> asar-${ASAR_V}.tar.gz 46 | https://github.com/nodejs/nan/archive/v${NAN_V}.tar.gz -> nodejs-nan-${NAN_V}.tar.gz 47 | https://github.com/nodejs/node-addon-api/archive/v${NODE_ADDON_API_V}.tar.gz -> nodejs-node-addon-api-${NODE_ADDON_API_V}.tar.gz 48 | https://registry.npmjs.org/@vscode/sqlite3/-/sqlite3-5.1.2-vscode.tgz -> vscodedep-vscode--sqlite3-${VSCODE__SQLITE3_V}.tar.gz 49 | https://registry.npmjs.org/keytar/-/keytar-7.9.0.tgz -> vscodedep-keytar-${KEYTAR_V}.tar.gz 50 | https://registry.npmjs.org/native-is-elevated/-/native-is-elevated-0.4.3.tgz -> vscodedep-native-is-elevated-${NATIVE_IS_ELEVATED_V}.tar.gz 51 | https://registry.npmjs.org/native-keymap/-/native-keymap-3.3.2.tgz -> vscodedep-native-keymap-${NATIVE_KEYMAP_V}.tar.gz 52 | https://registry.npmjs.org/native-watchdog/-/native-watchdog-1.4.1.tgz -> vscodedep-native-watchdog-${NATIVE_WATCHDOG_V}.tar.gz 53 | https://registry.npmjs.org/node-pty/-/node-pty-0.11.0-beta11.tgz -> vscodedep-node-pty-${NODE_PTY_V}.tar.gz 54 | https://registry.npmjs.org/spdlog/-/spdlog-0.13.7.tgz -> vscodedep-spdlog-${SPDLOG_V}.tar.gz 55 | https://registry.npmjs.org/vscode-policy-watcher/-/vscode-policy-watcher-1.1.1.tgz -> vscodedep-vscode-policy-watcher-${VSCODE_POLICY_WATCHER_V}.tar.gz 56 | " 57 | 58 | BINMODS=( 59 | vscode--sqlite3 60 | keytar 61 | native-is-elevated 62 | native-keymap 63 | native-watchdog 64 | node-pty 65 | spdlog 66 | vscode-policy-watcher 67 | ) 68 | 69 | RESTRICT="mirror bindist" 70 | LICENSE="MS-vscode" 71 | SLOT="0" 72 | KEYWORDS="~amd64" 73 | IUSE="" 74 | 75 | BDEPEND=" 76 | ${PYTHON_DEPS} 77 | >=dev-util/electron-${ELECTRON_V}:${ELECTRON_SLOT} 78 | " 79 | 80 | DEPEND=" 81 | >=app-crypt/libsecret-0.18.6:= 82 | >=app-text/hunspell-1.3.3:= 83 | >=dev-db/sqlite-3.24:= 84 | >=dev-libs/glib-2.52.0:= 85 | >=dev-libs/libgit2-0.23:=[ssh] 86 | >=dev-libs/libpcre2-10.22:=[jit,pcre16] 87 | x11-libs/libX11 88 | x11-libs/libxkbfile 89 | " 90 | 91 | RDEPEND=" 92 | ${DEPEND} 93 | >=dev-util/ctags-5.8 94 | >=dev-util/electron-${ELECTRON_V}:${ELECTRON_SLOT} 95 | dev-vcs/git 96 | sys-apps/ripgrep 97 | " 98 | 99 | S="${WORKDIR}/${PN}-${PV}" 100 | BIN_S="${WORKDIR}/${PN}-bin-${PV}" 101 | BUILD_DIR="${S}/out" 102 | 103 | src_unpack() { 104 | local a 105 | 106 | mkdir "${S}" || die 107 | mkdir "${BIN_S}" || die 108 | 109 | for a in ${A} ; do 110 | case "${a}" in 111 | *.rpm) 112 | pushd "${BIN_S}" >/dev/null || die 113 | srcrpm_unpack "${a}" 114 | popd >/dev/null || die 115 | ;; 116 | 117 | *.tar|*.tar.gz|*.tar.bz2|*.tar.xz) 118 | # Tarballs on registry.npmjs.org are wildly inconsistent, 119 | # and violate the convention of having ${P} as the top 120 | # directory name, so we strip the first component and 121 | # unpack into a correct directory explicitly. 122 | local basename=${a%.tar.*} 123 | local destdir=${WORKDIR}/${basename#vscodedep-} 124 | mkdir "${destdir}" || die 125 | tar -C "${destdir}" -x -o --strip-components 1 \ 126 | -f "${DISTDIR}/${a}" || die 127 | ;; 128 | 129 | *) 130 | # Fallback to the default unpacker. 131 | unpack "${a}" 132 | ;; 133 | esac 134 | done 135 | } 136 | 137 | src_prepare() { 138 | local suffix="$(get_install_suffix)" 139 | local vscode_rpmdir=$(get_vscode_rpmdir) 140 | local vscode_appname=$(get_vscode_appname) 141 | local install_dir="${EPREFIX}$(get_install_dir)" 142 | local electron_dir="${EPREFIX}$(get_electron_dir)" 143 | local electron_path="${electron_dir}/electron" 144 | local node_path="${electron_dir}/node" 145 | local node_includes="${EPREFIX}$(get_node_includedir)" 146 | local binmod 147 | local pkgdir 148 | local pyscript 149 | local wb_css_path="vs/workbench/workbench.desktop.main.css" 150 | local wb_css_local_path="vs/workbench/workbench.desktop.local.css" 151 | local wb_css_csum 152 | 153 | # Calling this here supports resumption via FEATURES=keepwork 154 | python_setup 155 | 156 | mkdir "${BUILD_DIR}" || die 157 | cp -a "${BIN_S}/${vscode_rpmdir}/resources/app" \ 158 | "${BUILD_DIR}/app" || die 159 | 160 | cp -a "${BIN_S}/${vscode_rpmdir}/bin/${vscode_appname}" \ 161 | "${BUILD_DIR}/app/code" || die 162 | 163 | # Unpack app.asar 164 | easar extract "${BIN_S}/${vscode_rpmdir}/resources/app/node_modules.asar" \ 165 | "${BUILD_DIR}/app/node_modules" 166 | 167 | cd "${BUILD_DIR}/app" || die 168 | rm -r "node_modules.asar.unpacked" || die 169 | 170 | if [[ "${PV}" == *9999* ]]; then 171 | eapply "${FILESDIR}/unbundle-electron-insiders.patch" 172 | else 173 | eapply "${FILESDIR}/unbundle-electron-r2.patch" 174 | fi 175 | eapply "${FILESDIR}/unbundle-ripgrep-r2.patch" 176 | 177 | sed -i -e "s|{{NPM_CONFIG_NODEDIR}}|${node_includes}|g" \ 178 | -e "s|{{ELECTRON_PATH}}|${electron_path}|g" \ 179 | -e "s|{{VSCODE_PATH}}|${install_dir}|g" \ 180 | -e "s|{{EPREFIX}}|${EPREFIX}|g" \ 181 | code \ 182 | || die 183 | 184 | sed -i -e "s|/${vscode_rpmdir}/${vscode_appname}|${EPREFIX}/usr/bin/code${suffix}|g" \ 185 | "${BIN_S}/usr/share/applications/$(get_vscode_appname).desktop" || die 186 | 187 | for binmod in "${BINMODS[@]}"; do 188 | pkgdir="${WORKDIR}/$(package_dir ${binmod})" 189 | cd "${pkgdir}" || die 190 | if have_patches_for "${binmod}"; then 191 | eapply "${FILESDIR}"/${binmod}-*.patch 192 | fi 193 | done 194 | 195 | cd "${BUILD_DIR}/app" || die 196 | 197 | # Unbundle bundled libs from modules 198 | 199 | for binmod in "${BINMODS[@]}"; do 200 | pkgdir="${WORKDIR}/$(package_dir ${binmod})" 201 | mkdir -p "${pkgdir}/node_modules" || die 202 | ln -s "${WORKDIR}/nodejs-nan-${NAN_V}" \ 203 | "${pkgdir}/node_modules/nan" || die 204 | ln -s "${WORKDIR}/nodejs-node-addon-api-${NODE_ADDON_API_V}" \ 205 | "${pkgdir}/node_modules/node-addon-api" || die 206 | done 207 | 208 | eapply_user 209 | 210 | cd "${BUILD_DIR}/app" || die 211 | 212 | if [ -e "out/${wb_css_local_path}" ]; then 213 | cat "out/${wb_css_local_path}" >> "out/${wb_css_path}" 214 | 215 | IFS= read -r -d '' pyscript </dev/null || die 113 | srcrpm_unpack "${a}" 114 | popd >/dev/null || die 115 | ;; 116 | 117 | *.tar|*.tar.gz|*.tar.bz2|*.tar.xz) 118 | # Tarballs on registry.npmjs.org are wildly inconsistent, 119 | # and violate the convention of having ${P} as the top 120 | # directory name, so we strip the first component and 121 | # unpack into a correct directory explicitly. 122 | local basename=${a%.tar.*} 123 | local destdir=${WORKDIR}/${basename#vscodedep-} 124 | mkdir "${destdir}" || die 125 | tar -C "${destdir}" -x -o --strip-components 1 \ 126 | -f "${DISTDIR}/${a}" || die 127 | ;; 128 | 129 | *) 130 | # Fallback to the default unpacker. 131 | unpack "${a}" 132 | ;; 133 | esac 134 | done 135 | } 136 | 137 | src_prepare() { 138 | local suffix="$(get_install_suffix)" 139 | local vscode_rpmdir=$(get_vscode_rpmdir) 140 | local vscode_appname=$(get_vscode_appname) 141 | local install_dir="${EPREFIX}$(get_install_dir)" 142 | local electron_dir="${EPREFIX}$(get_electron_dir)" 143 | local electron_path="${electron_dir}/electron" 144 | local node_path="${electron_dir}/node" 145 | local node_includes="${EPREFIX}$(get_node_includedir)" 146 | local binmod 147 | local pkgdir 148 | local pyscript 149 | local wb_css_path="vs/workbench/workbench.desktop.main.css" 150 | local wb_css_local_path="vs/workbench/workbench.desktop.local.css" 151 | local wb_css_csum 152 | 153 | # Calling this here supports resumption via FEATURES=keepwork 154 | python_setup 155 | 156 | mkdir "${BUILD_DIR}" || die 157 | cp -a "${BIN_S}/${vscode_rpmdir}/resources/app" \ 158 | "${BUILD_DIR}/app" || die 159 | 160 | cp -a "${BIN_S}/${vscode_rpmdir}/bin/${vscode_appname}" \ 161 | "${BUILD_DIR}/app/code" || die 162 | 163 | # Unpack app.asar 164 | easar extract "${BIN_S}/${vscode_rpmdir}/resources/app/node_modules.asar" \ 165 | "${BUILD_DIR}/app/node_modules" 166 | 167 | cd "${BUILD_DIR}/app" || die 168 | rm -r "node_modules.asar.unpacked" || die 169 | 170 | if [[ "${PV}" == *9999* ]]; then 171 | eapply "${FILESDIR}/unbundle-electron-insiders.patch" 172 | else 173 | eapply "${FILESDIR}/unbundle-electron-r2.patch" 174 | fi 175 | eapply "${FILESDIR}/unbundle-ripgrep-r2.patch" 176 | 177 | sed -i -e "s|{{NPM_CONFIG_NODEDIR}}|${node_includes}|g" \ 178 | -e "s|{{ELECTRON_PATH}}|${electron_path}|g" \ 179 | -e "s|{{VSCODE_PATH}}|${install_dir}|g" \ 180 | -e "s|{{EPREFIX}}|${EPREFIX}|g" \ 181 | code \ 182 | || die 183 | 184 | sed -i -e "s|/${vscode_rpmdir}/${vscode_appname}|${EPREFIX}/usr/bin/code${suffix}|g" \ 185 | "${BIN_S}/usr/share/applications/$(get_vscode_appname).desktop" || die 186 | 187 | for binmod in "${BINMODS[@]}"; do 188 | pkgdir="${WORKDIR}/$(package_dir ${binmod})" 189 | cd "${pkgdir}" || die 190 | if have_patches_for "${binmod}"; then 191 | eapply "${FILESDIR}"/${binmod}-*.patch 192 | fi 193 | done 194 | 195 | cd "${BUILD_DIR}/app" || die 196 | 197 | # Unbundle bundled libs from modules 198 | 199 | for binmod in "${BINMODS[@]}"; do 200 | pkgdir="${WORKDIR}/$(package_dir ${binmod})" 201 | mkdir -p "${pkgdir}/node_modules" || die 202 | ln -s "${WORKDIR}/nodejs-nan-${NAN_V}" \ 203 | "${pkgdir}/node_modules/nan" || die 204 | ln -s "${WORKDIR}/nodejs-node-addon-api-${NODE_ADDON_API_V}" \ 205 | "${pkgdir}/node_modules/node-addon-api" || die 206 | done 207 | 208 | eapply_user 209 | 210 | cd "${BUILD_DIR}/app" || die 211 | 212 | if [ -e "out/${wb_css_local_path}" ]; then 213 | cat "out/${wb_css_local_path}" >> "out/${wb_css_path}" 214 | 215 | IFS= read -r -d '' pyscript </dev/null || die 113 | srcrpm_unpack "${a}" 114 | popd >/dev/null || die 115 | ;; 116 | 117 | *.tar|*.tar.gz|*.tar.bz2|*.tar.xz) 118 | # Tarballs on registry.npmjs.org are wildly inconsistent, 119 | # and violate the convention of having ${P} as the top 120 | # directory name, so we strip the first component and 121 | # unpack into a correct directory explicitly. 122 | local basename=${a%.tar.*} 123 | local destdir=${WORKDIR}/${basename#vscodedep-} 124 | mkdir "${destdir}" || die 125 | tar -C "${destdir}" -x -o --strip-components 1 \ 126 | -f "${DISTDIR}/${a}" || die 127 | ;; 128 | 129 | *) 130 | # Fallback to the default unpacker. 131 | unpack "${a}" 132 | ;; 133 | esac 134 | done 135 | } 136 | 137 | src_prepare() { 138 | local suffix="$(get_install_suffix)" 139 | local vscode_rpmdir=$(get_vscode_rpmdir) 140 | local vscode_appname=$(get_vscode_appname) 141 | local install_dir="${EPREFIX}$(get_install_dir)" 142 | local electron_dir="${EPREFIX}$(get_electron_dir)" 143 | local electron_path="${electron_dir}/electron" 144 | local node_path="${electron_dir}/node" 145 | local node_includes="${EPREFIX}$(get_node_includedir)" 146 | local binmod 147 | local pkgdir 148 | local pyscript 149 | local wb_css_path="vs/workbench/workbench.desktop.main.css" 150 | local wb_css_local_path="vs/workbench/workbench.desktop.local.css" 151 | local wb_css_csum 152 | 153 | # Calling this here supports resumption via FEATURES=keepwork 154 | python_setup 155 | 156 | mkdir "${BUILD_DIR}" || die 157 | cp -a "${BIN_S}/${vscode_rpmdir}/resources/app" \ 158 | "${BUILD_DIR}/app" || die 159 | 160 | cp -a "${BIN_S}/${vscode_rpmdir}/bin/${vscode_appname}" \ 161 | "${BUILD_DIR}/app/code" || die 162 | 163 | # Unpack app.asar 164 | easar extract "${BIN_S}/${vscode_rpmdir}/resources/app/node_modules.asar" \ 165 | "${BUILD_DIR}/app/node_modules" 166 | 167 | cd "${BUILD_DIR}/app" || die 168 | rm -r "node_modules.asar.unpacked" || die 169 | 170 | if [[ "${PV}" == *9999* ]]; then 171 | eapply "${FILESDIR}/unbundle-electron-insiders.patch" 172 | else 173 | eapply "${FILESDIR}/unbundle-electron-r2.patch" 174 | fi 175 | eapply "${FILESDIR}/unbundle-ripgrep-r2.patch" 176 | 177 | sed -i -e "s|{{NPM_CONFIG_NODEDIR}}|${node_includes}|g" \ 178 | -e "s|{{ELECTRON_PATH}}|${electron_path}|g" \ 179 | -e "s|{{VSCODE_PATH}}|${install_dir}|g" \ 180 | -e "s|{{EPREFIX}}|${EPREFIX}|g" \ 181 | code \ 182 | || die 183 | 184 | sed -i -e "s|/${vscode_rpmdir}/${vscode_appname}|${EPREFIX}/usr/bin/code${suffix}|g" \ 185 | "${BIN_S}/usr/share/applications/$(get_vscode_appname).desktop" || die 186 | 187 | for binmod in "${BINMODS[@]}"; do 188 | pkgdir="${WORKDIR}/$(package_dir ${binmod})" 189 | cd "${pkgdir}" || die 190 | if have_patches_for "${binmod}"; then 191 | eapply "${FILESDIR}"/${binmod}-*.patch 192 | fi 193 | done 194 | 195 | cd "${BUILD_DIR}/app" || die 196 | 197 | # Unbundle bundled libs from modules 198 | 199 | for binmod in "${BINMODS[@]}"; do 200 | pkgdir="${WORKDIR}/$(package_dir ${binmod})" 201 | mkdir -p "${pkgdir}/node_modules" || die 202 | ln -s "${WORKDIR}/nodejs-nan-${NAN_V}" \ 203 | "${pkgdir}/node_modules/nan" || die 204 | ln -s "${WORKDIR}/nodejs-node-addon-api-${NODE_ADDON_API_V}" \ 205 | "${pkgdir}/node_modules/node-addon-api" || die 206 | done 207 | 208 | eapply_user 209 | 210 | cd "${BUILD_DIR}/app" || die 211 | 212 | if [ -e "out/${wb_css_local_path}" ]; then 213 | cat "out/${wb_css_local_path}" >> "out/${wb_css_path}" 214 | 215 | IFS= read -r -d '' pyscript < 2 | 3 | 4 | 5 | elvis@magic.io 6 | Elvis Pranskevichus 7 | 8 | 9 | proxy-maint@gentoo.org 10 | Proxy Maintainers 11 | 12 | 13 | elprans/eselect-electron 14 | 15 | 16 | -------------------------------------------------------------------------------- /dev-util/electron/files/chromium-101-libxml-unbundle.patch: -------------------------------------------------------------------------------- 1 | --- a/build/linux/unbundle/libxml.gn 2 | +++ b/build/linux/unbundle/libxml.gn 3 | @@ -19,6 +19,7 @@ static_library("libxml_utils") { 4 | ":xml_reader", 5 | ":xml_writer", 6 | "//base/test:test_support", 7 | + "//services/data_decoder:lib", 8 | "//services/data_decoder:xml_parser_fuzzer_deps", 9 | ] 10 | sources = [ 11 | -------------------------------------------------------------------------------- /dev-util/electron/files/chromium-106-python3_11.patch: -------------------------------------------------------------------------------- 1 | --- a/tools/grit/grit/util.py 2 | +++ b/tools/grit/grit/util.py 3 | @@ -209,7 +209,7 @@ def ReadFile(filename, encoding): 4 | mode = 'rb' 5 | encoding = None 6 | else: 7 | - mode = 'rU' 8 | + mode = 'r' 9 | 10 | with io.open(filename, mode, encoding=encoding) as f: 11 | return f.read() 12 | -------------------------------------------------------------------------------- /dev-util/electron/files/chromium-107-system-zlib.patch: -------------------------------------------------------------------------------- 1 | --- a/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc 2 | +++ b/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc 3 | @@ -19,7 +19,6 @@ limitations under the License. 4 | #include 5 | 6 | #include "absl/strings/string_view.h" // from @com_google_absl 7 | -#include "contrib/minizip/ioapi.h" 8 | 9 | namespace tflite { 10 | namespace metadata { 11 | -------------------------------------------------------------------------------- /dev-util/electron/files/chromium-108-DocumentLoader-private.patch: -------------------------------------------------------------------------------- 1 | https://bugs.gentoo.org/884197 2 | --- a/third_party/blink/renderer/core/loader/document_loader.cc 3 | +++ b/third_party/blink/renderer/core/loader/document_loader.cc 4 | @@ -155,6 +155,11 @@ 5 | #include "third_party/blink/renderer/platform/wtf/vector.h" 6 | 7 | namespace blink { 8 | + 9 | +struct DecodedBodyDataWrap { 10 | + using DecodedBodyDataType = DocumentLoader::DecodedBodyData; 11 | +}; 12 | + 13 | namespace { 14 | 15 | Vector CopyInitiatorOriginTrials( 16 | @@ -261,7 +266,7 @@ struct SameSizeAsDocumentLoader 17 | bool finish_loading_when_parser_resumed; 18 | bool in_commit_data; 19 | scoped_refptr data_buffer; 20 | - Vector decoded_data_buffer_; 21 | + Vector decoded_data_buffer_; 22 | base::UnguessableToken devtools_navigation_token; 23 | LoaderFreezeMode defers_loading; 24 | bool last_navigation_had_transient_user_activation; 25 | --- a/third_party/blink/renderer/core/loader/document_loader.h 26 | +++ b/third_party/blink/renderer/core/loader/document_loader.h 27 | @@ -467,7 +467,7 @@ class CORE_EXPORT DocumentLoader : public GarbageCollected, 28 | Member archive_; 29 | 30 | private: 31 | - friend struct SameSizeAsDocumentLoader; 32 | + friend struct DecodedBodyDataWrap; 33 | class BodyData; 34 | class EncodedBodyData; 35 | class DecodedBodyData; 36 | 37 | -------------------------------------------------------------------------------- /dev-util/electron/files/chromium-108-EnumTable-crash.patch: -------------------------------------------------------------------------------- 1 | diff --git a/components/media_router/common/providers/cast/channel/enum_table.h b/components/media_router/common/providers/cast/channel/enum_table.h 2 | index 842553a..89de703 100644 3 | --- a/components/media_router/common/providers/cast/channel/enum_table.h 4 | +++ b/components/media_router/common/providers/cast/channel/enum_table.h 5 | @@ -8,6 +8,7 @@ 6 | #include 7 | #include 8 | #include 9 | +#include 10 | 11 | #include "base/check_op.h" 12 | #include "base/notreached.h" 13 | @@ -187,7 +188,6 @@ class 14 | inline constexpr GenericEnumTableEntry(int32_t value); 15 | inline constexpr GenericEnumTableEntry(int32_t value, base::StringPiece str); 16 | 17 | - GenericEnumTableEntry(const GenericEnumTableEntry&) = delete; 18 | GenericEnumTableEntry& operator=(const GenericEnumTableEntry&) = delete; 19 | 20 | private: 21 | @@ -253,7 +253,6 @@ class EnumTable { 22 | constexpr Entry(E value, base::StringPiece str) 23 | : GenericEnumTableEntry(static_cast(value), str) {} 24 | 25 | - Entry(const Entry&) = delete; 26 | Entry& operator=(const Entry&) = delete; 27 | }; 28 | 29 | @@ -312,15 +311,14 @@ class EnumTable { 30 | if (is_sorted_) { 31 | const std::size_t index = static_cast(value); 32 | if (ANALYZER_ASSUME_TRUE(index < data_.size())) { 33 | - const auto& entry = data_.begin()[index]; 34 | + const auto& entry = data_[index]; 35 | if (ANALYZER_ASSUME_TRUE(entry.has_str())) 36 | return entry.str(); 37 | } 38 | return absl::nullopt; 39 | } 40 | return GenericEnumTableEntry::FindByValue( 41 | - reinterpret_cast(data_.begin()), 42 | - data_.size(), static_cast(value)); 43 | + &data_[0], data_.size(), static_cast(value)); 44 | } 45 | 46 | // This overload of GetString is designed for cases where the argument is a 47 | @@ -348,8 +346,7 @@ class EnumTable { 48 | // enum value directly. 49 | absl::optional GetEnum(base::StringPiece str) const { 50 | auto* entry = GenericEnumTableEntry::FindByString( 51 | - reinterpret_cast(data_.begin()), 52 | - data_.size(), str); 53 | + &data_[0], data_.size(), str); 54 | return entry ? static_cast(entry->value) : absl::optional(); 55 | } 56 | 57 | @@ -364,7 +361,7 @@ class EnumTable { 58 | // Align the data on a cache line boundary. 59 | alignas(64) 60 | #endif 61 | - std::initializer_list data_; 62 | + const std::vector data_; 63 | bool is_sorted_; 64 | 65 | constexpr EnumTable(std::initializer_list data, bool is_sorted) 66 | @@ -376,8 +373,8 @@ class EnumTable { 67 | 68 | for (std::size_t i = 0; i < data.size(); i++) { 69 | for (std::size_t j = i + 1; j < data.size(); j++) { 70 | - const Entry& ei = data.begin()[i]; 71 | - const Entry& ej = data.begin()[j]; 72 | + const Entry& ei = data[i]; 73 | + const Entry& ej = data[j]; 74 | DCHECK(ei.value != ej.value) 75 | << "Found duplicate enum values at indices " << i << " and " << j; 76 | DCHECK(!(ei.has_str() && ej.has_str() && ei.str() == ej.str())) 77 | -------------------------------------------------------------------------------- /dev-util/electron/files/chromium-108-binutils-2.41.patch: -------------------------------------------------------------------------------- 1 | From effadce6c756247ea8bae32dc13bb3e6f464f0eb Mon Sep 17 00:00:00 2001 2 | From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= 3 | Date: Sun, 16 Jul 2023 18:18:02 +0300 4 | Subject: [PATCH] avcodec/x86/mathops: clip constants used with shift 5 | instructions within inline assembly 6 | 7 | Fixes assembling with binutil as >= 2.41 8 | 9 | Signed-off-by: James Almer 10 | --- 11 | third_party/ffmpeg/libavcodec/x86/mathops.h | 26 +++++++++++++++++++++++--- 12 | 1 file changed, 23 insertions(+), 3 deletions(-) 13 | 14 | diff --git a/third_party/ffmpeg/libavcodec/x86/mathops.h b/third_party/ffmpeg/libavcodec/x86/mathops.h 15 | index 6298f5ed19..ca7e2dffc1 100644 16 | --- a/third_party/ffmpeg/libavcodec/x86/mathops.h 17 | +++ b/third_party/ffmpeg/libavcodec/x86/mathops.h 18 | @@ -35,12 +35,20 @@ 19 | static av_always_inline av_const int MULL(int a, int b, unsigned shift) 20 | { 21 | int rt, dummy; 22 | + if (__builtin_constant_p(shift)) 23 | __asm__ ( 24 | "imull %3 \n\t" 25 | "shrdl %4, %%edx, %%eax \n\t" 26 | :"=a"(rt), "=d"(dummy) 27 | - :"a"(a), "rm"(b), "ci"((uint8_t)shift) 28 | + :"a"(a), "rm"(b), "i"(shift & 0x1F) 29 | ); 30 | + else 31 | + __asm__ ( 32 | + "imull %3 \n\t" 33 | + "shrdl %4, %%edx, %%eax \n\t" 34 | + :"=a"(rt), "=d"(dummy) 35 | + :"a"(a), "rm"(b), "c"((uint8_t)shift) 36 | + ); 37 | return rt; 38 | } 39 | 40 | @@ -113,19 +121,31 @@ __asm__ volatile(\ 41 | // avoid +32 for shift optimization (gcc should do that ...) 42 | #define NEG_SSR32 NEG_SSR32 43 | static inline int32_t NEG_SSR32( int32_t a, int8_t s){ 44 | + if (__builtin_constant_p(s)) 45 | __asm__ ("sarl %1, %0\n\t" 46 | : "+r" (a) 47 | - : "ic" ((uint8_t)(-s)) 48 | + : "i" (-s & 0x1F) 49 | ); 50 | + else 51 | + __asm__ ("sarl %1, %0\n\t" 52 | + : "+r" (a) 53 | + : "c" ((uint8_t)(-s)) 54 | + ); 55 | return a; 56 | } 57 | 58 | #define NEG_USR32 NEG_USR32 59 | static inline uint32_t NEG_USR32(uint32_t a, int8_t s){ 60 | + if (__builtin_constant_p(s)) 61 | __asm__ ("shrl %1, %0\n\t" 62 | : "+r" (a) 63 | - : "ic" ((uint8_t)(-s)) 64 | + : "i" (-s & 0x1F) 65 | ); 66 | + else 67 | + __asm__ ("shrl %1, %0\n\t" 68 | + : "+r" (a) 69 | + : "c" ((uint8_t)(-s)) 70 | + ); 71 | return a; 72 | } 73 | 74 | -- 75 | 2.25.1 76 | -------------------------------------------------------------------------------- /dev-util/electron/files/chromium-108-debug-build-fixes.patch: -------------------------------------------------------------------------------- 1 | From 8d44c1a5096081ae86be0c5c690d5d15b8d2584d Mon Sep 17 00:00:00 2001 2 | From: "System user; portage" 3 | Date: Tue, 30 May 2023 14:26:07 -0700 4 | Subject: [PATCH] Debug build fixes 5 | 6 | --- 7 | base/allocator/partition_allocator/partition_alloc_forward.h | 1 + 8 | 1 file changed, 1 insertion(+) 9 | 10 | diff --git a/base/allocator/partition_allocator/partition_alloc_forward.h b/base/allocator/partition_allocator/partition_alloc_forward.h 11 | index fd62e11..5d6e614 100644 12 | --- a/base/allocator/partition_allocator/partition_alloc_forward.h 13 | +++ b/base/allocator/partition_allocator/partition_alloc_forward.h 14 | @@ -7,6 +7,7 @@ 15 | 16 | #include 17 | #include 18 | +#include 19 | 20 | #include "base/allocator/partition_allocator/partition_alloc_base/compiler_specific.h" 21 | #include "base/allocator/partition_allocator/partition_alloc_base/component_export.h" 22 | -- 23 | 2.39.3 24 | 25 | -------------------------------------------------------------------------------- /dev-util/electron/files/chromium-108-glslang.patch: -------------------------------------------------------------------------------- 1 | From 008068cbaf78ab03ee8cfbedad7c678c9cbe1277 Mon Sep 17 00:00:00 2001 2 | From: Elvis Pranskevichus 3 | Date: Thu, 18 Apr 2024 16:07:50 -0700 4 | Subject: [PATCH] GLSLANG fix 5 | 6 | --- 7 | third_party/angle/include/GLSLANG/ShaderVars.h | 1 + 8 | 1 file changed, 1 insertion(+) 9 | 10 | diff --git a/third_party/angle/include/GLSLANG/ShaderVars.h b/third_party/angle/include/GLSLANG/ShaderVars.h 11 | index 4b76d33..4db1902 100644 12 | --- a/third_party/angle/include/GLSLANG/ShaderVars.h 13 | +++ b/third_party/angle/include/GLSLANG/ShaderVars.h 14 | @@ -12,6 +12,7 @@ 15 | 16 | #include 17 | #include 18 | +#include 19 | #include 20 | #include 21 | 22 | -- 23 | 2.43.2 24 | 25 | -------------------------------------------------------------------------------- /dev-util/electron/files/chromium-108-revert-GlobalMediaControlsCastStartStop.patch: -------------------------------------------------------------------------------- 1 | From b58f0f2725a8c1a8a131f9984b5fd53b54119dba Mon Sep 17 00:00:00 2001 2 | From: Muyao Xu 3 | Date: Thu, 20 Jan 2022 23:46:21 +0000 4 | Subject: [PATCH] [Zenith] Enable GlobalMediaControlsCastStartStop flag by 5 | default 6 | 7 | The feature is rolled out to 100% stable through finch for M96+. 8 | This CL enables it by default and fixes some unit tests failures. 9 | 10 | Bug: 1287242, 1287305 11 | Change-Id: I7e5c9625b77379fef253c41ef292a0dd6fc366fb 12 | Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3388416 13 | Reviewed-by: Takumi Fujimoto 14 | Commit-Queue: Muyao Xu 15 | Cr-Commit-Position: refs/heads/main@{#961658} 16 | --- 17 | chrome/browser/media/router/media_router_feature.cc | 2 +- 18 | 1 file changed, 1 insertion(+), 1 deletion(-) 19 | 20 | diff --git a/chrome/browser/media/router/media_router_feature.cc b/chrome/browser/media/router/media_router_feature.cc 21 | index 862329e..47c8912 100644 22 | --- a/chrome/browser/media/router/media_router_feature.cc 23 | +++ b/chrome/browser/media/router/media_router_feature.cc 24 | @@ -54,7 +54,7 @@ BASE_FEATURE(kGlobalMediaControlsCastStartStop, 25 | #else 26 | BASE_FEATURE(kGlobalMediaControlsCastStartStop, 27 | "GlobalMediaControlsCastStartStop", 28 | - base::FEATURE_ENABLED_BY_DEFAULT); 29 | + base::FEATURE_DISABLED_BY_DEFAULT); 30 | #endif // BUILDFLAG(IS_CHROMEOS) 31 | 32 | #endif // !BUILDFLAG(IS_ANDROID) 33 | -- 34 | 2.35.1 35 | 36 | -------------------------------------------------------------------------------- /dev-util/electron/files/chromium-109-system-zlib.patch: -------------------------------------------------------------------------------- 1 | --- a/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc 2 | +++ b/third_party/tflite_support/src/tensorflow_lite_support/metadata/cc/utils/zip_readonly_mem_file.cc 3 | @@ -19,7 +19,6 @@ limitations under the License. 4 | #include 5 | 6 | #include "absl/strings/string_view.h" // from @com_google_absl 7 | -#include "third_party/zlib/contrib/minizip/ioapi.h" 8 | 9 | namespace tflite { 10 | namespace metadata { 11 | -------------------------------------------------------------------------------- /dev-util/electron/files/chromium-111-InkDropHost-crash.patch: -------------------------------------------------------------------------------- 1 | https://chromium-review.googlesource.com/c/chromium/src/+/2959890 2 | 3 | --- a/ui/views/animation/ink_drop_host.h 4 | +++ b/ui/views/animation/ink_drop_host.h 5 | @@ -238,6 +238,11 @@ class VIEWS_EXPORT InkDropHost { 6 | // Used to observe View and inform the InkDrop of host-transform changes. 7 | ViewLayerTransformObserver host_view_transform_observer_; 8 | 9 | + // Declared before |ink_drop_|, because InkDropImpl may call 10 | + // RemoveInkDropLayer on partly destructed InkDropHost. In 11 | + // that case |ink_drop_mask_| must be still valid. 12 | + std::unique_ptr ink_drop_mask_; 13 | + 14 | // Should not be accessed directly. Use GetInkDrop() instead. 15 | std::unique_ptr ink_drop_; 16 | 17 | @@ -261,8 +266,6 @@ class VIEWS_EXPORT InkDropHost { 18 | int ink_drop_small_corner_radius_ = 2; 19 | int ink_drop_large_corner_radius_ = 4; 20 | 21 | - std::unique_ptr ink_drop_mask_; 22 | - 23 | base::RepeatingCallback()> create_ink_drop_callback_; 24 | base::RepeatingCallback()> 25 | create_ink_drop_ripple_callback_; 26 | -------------------------------------------------------------------------------- /dev-util/electron/files/chromium-112-sql-relax.patch: -------------------------------------------------------------------------------- 1 | From 7d1394bd639e3bcf68082ac3fc33eeed6a00d2e6 Mon Sep 17 00:00:00 2001 2 | From: Elly Fong-Jones 3 | Date: Thu, 02 Mar 2023 00:15:11 +0000 4 | Subject: [PATCH] sql: relax constraints on VirtualCursor layout 5 | 6 | VirtualCursor::FromSqliteCursor required that VirtualCursor had a 7 | standard layout, but in fact VirtualCursor shouldn't have a standard 8 | layout, and the fact that it does with libc++ is a deviation from the 9 | C++ standard. This change: 10 | 11 | 1. Relaxes the requirement that VirtualCursor has a standard layout, and 12 | 2. Relaxes the requirement that the sqlite_cursor_ field has to be at 13 | offset 0 14 | 15 | by use of offsetof() and pointer subtraction. This change both improves 16 | standards compliance and makes this code build with libstdc++. 17 | 18 | Bug: 1380656 19 | Change-Id: I9c47abd9197b187da0360ca5619ccf7dadab4f33 20 | Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4292313 21 | Reviewed-by: Austin Sullivan 22 | Commit-Queue: Elly Fong-Jones 23 | Cr-Commit-Position: refs/heads/main@{#1111925} 24 | --- 25 | 26 | diff --git a/sql/recover_module/cursor.h b/sql/recover_module/cursor.h 27 | index 1970bdca..4cb0655 100644 28 | --- a/sql/recover_module/cursor.h 29 | +++ b/sql/recover_module/cursor.h 30 | @@ -63,12 +63,10 @@ 31 | // |sqlite_cursor| must have been returned by VirtualTable::SqliteCursor(). 32 | static inline VirtualCursor* FromSqliteCursor( 33 | sqlite3_vtab_cursor* sqlite_cursor) { 34 | - static_assert(std::is_standard_layout::value, 35 | - "needed for the reinterpret_cast below"); 36 | - static_assert(offsetof(VirtualCursor, sqlite_cursor_) == 0, 37 | - "sqlite_cursor_ must be the first member of the class"); 38 | - VirtualCursor* result = reinterpret_cast(sqlite_cursor); 39 | - DCHECK_EQ(sqlite_cursor, &result->sqlite_cursor_); 40 | + VirtualCursor* result = reinterpret_cast( 41 | + (reinterpret_cast(sqlite_cursor) - 42 | + offsetof(VirtualCursor, sqlite_cursor_))); 43 | + CHECK_EQ(sqlite_cursor, &result->sqlite_cursor_); 44 | return result; 45 | } 46 | 47 | -------------------------------------------------------------------------------- /dev-util/electron/files/chromium-117-system-zstd.patch: -------------------------------------------------------------------------------- 1 | From ae3ae3711784865bdc38bf119a6182a7b8dae91c Mon Sep 17 00:00:00 2001 2 | From: Matt Jolly 3 | Date: Sun, 17 Sep 2023 16:51:42 +1000 4 | Subject: [PATCH] Add system-zstd 5 | 6 | --- a/build/linux/unbundle/replace_gn_files.py 7 | +++ b/build/linux/unbundle/replace_gn_files.py 8 | @@ -74,6 +74,7 @@ REPLACEMENTS = { 9 | # 10 | 'woff2': 'third_party/woff2/BUILD.gn', 11 | 'zlib': 'third_party/zlib/BUILD.gn', 12 | + 'zstd': 'third_party/zstd/BUILD.gn', 13 | } 14 | 15 | 16 | --- /dev/null 17 | +++ b/build/linux/unbundle/zstd.gn 18 | @@ -0,0 +1,25 @@ 19 | +import("//build/config/linux/pkg_config.gni") 20 | +import("//build/shim_headers.gni") 21 | + 22 | +pkg_config("system_zstd") { 23 | + packages = [ "libzstd" ] 24 | +} 25 | + 26 | +shim_headers("zstd_shim") { 27 | + root_path = "src/lib" 28 | + headers = [ 29 | + "zdict.h", 30 | + "zstd.h", 31 | + "zstd_errors.h", 32 | + ] 33 | +} 34 | + 35 | +source_set("zstd") { 36 | + deps = [ ":zstd_shim" ] 37 | + public_configs = [ ":system_zstd" ] 38 | +} 39 | + 40 | +source_set("decompress") { 41 | + deps = [ ":zstd_shim" ] 42 | + public_configs = [ ":system_zstd" ] 43 | +} 44 | -- 45 | 2.42.0 46 | 47 | -------------------------------------------------------------------------------- /dev-util/electron/files/chromium-119.0.6045.159-icu-74.patch: -------------------------------------------------------------------------------- 1 | https://bugs.gentoo.org/917645 2 | (copied patch from qtwebengine:6 - https://bugs.gentoo.org/917633) 3 | 4 | Quick fix for a static_assert failure with icu74. Still waiting 5 | for a proper upstream fix and unknown if entirely right, but is 6 | an extension of [1] (is now 48 rather than 43). 7 | 8 | [1] https://crrev.com/e60b571faa3f14dd9119a6792dccf12f8bf80192 9 | --- a/third_party/blink/renderer/platform/text/text_break_iterator.cc 10 | +++ b/third_party/blink/renderer/platform/text/text_break_iterator.cc 11 | @@ -161,7 +161,9 @@ static const unsigned char kAsciiLineBreakTable[][(kAsciiLineBreakTableLastChar 12 | }; 13 | // clang-format on 14 | 15 | -#if U_ICU_VERSION_MAJOR_NUM >= 58 16 | +#if U_ICU_VERSION_MAJOR_NUM >= 74 17 | +#define BA_LB_COUNT (U_LB_COUNT - 8) 18 | +#elif U_ICU_VERSION_MAJOR_NUM >= 58 19 | #define BA_LB_COUNT (U_LB_COUNT - 3) 20 | #else 21 | #define BA_LB_COUNT U_LB_COUNT 22 | -------------------------------------------------------------------------------- /dev-util/electron/files/chromium-124-libwebp-shim-sharpyuv.patch: -------------------------------------------------------------------------------- 1 | From 40c466949bd8ccb61cb55655848d23684a9f8a94 Mon Sep 17 00:00:00 2001 2 | From: Matt Jolly 3 | Date: Mon, 25 Mar 2024 21:38:35 +1000 4 | Subject: [PATCH] libwebp shim: add libwebp_sharpyuv target 5 | 6 | Signed-off-by: Matt Jolly 7 | --- a/build/linux/unbundle/libwebp.gn 8 | +++ b/build/linux/unbundle/libwebp.gn 9 | @@ -22,14 +22,24 @@ shim_headers("libwebp_shim") { 10 | "webp/mux.h", 11 | "webp/mux_types.h", 12 | "webp/types.h", 13 | + "webp/sharpyuv/sharpyuv.h", 14 | + "webp/sharpyuv/sharpyuv_csp.h", 15 | ] 16 | } 17 | 18 | +source_set("libwebp_sharpyuv") { 19 | + deps = [ ":libwebp_shim" ] 20 | + public_configs = [ ":system_libwebp" ] 21 | +} 22 | + 23 | source_set("libwebp_webp") { 24 | deps = [ ":libwebp_shim" ] 25 | public_configs = [ ":system_libwebp" ] 26 | } 27 | 28 | group("libwebp") { 29 | - deps = [ ":libwebp_webp" ] 30 | + deps = [ 31 | + ":libwebp_webp", 32 | + ":libwebp_sharpyuv" 33 | + ] 34 | } 35 | -- 36 | 2.44.0 37 | -------------------------------------------------------------------------------- /dev-util/electron/files/chromium-125-ninja-1-12.patch: -------------------------------------------------------------------------------- 1 | https://chromium-review.googlesource.com/c/chromium/src/+/5487538 2 | commit a976cb05b4024b7a6452d1541378d718cdfe33e6 3 | Author: Takuto Ikuta 4 | Date: Thu Apr 25 07:25:32 2024 5 | 6 | [devtools] fix a missing build dependency to a generated file 7 | 8 | --- a/chrome/browser/devtools/BUILD.gn 9 | +++ b/chrome/browser/devtools/BUILD.gn 10 | @@ -117,6 +117,7 @@ 11 | "//chrome/browser/autofill:autofill", 12 | "//components/autofill/content/browser:browser", 13 | "//components/autofill/core/browser:browser", 14 | + "//components/enterprise/buildflags", 15 | "//components/paint_preview/buildflags:buildflags", 16 | "//components/variations/service:service", 17 | "//components/webapps/common:common", 18 | -------------------------------------------------------------------------------- /dev-util/electron/files/chromium-126-oauth2-client-switches.patch: -------------------------------------------------------------------------------- 1 | From b6cda4bc2283a02a5b5209c0f4282a8365f6f33e Mon Sep 17 00:00:00 2001 2 | From: Matt Jolly 3 | Date: Tue, 21 May 2024 10:04:24 +1000 4 | Subject: [PATCH] www-client/chromium: work around dead oauth2 credentials - 5 | 126 update 6 | 7 | 126 changed the function proto; patch rebased. 8 | 9 | Google doesn't let us bake in OAuth2 credentials, and for some time, 10 | Google sign-in has been broken. Arch dealt with this in March, and so 11 | did we to some degree, but in the last few months, our sign-in 12 | credentials have been broken. It appears that we actually did remove API 13 | credentials in March around Chrome 89, but they got added back, perhaps 14 | when rotating newer versions to replace older versions. Work around this 15 | by following Arch's lead: we remove the predefined credentials, as 16 | before, but also we patch Chromium so that people can use their own 17 | easily, using Arch's patch for that. 18 | 19 | For more info, see: 20 | 21 | https://archlinux.org/news/chromium-losing-sync-support-in-early-march/ 22 | https://bodhi.fedoraproject.org/updates/FEDORA-2021-48866282e5 23 | https://hackaday.com/2021/01/26/whats-the-deal-with-chromium-on-linux-google-at-odds-with-package-maintainers/ 24 | 25 | Bug: https://bugs.gentoo.org/791871 26 | Signed-off-by: Matt Jolly 27 | --- a/google_apis/google_api_keys-inc.cc 28 | +++ b/google_apis/google_api_keys-inc.cc 29 | @@ -193,11 +193,11 @@ class APIKeyCache { 30 | std::string default_client_id = CalculateKeyValue( 31 | GOOGLE_DEFAULT_CLIENT_ID, 32 | STRINGIZE_NO_EXPANSION(GOOGLE_DEFAULT_CLIENT_ID), std::string(), 33 | - nullptr, std::string(), environment.get(), command_line, gaia_config); 34 | + ::switches::kOAuth2ClientID, std::string(), environment.get(), command_line, gaia_config); 35 | std::string default_client_secret = CalculateKeyValue( 36 | GOOGLE_DEFAULT_CLIENT_SECRET, 37 | STRINGIZE_NO_EXPANSION(GOOGLE_DEFAULT_CLIENT_SECRET), std::string(), 38 | - nullptr, std::string(), environment.get(), command_line, gaia_config); 39 | + ::switches::kOAuth2ClientSecret, std::string(), environment.get(), command_line, gaia_config); 40 | 41 | // We currently only allow overriding the baked-in values for the 42 | // default OAuth2 client ID and secret using a command-line 43 | -- 44 | 2.45.1 45 | 46 | -------------------------------------------------------------------------------- /dev-util/electron/files/chromium-127-bindgen-custom-toolchain.patch: -------------------------------------------------------------------------------- 1 | From 6df5a080f58ddb6a49a9d33e4a3619a34fffa78c Mon Sep 17 00:00:00 2001 2 | From: Matt Jolly 3 | Date: Fri, 5 Jul 2024 20:49:01 +1000 4 | Subject: [PATCH] Make bindgen wrapper work with unbundled toolchain 5 | 6 | The `run_bindgen.py` wrapper takes a --libclang-path option 7 | and uses it to set the appropriate environment variable. 8 | 9 | This is currently hardcoded to use libclang shipped alongside 10 | bindgen (in our rust toolchain), but distributions may want to 11 | override this and use a system path. 12 | 13 | Additionally enable distros to feed in appropriate library paths. 14 | --- 15 | build/config/rust.gni | 11 +++++++++++ 16 | build/rust/rust_bindgen.gni | 28 ++++++++++++++++++---------- 17 | 2 files changed, 29 insertions(+), 10 deletions(-) 18 | 19 | diff --git a/build/config/rust.gni b/build/config/rust.gni 20 | index 97e788a227..78b9daa7e8 100644 21 | --- a/build/config/rust.gni 22 | +++ b/build/config/rust.gni 23 | @@ -60,6 +60,17 @@ declare_args() { 24 | # the bindgen exectuable). 25 | rust_bindgen_root = "//third_party/rust-toolchain" 26 | 27 | + # Directory under which to find one of `libclang.{dll,so}` (a `lib[64]` or 28 | + # `bin` directory containing the libclang shared library). 29 | + # We don't need to worry about multlib, but specify the full path here 30 | + # in case a distribution does. 31 | + if (host_os == "win") { 32 | + bindgen_libclang_path = "//third_party/rust-toolchain/bin" 33 | + } else { 34 | + bindgen_libclang_path = "//third_party/rust-toolchain/lib" 35 | + } 36 | + 37 | + 38 | # If you're using a Rust toolchain as specified by rust_sysroot_absolute, 39 | # set this to the output of `rustc -V`. Changing this string will cause all 40 | # Rust targets to be rebuilt, which allows you to update your toolchain and 41 | diff --git a/build/rust/rust_bindgen.gni b/build/rust/rust_bindgen.gni 42 | index bf110ca93c..d7eb04eb00 100644 43 | --- a/build/rust/rust_bindgen.gni 44 | +++ b/build/rust/rust_bindgen.gni 45 | @@ -16,13 +16,13 @@ if (host_os == "win") { 46 | _bindgen_path = "${_bindgen_path}.exe" 47 | } 48 | 49 | -# On Windows, the libclang.dll is beside the bindgen.exe, otherwise it is in 50 | -# ../lib. 51 | -_libclang_path = rust_bindgen_root 52 | -if (host_os == "win") { 53 | - _libclang_path += "/bin" 54 | +if (clang_base_path != default_clang_base_path && custom_toolchain == "//build/toolchain/linux/unbundle:default") { 55 | + # Assume that the user has set this up properly, including handling multilib 56 | + _clang_libpath = clang_base_path + "/include" 57 | + _clang_ld_libpath = bindgen_libclang_path 58 | } else { 59 | - _libclang_path += "/lib" 60 | + _clang_libpath = clang_base_path + "/lib/clang/" + clang_version 61 | + _clang_ld_libpath = clang_base_path + "/lib" 62 | } 63 | 64 | # Template to build Rust/C bindings with bindgen. 65 | @@ -100,7 +100,7 @@ template("rust_bindgen") { 66 | "--output", 67 | rebase_path(out_gen_rs, root_build_dir), 68 | "--libclang-path", 69 | - rebase_path(_libclang_path, root_build_dir), 70 | + rebase_path(bindgen_libclang_path, root_build_dir), 71 | ] 72 | 73 | if (wrap_static_fns) { 74 | @@ -117,7 +117,7 @@ template("rust_bindgen") { 75 | # point to. 76 | args += [ 77 | "--ld-library-path", 78 | - rebase_path(clang_base_path + "/lib", root_build_dir), 79 | + rebase_path(_clang_ld_libpath, root_build_dir), 80 | ] 81 | } 82 | 83 | @@ -145,8 +145,7 @@ template("rust_bindgen") { 84 | # make it behave consistently with our other command line flags and allows 85 | # system headers to be found. 86 | clang_resource_dir = 87 | - rebase_path(clang_base_path + "/lib/clang/" + clang_version, 88 | - root_build_dir) 89 | + rebase_path(_clang_libpath, root_build_dir) 90 | args += [ 91 | "-resource-dir", 92 | clang_resource_dir, 93 | @@ -167,6 +166,15 @@ template("rust_bindgen") { 94 | } 95 | } 96 | 97 | + if (custom_toolchain == "//build/toolchain/linux/unbundle:default") { 98 | + # We need to pass the path to the libstdc++ headers to bindgen so that it 99 | + # can find them when parsing C++ headers. 100 | + args += [ 101 | + "-I", 102 | + rebase_path(clang_base_path + "/include/", root_build_dir), 103 | + ] 104 | + } 105 | + 106 | if (is_win) { 107 | # On Windows we fall back to using system headers from a sysroot from 108 | # depot_tools. This is negotiated by python scripts and the result is 109 | -- 110 | 2.45.2 111 | 112 | -------------------------------------------------------------------------------- /dev-util/electron/files/chromium-127-updater-systemd.patch: -------------------------------------------------------------------------------- 1 | https://github.com/chromium/chromium/commit/570332aad61afab5d9d88a8438bae53ea28a298a 2 | From: Noah Rose Ledesma 3 | Date: Wed, 31 Jul 2024 17:59:12 +0000 4 | Subject: [PATCH] Use libs instead of pkg_config for linux deps 5 | 6 | pkg_config can cause builds to fail if the requested packages are not 7 | present, regardless of if the lib is depended upon by the target being 8 | built. 9 | 10 | This issue can be avoided by setting 'libs' instead. I'm not sure why we 11 | didn't do so in the first place. 12 | 13 | Bug: 355967882 14 | Change-Id: Ie5dc4c03b08d7c1e26458ea143f6dc812b670544 15 | Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5749680 16 | Reviewed-by: Sorin Jianu 17 | Commit-Queue: Noah Rose Ledesma 18 | Cr-Commit-Position: refs/heads/main@{#1335558} 19 | --- a/chrome/updater/BUILD.gn 20 | +++ b/chrome/updater/BUILD.gn 21 | @@ -367,9 +367,10 @@ if (is_win || is_mac || is_linux) { 22 | "update_service_internal_impl_qualifying_linux.cc", 23 | "update_usage_stats_task_linux.cc", 24 | ] 25 | - public_configs = [ 26 | - "linux:libcurl", 27 | - "linux:libsystemd", 28 | + 29 | + libs = [ 30 | + "curl", 31 | + "systemd", 32 | ] 33 | } 34 | } 35 | @@ -1040,7 +1041,7 @@ if (is_win || is_mac || is_linux) { 36 | 37 | data += [ "//chrome/test/data/updater/updater_qualification_app.crx" ] 38 | data_deps += [ "//chrome/updater/linux:updater_test" ] 39 | - public_configs = [ "linux:libsystemd" ] 40 | + libs = [ "systemd" ] 41 | } 42 | 43 | if (is_posix) { 44 | --- a/chrome/updater/linux/BUILD.gn 45 | +++ b/chrome/updater/linux/BUILD.gn 46 | @@ -2,7 +2,6 @@ 47 | # Use of this source code is governed by a BSD-style license that can be 48 | # found in the LICENSE file. 49 | 50 | -import("//build/config/linux/pkg_config.gni") 51 | import("//chrome/updater/zip.gni") 52 | 53 | # This target builds the updater executable and unittests. 54 | @@ -13,18 +12,10 @@ group("linux") { 55 | ] 56 | } 57 | 58 | -pkg_config("libcurl") { 59 | - packages = [ "libcurl" ] 60 | -} 61 | - 62 | -pkg_config("libsystemd") { 63 | - packages = [ "libsystemd" ] 64 | -} 65 | - 66 | source_set("updater_executable") { 67 | sources = [ "main.cc" ] 68 | deps = [ "//chrome/updater:base" ] 69 | - public_configs = [ ":libsystemd" ] 70 | + libs = [ "systemd" ] 71 | } 72 | 73 | executable("updater") { 74 | -------------------------------------------------------------------------------- /dev-util/electron/files/chromium-87-sql-make-VirtualCursor-standard-layout-type.patch: -------------------------------------------------------------------------------- 1 | From 80368f8ba7a8bab13440463a254888311efe3986 Mon Sep 17 00:00:00 2001 2 | From: Stephan Hartmann 3 | Date: Tue, 4 May 2021 15:00:19 +0000 4 | Subject: [PATCH] sql: make VirtualCursor standard layout type 5 | 6 | sql::recover::VirtualCursor needs to be a standard layout type, but 7 | has members of type std::unique_ptr. However, std::unique_ptr is not 8 | guaranteed to be standard layout. Compiling with clang combined with 9 | gcc-11 libstdc++ fails because of this. Replace std::unique_ptr with 10 | raw pointers. 11 | 12 | Bug: 1189788 13 | Change-Id: Ia6dc388cc5ef1c0f2afc75f8ca45b9f12687ca9c 14 | --- 15 | sql/recover_module/btree.cc | 21 +++++++++++++++------ 16 | sql/recover_module/btree.h | 17 +++++++++++++---- 17 | sql/recover_module/cursor.cc | 24 ++++++++++++------------ 18 | sql/recover_module/cursor.h | 2 +- 19 | sql/recover_module/pager.cc | 7 +++---- 20 | sql/recover_module/pager.h | 5 +++-- 21 | 6 files changed, 47 insertions(+), 29 deletions(-) 22 | 23 | diff --git a/sql/recover_module/btree.cc b/sql/recover_module/btree.cc 24 | index 9ecaafe8a3..839318abf9 100644 25 | --- a/sql/recover_module/btree.cc 26 | +++ b/sql/recover_module/btree.cc 27 | @@ -135,16 +135,25 @@ static_assert(std::is_trivially_destructible::value, 28 | "Move the destructor to the .cc file if it's non-trival"); 29 | #endif // !DCHECK_IS_ON() 30 | 31 | -LeafPageDecoder::LeafPageDecoder(DatabasePageReader* db_reader) noexcept 32 | - : page_id_(db_reader->page_id()), 33 | - db_reader_(db_reader), 34 | - cell_count_(ComputeCellCount(db_reader)), 35 | - next_read_index_(0), 36 | - last_record_size_(0) { 37 | +void LeafPageDecoder::Initialize(DatabasePageReader* db_reader) { 38 | + DCHECK(db_reader); 39 | DCHECK(IsOnValidPage(db_reader)); 40 | + page_id_ = db_reader->page_id(); 41 | + db_reader_ = db_reader; 42 | + cell_count_ = ComputeCellCount(db_reader); 43 | + next_read_index_ = 0; 44 | + last_record_size_ = 0; 45 | DCHECK(DatabasePageReader::IsValidPageId(page_id_)); 46 | } 47 | 48 | +void LeafPageDecoder::Reset() { 49 | + db_reader_ = nullptr; 50 | + page_id_ = 0; 51 | + cell_count_ = 0; 52 | + next_read_index_ = 0; 53 | + last_record_size_ = 0; 54 | +} 55 | + 56 | bool LeafPageDecoder::TryAdvance() { 57 | DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); 58 | DCHECK(CanAdvance()); 59 | diff --git a/sql/recover_module/btree.h b/sql/recover_module/btree.h 60 | index d76d076bf6..33114b01fa 100644 61 | --- a/sql/recover_module/btree.h 62 | +++ b/sql/recover_module/btree.h 63 | @@ -102,7 +102,7 @@ class LeafPageDecoder { 64 | // 65 | // |db_reader| must have been used to read an inner page of a table B-tree. 66 | // |db_reader| must outlive this instance. 67 | - explicit LeafPageDecoder(DatabasePageReader* db_reader) noexcept; 68 | + explicit LeafPageDecoder() noexcept = default; 69 | ~LeafPageDecoder() noexcept = default; 70 | 71 | LeafPageDecoder(const LeafPageDecoder&) = delete; 72 | @@ -150,6 +150,15 @@ class LeafPageDecoder { 73 | // read as long as CanAdvance() returns true. 74 | bool TryAdvance(); 75 | 76 | + // Initialize with DatabasePageReader 77 | + void Initialize(DatabasePageReader* db_reader); 78 | + 79 | + // Reset internal DatabasePageReader 80 | + void Reset(); 81 | + 82 | + // True if DatabasePageReader is valid 83 | + bool IsValid() { return (db_reader_ != nullptr); } 84 | + 85 | // True if the given reader may point to an inner page in a table B-tree. 86 | // 87 | // The last ReadPage() call on |db_reader| must have succeeded. 88 | @@ -163,14 +172,14 @@ class LeafPageDecoder { 89 | static int ComputeCellCount(DatabasePageReader* db_reader); 90 | 91 | // The number of the B-tree page this reader is reading. 92 | - const int64_t page_id_; 93 | + int64_t page_id_; 94 | // Used to read the tree page. 95 | // 96 | // Raw pointer usage is acceptable because this instance's owner is expected 97 | // to ensure that the DatabasePageReader outlives this. 98 | - DatabasePageReader* const db_reader_; 99 | + DatabasePageReader* db_reader_; 100 | // Caches the ComputeCellCount() value for this reader's page. 101 | - const int cell_count_ = ComputeCellCount(db_reader_); 102 | + int cell_count_; 103 | 104 | // The reader's cursor state. 105 | // 106 | diff --git a/sql/recover_module/cursor.cc b/sql/recover_module/cursor.cc 107 | index 0029ff9295..42548bc4b5 100644 108 | --- a/sql/recover_module/cursor.cc 109 | +++ b/sql/recover_module/cursor.cc 110 | @@ -26,7 +26,7 @@ VirtualCursor::~VirtualCursor() { 111 | int VirtualCursor::First() { 112 | DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); 113 | inner_decoders_.clear(); 114 | - leaf_decoder_ = nullptr; 115 | + leaf_decoder_.Reset(); 116 | 117 | AppendPageDecoder(table_->root_page_id()); 118 | return Next(); 119 | @@ -36,18 +36,18 @@ int VirtualCursor::Next() { 120 | DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); 121 | record_reader_.Reset(); 122 | 123 | - while (!inner_decoders_.empty() || leaf_decoder_.get()) { 124 | - if (leaf_decoder_.get()) { 125 | - if (!leaf_decoder_->CanAdvance()) { 126 | + while (!inner_decoders_.empty() || leaf_decoder_.IsValid()) { 127 | + if (leaf_decoder_.IsValid()) { 128 | + if (!leaf_decoder_.CanAdvance()) { 129 | // The leaf has been exhausted. Remove it from the DFS stack. 130 | - leaf_decoder_ = nullptr; 131 | + leaf_decoder_.Reset(); 132 | continue; 133 | } 134 | - if (!leaf_decoder_->TryAdvance()) 135 | + if (!leaf_decoder_.TryAdvance()) 136 | continue; 137 | 138 | - if (!payload_reader_.Initialize(leaf_decoder_->last_record_size(), 139 | - leaf_decoder_->last_record_offset())) { 140 | + if (!payload_reader_.Initialize(leaf_decoder_.last_record_size(), 141 | + leaf_decoder_.last_record_offset())) { 142 | continue; 143 | } 144 | if (!record_reader_.Initialize()) 145 | @@ -99,13 +99,13 @@ int VirtualCursor::ReadColumn(int column_index, 146 | int64_t VirtualCursor::RowId() { 147 | DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); 148 | DCHECK(record_reader_.IsInitialized()); 149 | - DCHECK(leaf_decoder_.get()); 150 | - return leaf_decoder_->last_record_rowid(); 151 | + DCHECK(leaf_decoder_.IsValid()); 152 | + return leaf_decoder_.last_record_rowid(); 153 | } 154 | 155 | void VirtualCursor::AppendPageDecoder(int page_id) { 156 | DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); 157 | - DCHECK(leaf_decoder_.get() == nullptr) 158 | + DCHECK(!leaf_decoder_.IsValid()) 159 | << __func__ 160 | << " must only be called when the current path has no leaf decoder"; 161 | 162 | @@ -113,7 +113,7 @@ void VirtualCursor::AppendPageDecoder(int page_id) { 163 | return; 164 | 165 | if (LeafPageDecoder::IsOnValidPage(&db_reader_)) { 166 | - leaf_decoder_ = std::make_unique(&db_reader_); 167 | + leaf_decoder_.Initialize(&db_reader_); 168 | return; 169 | } 170 | 171 | diff --git a/sql/recover_module/cursor.h b/sql/recover_module/cursor.h 172 | index afcd6900e1..b15c31d425 100644 173 | --- a/sql/recover_module/cursor.h 174 | +++ b/sql/recover_module/cursor.h 175 | @@ -129,7 +129,7 @@ class VirtualCursor { 176 | std::vector> inner_decoders_; 177 | 178 | // Decodes the leaf page containing records. 179 | - std::unique_ptr leaf_decoder_; 180 | + LeafPageDecoder leaf_decoder_; 181 | 182 | SEQUENCE_CHECKER(sequence_checker_); 183 | }; 184 | diff --git a/sql/recover_module/pager.cc b/sql/recover_module/pager.cc 185 | index 58e75de270..5fe96204e5 100644 186 | --- a/sql/recover_module/pager.cc 187 | +++ b/sql/recover_module/pager.cc 188 | @@ -23,8 +23,7 @@ static_assert(DatabasePageReader::kMaxPageId <= std::numeric_limits::max(), 189 | "ints are not appropriate for representing page IDs"); 190 | 191 | DatabasePageReader::DatabasePageReader(VirtualTable* table) 192 | - : page_data_(std::make_unique(table->page_size())), 193 | - table_(table) { 194 | + : page_data_(), table_(table) { 195 | DCHECK(table != nullptr); 196 | DCHECK(IsValidPageSize(table->page_size())); 197 | } 198 | @@ -57,8 +56,8 @@ int DatabasePageReader::ReadPage(int page_id) { 199 | std::numeric_limits::max(), 200 | "The |read_offset| computation above may overflow"); 201 | 202 | - int sqlite_status = 203 | - RawRead(sqlite_file, read_size, read_offset, page_data_.get()); 204 | + int sqlite_status = RawRead(sqlite_file, read_size, read_offset, 205 | + const_cast(page_data_.data())); 206 | 207 | // |page_id_| needs to be set to kInvalidPageId if the read failed. 208 | // Otherwise, future ReadPage() calls with the previous |page_id_| value 209 | diff --git a/sql/recover_module/pager.h b/sql/recover_module/pager.h 210 | index 0e388ddc3b..99314e30ff 100644 211 | --- a/sql/recover_module/pager.h 212 | +++ b/sql/recover_module/pager.h 213 | @@ -5,6 +5,7 @@ 214 | #ifndef SQL_RECOVER_MODULE_PAGER_H_ 215 | #define SQL_RECOVER_MODULE_PAGER_H_ 216 | 217 | +#include 218 | #include 219 | #include 220 | 221 | @@ -70,7 +71,7 @@ class DatabasePageReader { 222 | DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); 223 | DCHECK_NE(page_id_, kInvalidPageId) 224 | << "Successful ReadPage() required before accessing pager state"; 225 | - return page_data_.get(); 226 | + return page_data_.data(); 227 | } 228 | 229 | // The number of bytes in the page read by the last ReadPage() call. 230 | @@ -137,7 +138,7 @@ class DatabasePageReader { 231 | int page_id_ = kInvalidPageId; 232 | // Stores the bytes of the last page successfully read by ReadPage(). 233 | // The content is undefined if the last call to ReadPage() did not succeed. 234 | - const std::unique_ptr page_data_; 235 | + const std::array page_data_; 236 | // Raw pointer usage is acceptable because this instance's owner is expected 237 | // to ensure that the VirtualTable outlives this. 238 | VirtualTable* const table_; 239 | -------------------------------------------------------------------------------- /dev-util/electron/files/chromium-89-EnumTable-crash.patch: -------------------------------------------------------------------------------- 1 | diff --git a/components/cast_channel/enum_table.h b/components/cast_channel/enum_table.h 2 | index e3130c7..2ad16ea 100644 3 | --- a/components/cast_channel/enum_table.h 4 | +++ b/components/cast_channel/enum_table.h 5 | @@ -212,7 +212,7 @@ class 6 | 7 | template 8 | friend class EnumTable; 9 | - DISALLOW_COPY_AND_ASSIGN(GenericEnumTableEntry); 10 | + DISALLOW_ASSIGN(GenericEnumTableEntry); 11 | }; 12 | 13 | // Yes, these constructors really needs to be inlined. Even though they look 14 | @@ -250,8 +250,7 @@ class EnumTable { 15 | // Constructor for regular entries. 16 | constexpr Entry(E value, base::StringPiece str) 17 | : GenericEnumTableEntry(static_cast(value), str) {} 18 | - 19 | - DISALLOW_COPY_AND_ASSIGN(Entry); 20 | + DISALLOW_ASSIGN(Entry); 21 | }; 22 | 23 | static_assert(sizeof(E) <= sizeof(int32_t), 24 | @@ -306,15 +305,14 @@ class EnumTable { 25 | if (is_sorted_) { 26 | const std::size_t index = static_cast(value); 27 | if (ANALYZER_ASSUME_TRUE(index < data_.size())) { 28 | - const auto& entry = data_.begin()[index]; 29 | + const auto& entry = data_[index]; 30 | if (ANALYZER_ASSUME_TRUE(entry.has_str())) 31 | return entry.str(); 32 | } 33 | return base::nullopt; 34 | } 35 | return GenericEnumTableEntry::FindByValue( 36 | - reinterpret_cast(data_.begin()), 37 | - data_.size(), static_cast(value)); 38 | + &data_[0], data_.size(), static_cast(value)); 39 | } 40 | 41 | // This overload of GetString is designed for cases where the argument is a 42 | @@ -342,8 +340,7 @@ class EnumTable { 43 | // enum value directly. 44 | base::Optional GetEnum(base::StringPiece str) const { 45 | auto* entry = GenericEnumTableEntry::FindByString( 46 | - reinterpret_cast(data_.begin()), 47 | - data_.size(), str); 48 | + &data_[0], data_.size(), str); 49 | return entry ? static_cast(entry->value) : base::Optional(); 50 | } 51 | 52 | @@ -358,7 +355,7 @@ class EnumTable { 53 | // Align the data on a cache line boundary. 54 | alignas(64) 55 | #endif 56 | - std::initializer_list data_; 57 | + const std::vector data_; 58 | bool is_sorted_; 59 | 60 | constexpr EnumTable(std::initializer_list data, bool is_sorted) 61 | @@ -370,8 +367,8 @@ class EnumTable { 62 | 63 | for (std::size_t i = 0; i < data.size(); i++) { 64 | for (std::size_t j = i + 1; j < data.size(); j++) { 65 | - const Entry& ei = data.begin()[i]; 66 | - const Entry& ej = data.begin()[j]; 67 | + const Entry& ei = data[i]; 68 | + const Entry& ej = data[j]; 69 | DCHECK(ei.value != ej.value) 70 | << "Found duplicate enum values at indices " << i << " and " << j; 71 | DCHECK(!(ei.has_str() && ej.has_str() && ei.str() == ej.str())) 72 | -------------------------------------------------------------------------------- /dev-util/electron/files/chromium-93-InkDropHost-crash.patch: -------------------------------------------------------------------------------- 1 | diff --git a/ui/views/animation/ink_drop_host_view.h b/ui/views/animation/ink_drop_host_view.h 2 | index bd0975b..e5df288 100644 3 | --- a/ui/views/animation/ink_drop_host_view.h 4 | +++ b/ui/views/animation/ink_drop_host_view.h 5 | @@ -238,6 +238,11 @@ class VIEWS_EXPORT InkDropHost { 6 | // Used to observe View and inform the InkDrop of host-transform changes. 7 | ViewLayerTransformObserver host_view_transform_observer_; 8 | 9 | + // Declared before |ink_drop_|, because InkDropImpl may call 10 | + // RemoveInkDropLayer on partly destructed InkDropHost. In 11 | + // that case |ink_drop_mask_| must be still valid. 12 | + std::unique_ptr ink_drop_mask_; 13 | + 14 | // Should not be accessed directly. Use GetInkDrop() instead. 15 | std::unique_ptr ink_drop_; 16 | 17 | @@ -261,8 +266,6 @@ class VIEWS_EXPORT InkDropHost { 18 | int ink_drop_small_corner_radius_ = 2; 19 | int ink_drop_large_corner_radius_ = 4; 20 | 21 | - std::unique_ptr ink_drop_mask_; 22 | - 23 | base::RepeatingCallback()> create_ink_drop_callback_; 24 | base::RepeatingCallback()> 25 | create_ink_drop_ripple_callback_; 26 | -------------------------------------------------------------------------------- /dev-util/electron/files/chromium-97-arm-tflite-cast.patch: -------------------------------------------------------------------------------- 1 | vreinterpret_s32_s8() casts int8x8_t to int32x2_t. However, third argument 2 | of vdotq_lane_s32() is of type int8x8_t. 3 | 4 | --- a/third_party/tflite/src/tensorflow/lite/kernels/internal/optimized/depthwiseconv_3x3_filter_common.h 5 | +++ b/third_party/tflite/src/tensorflow/lite/kernels/internal/optimized/depthwiseconv_3x3_filter_common.h 6 | @@ -129,16 +129,14 @@ inline int32x4_t vdotq_four_lane_s32(int32x4_t acc, int8x16_t lhs, 7 | int8x16_t rhs, const int lane) { 8 | switch (lane) { 9 | case 0: 10 | - return vdotq_lane_s32(acc, lhs, vreinterpret_s32_s8(vget_low_s8(rhs)), 0); 11 | + return vdotq_lane_s32(acc, lhs, vget_low_s8(rhs), 0); 12 | case 1: 13 | - return vdotq_lane_s32(acc, lhs, vreinterpret_s32_s8(vget_low_s8(rhs)), 1); 14 | + return vdotq_lane_s32(acc, lhs, vget_low_s8(rhs), 1); 15 | case 2: 16 | - return vdotq_lane_s32(acc, lhs, vreinterpret_s32_s8(vget_high_s8(rhs)), 17 | - 0); 18 | + return vdotq_lane_s32(acc, lhs, vget_high_s8(rhs), 0); 19 | case 3: 20 | default: 21 | - return vdotq_lane_s32(acc, lhs, vreinterpret_s32_s8(vget_high_s8(rhs)), 22 | - 1); 23 | + return vdotq_lane_s32(acc, lhs, vget_high_s8(rhs), 1); 24 | } 25 | } 26 | 27 | -------------------------------------------------------------------------------- /dev-util/electron/files/chromium-98-EnumTable-crash.patch: -------------------------------------------------------------------------------- 1 | diff --git a/components/cast_channel/enum_table.h b/components/cast_channel/enum_table.h 2 | index 842553a..89de703 100644 3 | --- a/components/cast_channel/enum_table.h 4 | +++ b/components/cast_channel/enum_table.h 5 | @@ -8,6 +8,7 @@ 6 | #include 7 | #include 8 | #include 9 | +#include 10 | 11 | #include "base/check_op.h" 12 | #include "base/notreached.h" 13 | @@ -187,7 +188,6 @@ class 14 | inline constexpr GenericEnumTableEntry(int32_t value); 15 | inline constexpr GenericEnumTableEntry(int32_t value, base::StringPiece str); 16 | 17 | - GenericEnumTableEntry(const GenericEnumTableEntry&) = delete; 18 | GenericEnumTableEntry& operator=(const GenericEnumTableEntry&) = delete; 19 | 20 | private: 21 | @@ -253,7 +253,6 @@ class EnumTable { 22 | constexpr Entry(E value, base::StringPiece str) 23 | : GenericEnumTableEntry(static_cast(value), str) {} 24 | 25 | - Entry(const Entry&) = delete; 26 | Entry& operator=(const Entry&) = delete; 27 | }; 28 | 29 | @@ -312,15 +311,14 @@ class EnumTable { 30 | if (is_sorted_) { 31 | const std::size_t index = static_cast(value); 32 | if (ANALYZER_ASSUME_TRUE(index < data_.size())) { 33 | - const auto& entry = data_.begin()[index]; 34 | + const auto& entry = data_[index]; 35 | if (ANALYZER_ASSUME_TRUE(entry.has_str())) 36 | return entry.str(); 37 | } 38 | return absl::nullopt; 39 | } 40 | return GenericEnumTableEntry::FindByValue( 41 | - reinterpret_cast(data_.begin()), 42 | - data_.size(), static_cast(value)); 43 | + &data_[0], data_.size(), static_cast(value)); 44 | } 45 | 46 | // This overload of GetString is designed for cases where the argument is a 47 | @@ -348,8 +346,7 @@ class EnumTable { 48 | // enum value directly. 49 | absl::optional GetEnum(base::StringPiece str) const { 50 | auto* entry = GenericEnumTableEntry::FindByString( 51 | - reinterpret_cast(data_.begin()), 52 | - data_.size(), str); 53 | + &data_[0], data_.size(), str); 54 | return entry ? static_cast(entry->value) : absl::optional(); 55 | } 56 | 57 | @@ -364,7 +361,7 @@ class EnumTable { 58 | // Align the data on a cache line boundary. 59 | alignas(64) 60 | #endif 61 | - std::initializer_list data_; 62 | + const std::vector data_; 63 | bool is_sorted_; 64 | 65 | constexpr EnumTable(std::initializer_list data, bool is_sorted) 66 | @@ -376,8 +373,8 @@ class EnumTable { 67 | 68 | for (std::size_t i = 0; i < data.size(); i++) { 69 | for (std::size_t j = i + 1; j < data.size(); j++) { 70 | - const Entry& ei = data.begin()[i]; 71 | - const Entry& ej = data.begin()[j]; 72 | + const Entry& ei = data[i]; 73 | + const Entry& ej = data[j]; 74 | DCHECK(ei.value != ej.value) 75 | << "Found duplicate enum values at indices " << i << " and " << j; 76 | DCHECK(!(ei.has_str() && ej.has_str() && ei.str() == ej.str())) 77 | -------------------------------------------------------------------------------- /dev-util/electron/files/chromium-98-gtk4-build.patch: -------------------------------------------------------------------------------- 1 | --- a/ui/gtk/gsk.sigs 2 | +++ b/ui/gtk/gsk.sigs 3 | @@ -1,16 +1,16 @@ 4 | -GskRenderNodeType gsk_render_node_get_node_type(GskRenderNode* node); 5 | +GskRenderNodeType gsk_render_node_get_node_type(const GskRenderNode* node); 6 | void gsk_render_node_unref(GskRenderNode* node); 7 | -GskRenderNode* gsk_transform_node_get_child(GskRenderNode* node); 8 | -GskRenderNode* gsk_opacity_node_get_child(GskRenderNode* node); 9 | -GskRenderNode* gsk_color_matrix_node_get_child(GskRenderNode* node); 10 | -GskRenderNode* gsk_repeat_node_get_child(GskRenderNode* node); 11 | -GskRenderNode* gsk_clip_node_get_child(GskRenderNode* node); 12 | -GskRenderNode* gsk_rounded_clip_node_get_child(GskRenderNode* node); 13 | -GskRenderNode* gsk_shadow_node_get_child(GskRenderNode* node); 14 | -GskRenderNode* gsk_blur_node_get_child(GskRenderNode* node); 15 | -GskRenderNode* gsk_debug_node_get_child(GskRenderNode* node); 16 | -GskRenderNode* gsk_container_node_get_child(GskRenderNode* node, guint idx); 17 | -GskRenderNode* gsk_gl_shader_node_get_child(GskRenderNode* node, guint idx); 18 | -guint gsk_container_node_get_n_children(GskRenderNode* node); 19 | -guint gsk_gl_shader_node_get_n_children(GskRenderNode* node); 20 | -GdkTexture* gsk_texture_node_get_texture(GskRenderNode* node); 21 | +GskRenderNode* gsk_transform_node_get_child(const GskRenderNode* node); 22 | +GskRenderNode* gsk_opacity_node_get_child(const GskRenderNode* node); 23 | +GskRenderNode* gsk_color_matrix_node_get_child(const GskRenderNode* node); 24 | +GskRenderNode* gsk_repeat_node_get_child(const GskRenderNode* node); 25 | +GskRenderNode* gsk_clip_node_get_child(const GskRenderNode* node); 26 | +GskRenderNode* gsk_rounded_clip_node_get_child(const GskRenderNode* node); 27 | +GskRenderNode* gsk_shadow_node_get_child(const GskRenderNode* node); 28 | +GskRenderNode* gsk_blur_node_get_child(const GskRenderNode* node); 29 | +GskRenderNode* gsk_debug_node_get_child(const GskRenderNode* node); 30 | +GskRenderNode* gsk_container_node_get_child(const GskRenderNode* node, guint idx); 31 | +GskRenderNode* gsk_gl_shader_node_get_child(const GskRenderNode* node, guint idx); 32 | +guint gsk_container_node_get_n_children(const GskRenderNode* node); 33 | +guint gsk_gl_shader_node_get_n_children(const GskRenderNode* node); 34 | +GdkTexture* gsk_texture_node_get_texture(const GskRenderNode* node); 35 | --- a/ui/gtk/gtk_util.cc 36 | +++ b/ui/gtk/gtk_util.cc 37 | @@ -705,7 +705,7 @@ 38 | DCHECK(GtkCheckVersion(4)); 39 | struct { 40 | GskRenderNodeType node_type; 41 | - GskRenderNode* (*get_child)(GskRenderNode*); 42 | + GskRenderNode* (*get_child)(const GskRenderNode*); 43 | } constexpr simple_getters[] = { 44 | {GSK_TRANSFORM_NODE, gsk_transform_node_get_child}, 45 | {GSK_OPACITY_NODE, gsk_opacity_node_get_child}, 46 | @@ -719,8 +719,8 @@ 47 | }; 48 | struct { 49 | GskRenderNodeType node_type; 50 | - guint (*get_n_children)(GskRenderNode*); 51 | - GskRenderNode* (*get_child)(GskRenderNode*, guint); 52 | + guint (*get_n_children)(const GskRenderNode*); 53 | + GskRenderNode* (*get_child)(const GskRenderNode*, guint); 54 | } constexpr container_getters[] = { 55 | {GSK_CONTAINER_NODE, gsk_container_node_get_n_children, 56 | gsk_container_node_get_child}, 57 | -------------------------------------------------------------------------------- /dev-util/electron/files/chromium-cross-compile.patch: -------------------------------------------------------------------------------- 1 | --- a/build/toolchain/linux/unbundle/BUILD.gn 2 | +++ b/build/toolchain/linux/unbundle/BUILD.gn 3 | @@ -35,7 +35,7 @@ gcc_toolchain("host") { 4 | extra_ldflags = getenv("BUILD_LDFLAGS") 5 | 6 | toolchain_args = { 7 | - current_cpu = current_cpu 8 | - current_os = current_os 9 | + current_cpu = host_cpu 10 | + current_os = host_os 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /dev-util/electron/files/chromium-shim_headers.patch: -------------------------------------------------------------------------------- 1 | From e273172bbafedca36984fc40f4aa6c44b79ac2ef Mon Sep 17 00:00:00 2001 2 | From: Stephan Hartmann 3 | Date: Fri, 25 Dec 2020 09:10:32 +0000 4 | Subject: [PATCH] shim_headers: fix outputs generation 5 | 6 | --- 7 | build/shim_headers.gni | 11 +++++++---- 8 | 1 file changed, 7 insertions(+), 4 deletions(-) 9 | 10 | diff --git a/build/shim_headers.gni b/build/shim_headers.gni 11 | index 0900cba..5138647 100644 12 | --- a/build/shim_headers.gni 13 | +++ b/build/shim_headers.gni 14 | @@ -6,6 +6,8 @@ template("shim_headers") { 15 | action_name = "gen_${target_name}" 16 | config_name = "${target_name}_config" 17 | shim_headers_path = "${root_gen_dir}/shim_headers/${target_name}" 18 | + shim_root_path = rebase_path(invoker.root_path) 19 | + shim_rel_path = rebase_path("${shim_root_path}", rebase_path("//")) 20 | 21 | config(config_name) { 22 | include_dirs = [ shim_headers_path ] 23 | @@ -16,7 +18,7 @@ template("shim_headers") { 24 | args = [ 25 | "--generate", 26 | "--headers-root", 27 | - rebase_path(invoker.root_path), 28 | + "${shim_root_path}", 29 | "--output-directory", 30 | rebase_path(shim_headers_path), 31 | ] 32 | @@ -27,9 +29,10 @@ template("shim_headers") { 33 | ] 34 | } 35 | args += invoker.headers 36 | - 37 | - outputs = process_file_template(invoker.headers, 38 | - "${shim_headers_path}/{{source_file_part}}") 39 | + outputs = [] 40 | + foreach(shim_header, invoker.headers) { 41 | + outputs += [ "${shim_headers_path}/${shim_rel_path}/" + shim_header ] 42 | + } 43 | } 44 | 45 | group(target_name) { 46 | -- 47 | 2.26.2 48 | 49 | -------------------------------------------------------------------------------- /dev-util/electron/files/chromium-use-oauth2-client-switches-as-default.patch: -------------------------------------------------------------------------------- 1 | diff -upr chromium-89.0.4389.58.orig/google_apis/google_api_keys.cc chromium-89.0.4389.58/google_apis/google_api_keys.cc 2 | --- chromium-89.0.4389.58.orig/google_apis/google_api_keys.cc 2021-02-24 22:37:18.494007649 +0000 3 | +++ chromium-89.0.4389.58/google_apis/google_api_keys.cc 2021-02-24 22:35:00.865777600 +0000 4 | @@ -154,11 +154,11 @@ class APIKeyCache { 5 | 6 | std::string default_client_id = CalculateKeyValue( 7 | GOOGLE_DEFAULT_CLIENT_ID, 8 | - STRINGIZE_NO_EXPANSION(GOOGLE_DEFAULT_CLIENT_ID), nullptr, 9 | + STRINGIZE_NO_EXPANSION(GOOGLE_DEFAULT_CLIENT_ID), ::switches::kOAuth2ClientID, 10 | std::string(), environment.get(), command_line, gaia_config); 11 | std::string default_client_secret = CalculateKeyValue( 12 | GOOGLE_DEFAULT_CLIENT_SECRET, 13 | - STRINGIZE_NO_EXPANSION(GOOGLE_DEFAULT_CLIENT_SECRET), nullptr, 14 | + STRINGIZE_NO_EXPANSION(GOOGLE_DEFAULT_CLIENT_SECRET), ::switches::kOAuth2ClientSecret, 15 | std::string(), environment.get(), command_line, gaia_config); 16 | 17 | // We currently only allow overriding the baked-in values for the 18 | -------------------------------------------------------------------------------- /dev-util/electron/files/electron-carve-out-binary-patches.patch: -------------------------------------------------------------------------------- 1 | From c75986219ad8a08db470236443efa7f4f9284817 Mon Sep 17 00:00:00 2001 2 | From: Elvis Pranskevichus 3 | Date: Fri, 19 Aug 2022 16:02:23 -0700 4 | Subject: [PATCH] Carve out binary patches 5 | 6 | --- 7 | ...eserve_proper_method_names_as-is_in_error_stack.patch | 9 --------- 8 | 1 file changed, 9 deletions(-) 9 | 10 | diff --git a/patches/node/fix_preserve_proper_method_names_as-is_in_error_stack.patch b/patches/node/fix_preserve_proper_method_names_as-is_in_error_stack.patch 11 | index e14acc34fa..ba13af68cd 100644 12 | --- a/patches/node/fix_preserve_proper_method_names_as-is_in_error_stack.patch 13 | +++ b/patches/node/fix_preserve_proper_method_names_as-is_in_error_stack.patch 14 | @@ -71,15 +71,6 @@ index 2ef95b535dafe7b0a918b8d6a844e4c4a617818d..dc5e6e7d28cef3a23ca7ba2cfb1435ca 15 | at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:*:*) 16 | at node:internal/main/run_main_module:*:* { 17 | generatedMessage: true, 18 | -diff --git a/test/message/error_with_nul.out b/test/message/error_with_nul.out 19 | -index 7fbb33f08e8dc342b9efc899e66f5e3350e9489b..a359999420fa76bd09b401a732acb7dcdfaa2198 100644 20 | -GIT binary patch 21 | -delta 13 22 | -VcmdnUvXEuMi;3^+Czmts0st)*2A2Q; 23 | - 24 | -delta 31 25 | -ncmZ3;vXN!N3wHmctkmQZy@@aCIo(S0l1no4^YkXCGwuQa$o~w9 26 | - 27 | diff --git a/test/message/events_unhandled_error_common_trace.out b/test/message/events_unhandled_error_common_trace.out 28 | index 19e89869ba74fae3f447e299904939da5a683280..2bdbe3df1b4c7e13ba33f099ae89f88365e6b690 100644 29 | --- a/test/message/events_unhandled_error_common_trace.out 30 | -- 31 | 2.35.1 32 | 33 | -------------------------------------------------------------------------------- /dev-util/electron/files/electron-enable-qt-support-r1.patch: -------------------------------------------------------------------------------- 1 | From 1876cfa318d1548635e7cc79f02d7820edc27c98 Mon Sep 17 00:00:00 2001 2 | From: Elvis Pranskevichus 3 | Date: Wed, 29 May 2024 16:17:57 -0700 4 | Subject: [PATCH] Enable QT support 5 | 6 | --- 7 | build/args/all.gn | 3 --- 8 | 1 file changed, 3 deletions(-) 9 | 10 | diff --git a/build/args/all.gn b/build/args/all.gn 11 | index 56589e30b2..58a2f720cf 100644 12 | --- a/build/args/all.gn 13 | +++ b/build/args/all.gn 14 | @@ -47,9 +47,6 @@ enable_cet_shadow_stack = false 15 | # Ref: https://source.chromium.org/chromium/chromium/src/+/45fba672185aae233e75d6ddc81ea1e0b30db050:v8/BUILD.gn;l=281 16 | is_cfi = false 17 | 18 | -# TODO: fix this once sysroots have been updated. 19 | -use_qt = false 20 | - 21 | # https://chromium-review.googlesource.com/c/chromium/src/+/4365718 22 | # TODO(codebytere): fix perfetto incompatibility with Node.js. 23 | use_perfetto_client_library = false 24 | -- 25 | 2.44.1 26 | 27 | -------------------------------------------------------------------------------- /dev-util/electron/files/electron-enable-qt-support.patch: -------------------------------------------------------------------------------- 1 | From 35935213a5a272b8f1c7b528addd715e1ab150f9 Mon Sep 17 00:00:00 2001 2 | From: Elvis Pranskevichus 3 | Date: Tue, 16 May 2023 13:15:33 -0700 4 | Subject: [PATCH] Enable QT support 5 | 6 | --- 7 | build/args/all.gn | 3 --- 8 | 1 file changed, 3 deletions(-) 9 | 10 | diff --git a/build/args/all.gn b/build/args/all.gn 11 | index 9bfb8e3c23..014168a3bd 100644 12 | --- a/build/args/all.gn 13 | +++ b/build/args/all.gn 14 | @@ -46,7 +46,4 @@ enable_cet_shadow_stack = false 15 | # Ref: https://source.chromium.org/chromium/chromium/src/+/45fba672185aae233e75d6ddc81ea1e0b30db050:v8/BUILD.gn;l=281 16 | is_cfi = false 17 | 18 | -# TODO: fix this once sysroots have been updated. 19 | -use_qt = false 20 | - 21 | v8_builtins_profiling_log_file = "" 22 | -- 23 | 2.39.3 24 | 25 | -------------------------------------------------------------------------------- /dev-util/electron/files/electron-fix-node-openssl3-build.patch: -------------------------------------------------------------------------------- 1 | From 9880bb8eea7d7ddc867ba1410dd5b5e85fe210be Mon Sep 17 00:00:00 2001 2 | From: Elvis Pranskevichus 3 | Date: Wed, 26 Apr 2023 12:10:43 -0700 4 | Subject: [PATCH] build: Enable legacy OpenSSL provider 5 | 6 | --- 7 | build/npm-run.py | 4 +++- 8 | 1 file changed, 3 insertions(+), 1 deletion(-) 9 | 10 | diff --git a/build/npm-run.py b/build/npm-run.py 11 | index 49a6abac65..cd9c810734 100644 12 | --- a/build/npm-run.py 13 | +++ b/build/npm-run.py 14 | @@ -12,8 +12,10 @@ args = [cmd, "run", 15 | "--prefix", 16 | SOURCE_ROOT 17 | ] + sys.argv[1:] 18 | +env = os.environ.copy() 19 | +env["NODE_OPTIONS"] = "--openssl-legacy-provider" 20 | try: 21 | - subprocess.check_output(args, stderr=subprocess.STDOUT) 22 | + subprocess.check_output(args, stderr=subprocess.STDOUT, env=env) 23 | except subprocess.CalledProcessError as e: 24 | error_msg = "NPM script '{}' failed with code '{}':\n".format(sys.argv[2], e.returncode) 25 | print(error_msg + e.output.decode('utf8')) 26 | -- 27 | 2.39.2 28 | 29 | -------------------------------------------------------------------------------- /dev-util/electron/files/electron-gcc-fixes.patch: -------------------------------------------------------------------------------- 1 | From 78ada45c2a8d3836c293b0cc7f217e8730e195d3 Mon Sep 17 00:00:00 2001 2 | From: Elvis Pranskevichus 3 | Date: Fri, 16 Jun 2023 22:20:04 -0700 4 | Subject: [PATCH] Fix compilation under GCC 5 | 6 | --- 7 | ...latform_pageallocator_for_usage_outside_of_the_gin.patch | 6 +++--- 8 | ...aming-protocol_registry_to_multibuffer_data_source.patch | 4 ++-- 9 | shell/browser/javascript_environment.cc | 2 +- 10 | shell/browser/serial/electron_serial_delegate.h | 4 ++-- 11 | 4 files changed, 8 insertions(+), 8 deletions(-) 12 | 13 | diff --git a/patches/chromium/export_gin_v8platform_pageallocator_for_usage_outside_of_the_gin.patch b/patches/chromium/export_gin_v8platform_pageallocator_for_usage_outside_of_the_gin.patch 14 | index e04b0ddecc..72ee3d102d 100644 15 | --- a/patches/chromium/export_gin_v8platform_pageallocator_for_usage_outside_of_the_gin.patch 16 | +++ b/patches/chromium/export_gin_v8platform_pageallocator_for_usage_outside_of_the_gin.patch 17 | @@ -16,7 +16,7 @@ index 334e702cae9ea874cc9f08f47b88af7fa60dd13b..87076ea0f7a16f1db57e574d7e4d51b1 18 | // enabling Arm's Branch Target Instructions for executable pages. This is 19 | // verified in the tests for gin::PageAllocator. 20 | PageAllocator* GetPageAllocator() override; 21 | -+ static PageAllocator* PageAllocator(); 22 | ++ static PageAllocator* GetGinPageAllocator(); 23 | void OnCriticalMemoryPressure() override; 24 | v8::ZoneBackingAllocator* GetZoneBackingAllocator() override; 25 | #endif 26 | @@ -27,8 +27,8 @@ index 0e03069bfd06a418caef6e26d074b3fbe5aed4e7..46264c21239b5ed10e10bb23ec081713 27 | @@ -367,6 +367,10 @@ PageAllocator* V8Platform::GetPageAllocator() { 28 | return g_page_allocator.Pointer(); 29 | } 30 | - 31 | -+PageAllocator* V8Platform::PageAllocator() { 32 | + 33 | ++PageAllocator* V8Platform::GetGinPageAllocator() { 34 | + return g_page_allocator.Pointer(); 35 | +} 36 | + 37 | diff --git a/patches/chromium/feat_add_streaming-protocol_registry_to_multibuffer_data_source.patch b/patches/chromium/feat_add_streaming-protocol_registry_to_multibuffer_data_source.patch 38 | index 96441eaf1d..33d9b59c88 100644 39 | --- a/patches/chromium/feat_add_streaming-protocol_registry_to_multibuffer_data_source.patch 40 | +++ b/patches/chromium/feat_add_streaming-protocol_registry_to_multibuffer_data_source.patch 41 | @@ -32,10 +32,10 @@ index 35e37b00ca87f1975c11ab98858b7849487304e5..82248fc99bbd0484f15de6ed7a7451cd 42 | constexpr base::TimeDelta kSeekDelay = base::Milliseconds(20); 43 | 44 | +std::vector* GetStreamingSchemes() { 45 | -+ static base::NoDestructor> streaming_schemes({ 46 | ++ static base::NoDestructor> streaming_schemes(std::initializer_list({ 47 | + url::kHttpsScheme, 48 | + url::kHttpScheme 49 | -+ }); 50 | ++ })); 51 | + return streaming_schemes.get(); 52 | +} 53 | + 54 | diff --git a/shell/browser/javascript_environment.cc b/shell/browser/javascript_environment.cc 55 | index c1fab43482..5c4e8304a2 100644 56 | --- a/shell/browser/javascript_environment.cc 57 | +++ b/shell/browser/javascript_environment.cc 58 | @@ -264,7 +264,7 @@ v8::Isolate* JavascriptEnvironment::Initialize(uv_loop_t* event_loop) { 59 | node::tracing::TraceEventHelper::SetAgent(tracing_agent); 60 | platform_ = node::CreatePlatform( 61 | base::RecommendedMaxNumberOfThreadsInThreadGroup(3, 8, 0.1, 0), 62 | - tracing_controller, gin::V8Platform::PageAllocator()); 63 | + tracing_controller, gin::V8Platform::GetGinPageAllocator()); 64 | 65 | v8::V8::InitializePlatform(platform_); 66 | gin::IsolateHolder::Initialize(gin::IsolateHolder::kNonStrictMode, 67 | diff --git a/shell/browser/serial/electron_serial_delegate.h b/shell/browser/serial/electron_serial_delegate.h 68 | index 9ddbaa3aec..20d7c462c4 100644 69 | --- a/shell/browser/serial/electron_serial_delegate.h 70 | +++ b/shell/browser/serial/electron_serial_delegate.h 71 | @@ -45,9 +45,9 @@ class ElectronSerialDelegate : public content::SerialDelegate, 72 | device::mojom::SerialPortManager* GetPortManager( 73 | content::RenderFrameHost* frame) override; 74 | void AddObserver(content::RenderFrameHost* frame, 75 | - Observer* observer) override; 76 | + content::SerialDelegate::Observer* observer) override; 77 | void RemoveObserver(content::RenderFrameHost* frame, 78 | - Observer* observer) override; 79 | + content::SerialDelegate::Observer* observer) override; 80 | 81 | void DeleteControllerForFrame(content::RenderFrameHost* render_frame_host); 82 | 83 | -- 84 | 2.39.3 85 | 86 | -------------------------------------------------------------------------------- /dev-util/electron/files/electron-gn-config.patch: -------------------------------------------------------------------------------- 1 | From 9fbbf6d7e8884ec83611b1dd44d81b6885fcc17b Mon Sep 17 00:00:00 2001 2 | From: Elvis Pranskevichus 3 | Date: Sun, 6 Jun 2021 21:39:23 -0700 4 | Subject: [PATCH] Build fixes 5 | 6 | --- 7 | build/args/release.gn | 8 -------- 8 | build/npm.gni | 1 - 9 | 2 files changed, 9 deletions(-) 10 | 11 | diff --git a/build/args/release.gn b/build/args/release.gn 12 | index e5017f6e16..59207b3890 100644 13 | --- a/build/args/release.gn 14 | +++ b/build/args/release.gn 15 | @@ -1,6 +1,4 @@ 16 | import("all.gn") 17 | -is_component_build = false 18 | -is_official_build = true 19 | 20 | # This may be guarded behind is_chrome_branded alongside 21 | # proprietary_codecs https://webrtc-review.googlesource.com/c/src/+/36321, 22 | @@ -8,9 +6,3 @@ is_official_build = true 23 | # The initialization of the decoder depends on whether ffmpeg has 24 | # been built with H.264 support. 25 | rtc_use_h264 = proprietary_codecs 26 | - 27 | -# By default, Electron builds ffmpeg with proprietary codecs enabled. In order 28 | -# to facilitate users who don't want to ship proprietary codecs in ffmpeg, or 29 | -# who have an LGPL requirement to ship ffmpeg as a dynamically linked library, 30 | -# we build ffmpeg as a shared library. 31 | -is_component_ffmpeg = true 32 | diff --git a/build/npm.gni b/build/npm.gni 33 | index 1d1c944256..64a360952f 100644 34 | --- a/build/npm.gni 35 | +++ b/build/npm.gni 36 | @@ -33,7 +33,6 @@ template("npm_action") { 37 | if (!defined(deps)) { 38 | deps = [] 39 | } 40 | - deps += [ ":npm_pre_flight_" + target_name ] 41 | 42 | script = "//electron/build/npm-run.py" 43 | args = [ 44 | -- 45 | 2.31.1 46 | 47 | -------------------------------------------------------------------------------- /dev-util/electron/files/electron-launcher.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | set -euo pipefail 4 | 5 | for f in /etc/electron/*; do 6 | [[ -f ${f} ]] && source "${f}" 7 | done 8 | 9 | for f in ${XDG_CONFIG_HOME:-$HOME/.config/electron}*; do 10 | [[ -f ${f} ]] && source "${f}" 11 | done 12 | 13 | # Let the wrapped binary know that it has been run through the wrapper 14 | export CHROME_WRAPPER=$(readlink -f "$0") 15 | 16 | PROGDIR=${CHROME_WRAPPER%/*} 17 | 18 | case ":$PATH:" in 19 | *:$PROGDIR:*) 20 | # $PATH already contains $PROGDIR 21 | ;; 22 | *) 23 | # Append $PROGDIR to $PATH 24 | export PATH="$PATH:$PROGDIR" 25 | ;; 26 | esac 27 | 28 | exec "@INSTALL_PATH@/electron" "${flags[@]}" "$@" 29 | 30 | # Select session type and platform 31 | if @@OZONE_AUTO_SESSION@@; then 32 | platform= 33 | if [[ ${XDG_SESSION_TYPE} == x11 ]]; then 34 | platform=x11 35 | elif [[ ${XDG_SESSION_TYPE} == wayland ]]; then 36 | platform=wayland 37 | else 38 | if [[ -n ${WAYLAND_DISPLAY} ]]; then 39 | platform=wayland 40 | else 41 | platform=x11 42 | fi 43 | fi 44 | if ${DISABLE_OZONE_PLATFORM:-false}; then 45 | platform=x11 46 | fi 47 | ELECTRON_FLAGS="--ozone-platform=${platform} ${ELECTRON_FLAGS}" 48 | fi 49 | 50 | exec -a "@INSTALL_PATH@/electron" ${ELECTRON_FLAGS} "$@" 51 | -------------------------------------------------------------------------------- /dev-util/electron/files/electron-node-config-r1.patch: -------------------------------------------------------------------------------- 1 | From 58dcabbfccee1ffcd24af58c17ff71d67bba0bd9 Mon Sep 17 00:00:00 2001 2 | From: Elvis Pranskevichus 3 | Date: Wed, 29 May 2024 12:42:36 -0700 4 | Subject: [PATCH] Node config 5 | 6 | --- 7 | script/generate-config-gypi.py | 12 ++++-------- 8 | 1 file changed, 4 insertions(+), 8 deletions(-) 9 | 10 | diff --git a/script/generate-config-gypi.py b/script/generate-config-gypi.py 11 | index e55e2474db..a038a018aa 100755 12 | --- a/script/generate-config-gypi.py 13 | +++ b/script/generate-config-gypi.py 14 | @@ -8,7 +8,7 @@ import subprocess 15 | import sys 16 | 17 | ELECTRON_DIR = os.path.abspath(os.path.join(__file__, '..', '..')) 18 | -NODE_DIR = os.path.join(ELECTRON_DIR, '..', 'third_party', 'electron_node') 19 | +NODE_DIR = os.path.abspath(os.path.join(ELECTRON_DIR, '..', 'third_party', 'electron_node')) 20 | 21 | def run_node_configure(target_cpu): 22 | configure = os.path.join(NODE_DIR, 'configure.py') 23 | @@ -17,9 +17,9 @@ def run_node_configure(target_cpu): 24 | # common.gypi rules 25 | args += ['--experimental-enable-pointer-compression'] 26 | 27 | - # Work around "No acceptable ASM compiler found" error on some System, 28 | - # it breaks nothing since Electron does not use OpenSSL. 29 | - args += ['--openssl-no-asm'] 30 | + args += [ 31 | + %NODE_CONFIG_ARGS% 32 | + ] 33 | 34 | # Enable whole-program optimization for electron native modules. 35 | if sys.platform == "win32": 36 | @@ -50,10 +50,6 @@ def main(target_file, target_cpu): 37 | config = read_node_config_gypi() 38 | args = read_electron_args() 39 | 40 | - # Remove the generated config.gypi to make the parallel/test-process-config 41 | - # test pass. 42 | - os.remove(os.path.join(NODE_DIR, 'config.gypi')) 43 | - 44 | v = config['variables'] 45 | # Electron specific variables: 46 | v['built_with_electron'] = 1 47 | -- 48 | 2.44.1 49 | 50 | -------------------------------------------------------------------------------- /dev-util/electron/files/electron-node-config.patch: -------------------------------------------------------------------------------- 1 | From 845775cf02ac380329e0ce7dd63e2f4e9254fe07 Mon Sep 17 00:00:00 2001 2 | From: Elvis Pranskevichus 3 | Date: Tue, 4 Jan 2022 11:19:58 -0800 4 | Subject: [PATCH] Node config 5 | 6 | --- 7 | script/generate-config-gypi.py | 14 ++++++++++---- 8 | 1 file changed, 10 insertions(+), 4 deletions(-) 9 | 10 | diff --git a/script/generate-config-gypi.py b/script/generate-config-gypi.py 11 | index c4e3d98159..ea4b8ea72b 100755 12 | --- a/script/generate-config-gypi.py 13 | +++ b/script/generate-config-gypi.py 14 | @@ -21,6 +21,16 @@ def run_node_configure(target_cpu): 15 | # machines, it breaks nothing since Electron does not use OpenSSL. 16 | if sys.platform == 'win32': 17 | args += ['--openssl-no-asm'] 18 | + args.extend([ 19 | + '--shared-openssl', 20 | + '--shared-http-parser', 21 | + '--shared-zlib', 22 | + '--shared-nghttp2', 23 | + '--shared-cares', 24 | + '--without-npm', 25 | + '--with-intl=system-icu', 26 | + '--without-dtrace', 27 | + ]) 28 | subprocess.check_call([sys.executable, configure] + args) 29 | 30 | def read_node_config_gypi(): 31 | @@ -47,10 +57,6 @@ def main(target_file, target_cpu): 32 | config = read_node_config_gypi() 33 | args = read_electron_args() 34 | 35 | - # Remove the generated config.gypi to make the parallel/test-process-config 36 | - # test pass. 37 | - os.remove(os.path.join(NODE_DIR, 'config.gypi')) 38 | - 39 | v = config['variables'] 40 | # Electron specific variables: 41 | v['built_with_electron'] = 1 42 | -- 43 | 2.34.1 44 | 45 | -------------------------------------------------------------------------------- /dev-util/electron/files/electron-node-unbundle-deps.patch: -------------------------------------------------------------------------------- 1 | From 27624fe900baab4a184457c0cdec4da4d19a328a Mon Sep 17 00:00:00 2001 2 | From: Elvis Pranskevichus 3 | Date: Wed, 13 Apr 2022 21:28:59 -0700 4 | Subject: [PATCH] node: unbundle deps 5 | 6 | --- 7 | patches/node/build_add_gn_build_files.patch | 29 ++++++++++++++++++--- 8 | 1 file changed, 26 insertions(+), 3 deletions(-) 9 | 10 | diff --git a/patches/node/build_add_gn_build_files.patch b/patches/node/build_add_gn_build_files.patch 11 | index 27e8c3e5a0..ef42f7cffb 100644 12 | --- a/patches/node/build_add_gn_build_files.patch 13 | +++ b/patches/node/build_add_gn_build_files.patch 14 | @@ -10,7 +10,7 @@ new file mode 100644 15 | index 0000000000000000000000000000000000000000..bd5788caa61305fd9af8f9d7f8f1937a224fda83 16 | --- /dev/null 17 | +++ b/BUILD.gn 18 | -@@ -0,0 +1,394 @@ 19 | +@@ -0,0 +1,417 @@ 20 | +import("//electron/build/asar.gni") 21 | +import("//v8/gni/v8.gni") 22 | + 23 | @@ -55,6 +55,18 @@ index 0000000000000000000000000000000000000000..bd5788caa61305fd9af8f9d7f8f1937a 24 | + node_module_version = "" 25 | +} 26 | + 27 | ++if (is_linux) { 28 | ++ import("//build/config/linux/pkg_config.gni") 29 | ++ 30 | ++ pkg_config("cares") { 31 | ++ packages = [ "libcares" ] 32 | ++ } 33 | ++ 34 | ++ pkg_config("nghttp2") { 35 | ++ packages = [ "libnghttp2" ] 36 | ++ } 37 | ++} 38 | ++ 39 | +assert(!node_use_dtrace, "node_use_dtrace not supported in GN") 40 | +assert(!node_use_etw, "node_use_etw not supported in GN") 41 | + 42 | @@ -195,11 +207,9 @@ index 0000000000000000000000000000000000000000..bd5788caa61305fd9af8f9d7f8f1937a 43 | +component("node_lib") { 44 | + deps = [ 45 | + ":node_js2c", 46 | -+ "deps/cares", 47 | + "deps/histogram", 48 | + "deps/googletest:gtest", 49 | + "deps/llhttp", 50 | -+ "deps/nghttp2", 51 | + "deps/uvwasi", 52 | + "//third_party/zlib", 53 | + "//third_party/brotli:dec", 54 | @@ -215,6 +225,19 @@ index 0000000000000000000000000000000000000000..bd5788caa61305fd9af8f9d7f8f1937a 55 | + public_configs = [ ":node_lib_config" ] 56 | + include_dirs = [ "src" ] 57 | + libs = [] 58 | ++ if (is_linux) { 59 | ++ configs += [ 60 | ++ ":cares", 61 | ++ ":nghttp2", 62 | ++ ] 63 | ++ libs += [ "http_parser" ] 64 | ++ } else { 65 | ++ deps += [ 66 | ++ "deps/cares", 67 | ++ "deps/http_parser", 68 | ++ "deps/nghttp2", 69 | ++ ] 70 | ++ } 71 | + frameworks = [] 72 | + cflags_cc = [ 73 | + "-Wno-deprecated-declarations", 74 | -- 75 | 2.35.1 76 | 77 | -------------------------------------------------------------------------------- /dev-util/electron/files/electron-patch-fixup-r1.patch: -------------------------------------------------------------------------------- 1 | From 70008bd964c337059d75bebe8bee2c3cc3a1a60d Mon Sep 17 00:00:00 2001 2 | From: Elvis Pranskevichus 3 | Date: Tue, 16 May 2023 12:06:00 -0700 4 | Subject: [PATCH] Patch fixup 5 | 6 | --- 7 | patches/chromium/.patches | 2 + 8 | .../chromium/cherry-pick-02ef9983710d.patch | 121 ++++++++++++++++++ 9 | .../chromium/cherry-pick-ffe482466bb9.patch | 78 +++++++++++ 10 | 3 files changed, 201 insertions(+) 11 | create mode 100644 patches/chromium/cherry-pick-02ef9983710d.patch 12 | create mode 100644 patches/chromium/cherry-pick-ffe482466bb9.patch 13 | 14 | diff --git a/patches/chromium/.patches b/patches/chromium/.patches 15 | index b00df9d4d0..83ca958971 100644 16 | --- a/patches/chromium/.patches 17 | +++ b/patches/chromium/.patches 18 | @@ -136,6 +136,7 @@ cherry-pick-aeec1ba5893d.patch 19 | cherry-pick-0407102d19b9.patch 20 | fix_crash_in_annotationagentimpl.patch 21 | cherry-pick-bfd926be8178.patch 22 | +cherry-pick-02ef9983710d.patch 23 | cherry-pick-9aa4c45f21b1.patch 24 | m108-lts_do_not_register_browser_watcher_activity_report_with.patch 25 | prevent_potential_integer_overflow_in_persistentmemoryallocator_1_2.patch 26 | @@ -155,5 +156,6 @@ merge_m112_check_spdyproxyclientsocket_is_alive_after_write.patch 27 | check_callback_availability_in.patch 28 | cherry-pick-63686953dc22.patch 29 | cherry-pick-f098ff0d1230.patch 30 | +cherry-pick-ffe482466bb9.patch 31 | cherry-pick-f58218891f8c.patch 32 | wayland_ensure_dnd_buffer_size_is_a_multiple_of_scale.patch 33 | diff --git a/patches/chromium/cherry-pick-02ef9983710d.patch b/patches/chromium/cherry-pick-02ef9983710d.patch 34 | new file mode 100644 35 | index 0000000000..7097732f02 36 | --- /dev/null 37 | +++ b/patches/chromium/cherry-pick-02ef9983710d.patch 38 | @@ -0,0 +1,121 @@ 39 | +From 02ef9983710df374107967ba0685e190d53f990c Mon Sep 17 00:00:00 2001 40 | +From: Harald Alvestrand 41 | +Date: Wed, 18 Jan 2023 08:03:04 +0000 42 | +Subject: [PATCH] [Merge M108] Delete PeerConnectionHandler in PeerConnection 43 | + finalizer 44 | + 45 | +Also guard against removal of PC during PeerConnectionHandler 46 | +call that may cause garbage collection. 47 | + 48 | +(cherry picked from commit 5066dd66309d884762e5fb9be04b59582893d09a) 49 | + 50 | +Bug: chromium:1405256 51 | +Change-Id: I9adf7b219e2026e07ccc0868c1a85f3b35cd9d26 52 | +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4154578 53 | +Commit-Queue: Harald Alvestrand 54 | +Reviewed-by: Guido Urdaneta 55 | +Commit-Queue: Guido Urdaneta 56 | +Cr-Original-Commit-Position: refs/heads/main@{#1091801} 57 | +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4176412 58 | +Auto-Submit: Harald Alvestrand 59 | +Cr-Commit-Position: refs/branch-heads/5359@{#1347} 60 | +Cr-Branched-From: 27d3765d341b09369006d030f83f582a29eb57ae-refs/heads/main@{#1058933} 61 | +--- 62 | + .../peerconnection/rtc_peer_connection.cc | 5 +++-- 63 | + .../rtc_peer_connection_handler.cc | 19 ++++++++++++++----- 64 | + 2 files changed, 17 insertions(+), 7 deletions(-) 65 | + 66 | +diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_peer_connection.cc b/third_party/blink/renderer/modules/peerconnection/rtc_peer_connection.cc 67 | +index b7f66c8b22ab9..e951bf3faa35a 100644 68 | +--- a/third_party/blink/renderer/modules/peerconnection/rtc_peer_connection.cc 69 | ++++ b/third_party/blink/renderer/modules/peerconnection/rtc_peer_connection.cc 70 | +@@ -643,10 +643,11 @@ RTCPeerConnection::~RTCPeerConnection() { 71 | + } 72 | + 73 | + void RTCPeerConnection::Dispose() { 74 | +- // Promptly clears the handler's pointer to |this| 75 | ++ // Promptly clears the handler 76 | + // so that content/ doesn't access it in a lazy sweeping phase. 77 | ++ // Other references to the handler use a weak pointer, preventing access. 78 | + if (peer_handler_) { 79 | +- peer_handler_->CloseAndUnregister(); 80 | ++ peer_handler_.reset(); 81 | + } 82 | + } 83 | + 84 | +diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_peer_connection_handler.cc b/third_party/blink/renderer/modules/peerconnection/rtc_peer_connection_handler.cc 85 | +index 58168b98601c5..9f52fca8f3035 100644 86 | +--- a/third_party/blink/renderer/modules/peerconnection/rtc_peer_connection_handler.cc 87 | ++++ b/third_party/blink/renderer/modules/peerconnection/rtc_peer_connection_handler.cc 88 | +@@ -713,6 +713,8 @@ class RTCPeerConnectionHandler::WebRtcSetDescriptionObserverImpl 89 | + if (handler_) { 90 | + handler_->OnModifySctpTransport(std::move(states.sctp_transport_state)); 91 | + } 92 | ++ // Since OnSessionDescriptionsUpdated can fire events, it may cause 93 | ++ // garbage collection. Ensure that handler_ is still valid. 94 | + if (handler_) { 95 | + handler_->OnModifyTransceivers( 96 | + states.signaling_state, std::move(states.transceiver_states), 97 | +@@ -1066,6 +1068,8 @@ bool RTCPeerConnectionHandler::Initialize( 98 | + CHECK(!initialize_called_); 99 | + initialize_called_ = true; 100 | + 101 | ++ // Prevent garbage collection of client_ during processing. 102 | ++ auto* client_on_stack = client_; 103 | + peer_connection_tracker_ = PeerConnectionTracker::From(*frame); 104 | + 105 | + configuration_ = server_configuration; 106 | +@@ -1104,8 +1108,8 @@ bool RTCPeerConnectionHandler::Initialize( 107 | + peer_connection_tracker_->RegisterPeerConnection(this, configuration_, 108 | + frame_); 109 | + } 110 | +- 111 | +- return true; 112 | ++ // Gratuitous usage of client_on_stack to prevent compiler errors. 113 | ++ return !!client_on_stack; 114 | + } 115 | + 116 | + bool RTCPeerConnectionHandler::InitializeForTest( 117 | +@@ -2066,9 +2070,11 @@ void RTCPeerConnectionHandler::OnSessionDescriptionsUpdated( 118 | + pending_remote_description, 119 | + std::unique_ptr 120 | + current_remote_description) { 121 | ++ // Prevent garbage collection of client_ during processing. 122 | ++ auto* client_on_stack = client_; 123 | + if (!client_ || is_closed_) 124 | + return; 125 | +- client_->DidChangeSessionDescriptions( 126 | ++ client_on_stack->DidChangeSessionDescriptions( 127 | + pending_local_description 128 | + ? CreateWebKitSessionDescription(pending_local_description.get()) 129 | + : nullptr, 130 | +@@ -2294,8 +2300,12 @@ void RTCPeerConnectionHandler::OnIceCandidate(const String& sdp, 131 | + int sdp_mline_index, 132 | + int component, 133 | + int address_family) { 134 | ++ // In order to ensure that the RTCPeerConnection is not garbage collected 135 | ++ // from under the function, we keep a pointer to it on the stack. 136 | ++ auto* client_on_stack = client_; 137 | + DCHECK(task_runner_->RunsTasksInCurrentSequence()); 138 | + TRACE_EVENT0("webrtc", "RTCPeerConnectionHandler::OnIceCandidateImpl"); 139 | ++ // This line can cause garbage collection. 140 | + auto* platform_candidate = MakeGarbageCollected( 141 | + sdp, sdp_mid, sdp_mline_index); 142 | + if (peer_connection_tracker_) { 143 | +@@ -2315,7 +2325,7 @@ void RTCPeerConnectionHandler::OnIceCandidate(const String& sdp, 144 | + } 145 | + } 146 | + if (!is_closed_) 147 | +- client_->DidGenerateICECandidate(platform_candidate); 148 | ++ client_on_stack->DidGenerateICECandidate(platform_candidate); 149 | + } 150 | + 151 | + void RTCPeerConnectionHandler::OnIceCandidateError( 152 | +@@ -2327,7 +2337,6 @@ void RTCPeerConnectionHandler::OnIceCandidateError( 153 | + const String& error_text) { 154 | + DCHECK(task_runner_->RunsTasksInCurrentSequence()); 155 | + TRACE_EVENT0("webrtc", "RTCPeerConnectionHandler::OnIceCandidateError"); 156 | +- 157 | + if (peer_connection_tracker_) { 158 | + peer_connection_tracker_->TrackIceCandidateError( 159 | + this, address, port, host_candidate, url, error_code, error_text); 160 | diff --git a/patches/chromium/cherry-pick-ffe482466bb9.patch b/patches/chromium/cherry-pick-ffe482466bb9.patch 161 | new file mode 100644 162 | index 0000000000..3f4f8f3a7e 163 | --- /dev/null 164 | +++ b/patches/chromium/cherry-pick-ffe482466bb9.patch 165 | @@ -0,0 +1,78 @@ 166 | +From ffe482466bb96b94b7fe9c2a5b35dff55f41e6c2 Mon Sep 17 00:00:00 2001 167 | +From: Yoshisato Yanagisawa 168 | +Date: Fri, 13 Jan 2023 00:14:55 +0000 169 | +Subject: [PATCH] Ensure v8::Value type is v8::Function in FetchHandlerType(). 170 | + 171 | +In the previous code, we did not confirm the returned v8::Value is 172 | +v8::Function or not in ServiceWorkerGlobalScope::FetchHandlerType(). 173 | +If non function type is set as an fetch event listener, it causes 174 | +misbehavior. 175 | + 176 | +(cherry picked from commit f68e9991d68d7ee36eb679cf5ffec06ab89569ac) 177 | + 178 | +Bug: 1404639 179 | +Change-Id: I7bc32f91108b2ffd3c5e8dc0464f2fa4adc41e8a 180 | +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4137870 181 | +Reviewed-by: Kouhei Ueno 182 | +Commit-Queue: Yoshisato Yanagisawa 183 | +Reviewed-by: Hiroshige Hayashizaki 184 | +Cr-Original-Commit-Position: refs/heads/main@{#1089635} 185 | +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4159531 186 | +Reviewed-by: Minoru Chikamune 187 | +Reviewed-by: Shunya Shishido 188 | +Cr-Commit-Position: refs/branch-heads/5359@{#1328} 189 | +Cr-Branched-From: 27d3765d341b09369006d030f83f582a29eb57ae-refs/heads/main@{#1058933} 190 | +--- 191 | + .../service_worker_version_browsertest.cc | 11 +++++++++++ 192 | + .../data/service_worker/non_function_fetch_event.js | 5 +++++ 193 | + .../service_worker/service_worker_global_scope.cc | 3 ++- 194 | + 3 files changed, 18 insertions(+), 1 deletion(-) 195 | + create mode 100644 content/test/data/service_worker/non_function_fetch_event.js 196 | + 197 | +diff --git a/content/browser/service_worker/service_worker_version_browsertest.cc b/content/browser/service_worker/service_worker_version_browsertest.cc 198 | +index ffb2447e340f3..5e1aeaa11cc99 100644 199 | +--- a/content/browser/service_worker/service_worker_version_browsertest.cc 200 | ++++ b/content/browser/service_worker/service_worker_version_browsertest.cc 201 | +@@ -965,6 +965,17 @@ IN_PROC_BROWSER_TEST_F(ServiceWorkerVersionBrowserTest, 202 | + version_->fetch_handler_type()); 203 | + } 204 | + 205 | ++IN_PROC_BROWSER_TEST_F(ServiceWorkerVersionBrowserTest, 206 | ++ NonFunctionFetchHandler) { 207 | ++ StartServerAndNavigateToSetup(); 208 | ++ ASSERT_EQ(Install("/service_worker/non_function_fetch_event.js"), 209 | ++ blink::ServiceWorkerStatusCode::kOk); 210 | ++ EXPECT_EQ(ServiceWorkerVersion::FetchHandlerExistence::EXISTS, 211 | ++ version_->fetch_handler_existence()); 212 | ++ EXPECT_EQ(ServiceWorkerVersion::FetchHandlerType::kNotSkippable, 213 | ++ version_->fetch_handler_type()); 214 | ++} 215 | ++ 216 | + // Check that fetch event handler added in the install event should result in a 217 | + // service worker that doesn't count as having a fetch event handler. 218 | + IN_PROC_BROWSER_TEST_F(ServiceWorkerVersionBrowserTest, 219 | +diff --git a/content/test/data/service_worker/non_function_fetch_event.js b/content/test/data/service_worker/non_function_fetch_event.js 220 | +new file mode 100644 221 | +index 0000000000000..7e2bb2b540a84 222 | +--- /dev/null 223 | ++++ b/content/test/data/service_worker/non_function_fetch_event.js 224 | +@@ -0,0 +1,5 @@ 225 | ++// Copyright 2023 The Chromium Authors 226 | ++// Use of this source code is governed by a BSD-style license that can be 227 | ++// found in the LICENSE file. 228 | ++ 229 | ++self.addEventListener('fetch', {}); 230 | +diff --git a/third_party/blink/renderer/modules/service_worker/service_worker_global_scope.cc b/third_party/blink/renderer/modules/service_worker/service_worker_global_scope.cc 231 | +index 72f98ac40a6e5..c66d232a65535 100644 232 | +--- a/third_party/blink/renderer/modules/service_worker/service_worker_global_scope.cc 233 | ++++ b/third_party/blink/renderer/modules/service_worker/service_worker_global_scope.cc 234 | +@@ -2610,7 +2610,8 @@ ServiceWorkerGlobalScope::FetchHandlerType() { 235 | + EventTarget* et = EventTarget::Create(ScriptController()->GetScriptState()); 236 | + v8::Local v = 237 | + To(e.Callback())->GetEffectiveFunction(*et); 238 | +- if (!v.As()->Experimental_IsNopFunction()) { 239 | ++ if (!v->IsFunction() || 240 | ++ !v.As()->Experimental_IsNopFunction()) { 241 | + return mojom::blink::ServiceWorkerFetchHandlerType::kNotSkippable; 242 | + } 243 | + } 244 | -- 245 | 2.39.3 246 | 247 | -------------------------------------------------------------------------------- /dev-util/electron/files/electron-remove-reliance-on-git-repo.patch: -------------------------------------------------------------------------------- 1 | From 60749b44e66e4b1ef34a46e3826de96a091b0d26 Mon Sep 17 00:00:00 2001 2 | From: Elvis Pranskevichus 3 | Date: Sat, 5 Nov 2022 22:24:48 -0700 4 | Subject: [PATCH] Remove reliance on git 5 | 6 | --- 7 | BUILD.gn | 2 -- 8 | script/lib/get-version.js | 21 +-------------------- 9 | 2 files changed, 1 insertion(+), 22 deletions(-) 10 | 11 | diff --git a/BUILD.gn b/BUILD.gn 12 | index c2ba679b94..6b8f1e86fb 100644 13 | --- a/BUILD.gn 14 | +++ b/BUILD.gn 15 | @@ -104,8 +104,6 @@ electron_version = exec_script("script/print-version.py", 16 | [], 17 | "trim string", 18 | [ 19 | - ".git/packed-refs", 20 | - ".git/HEAD", 21 | "script/lib/get-version.js", 22 | ]) 23 | 24 | diff --git a/script/lib/get-version.js b/script/lib/get-version.js 25 | index 45a120482b..cd45360f05 100644 26 | --- a/script/lib/get-version.js 27 | +++ b/script/lib/get-version.js 28 | @@ -1,22 +1,3 @@ 29 | -const { spawnSync } = require('child_process'); 30 | -const path = require('path'); 31 | - 32 | module.exports.getElectronVersion = () => { 33 | - // Find the nearest tag to the current HEAD 34 | - // This is equivilant to our old logic of "use a value in package.json" for the following reasons 35 | - // 36 | - // 1. Whenever we updated the package.json we ALSO pushed a tag with the same version 37 | - // 2. Whenever we _reverted_ a bump all we actually did was push a commit that deleted the tag and changed the version number back 38 | - // 39 | - // The only difference in the "git describe" technique is that technically a commit can "change" it's version 40 | - // number if a tag is created / removed retroactively. i.e. the first time a commit is pushed it will be 1.2.3 41 | - // and after the tag is made rebuilding the same commit will result in it being 1.2.4 42 | - const output = spawnSync('git', ['describe', '--tags', '--abbrev=0'], { 43 | - cwd: path.resolve(__dirname, '..', '..') 44 | - }); 45 | - if (output.status !== 0) { 46 | - console.error(output.stderr); 47 | - throw new Error('Failed to get current electron version'); 48 | - } 49 | - return output.stdout.toString().trim().replace(/^v/g, ''); 50 | + return '%ELECTRON_VERSION%'; 51 | }; 52 | -- 53 | 2.37.4 54 | 55 | -------------------------------------------------------------------------------- /dev-util/electron/files/electron-std-vector-non-const.patch: -------------------------------------------------------------------------------- 1 | diff --git a/patches/chromium/feat_add_data_parameter_to_processsingleton.patch b/patches/chromium/feat_add_data_parameter_to_processsingleton.patch 2 | index 2bc279b5e..f15d952a2 100644 3 | --- a/patches/chromium/feat_add_data_parameter_to_processsingleton.patch 4 | +++ b/patches/chromium/feat_add_data_parameter_to_processsingleton.patch 5 | @@ -30,7 +30,7 @@ index eec994c4252f17d9c9c41e66d5dae6509ed98a18..e538c9b76da4d4435e10cd3848438446 6 | base::RepeatingCallback; 8 | + const base::FilePath& current_directory, 9 | -+ const std::vector additional_data)>; 10 | ++ const std::vector additional_data)>; 11 | 12 | #if defined(OS_WIN) 13 | ProcessSingleton(const std::string& program_name, 14 | @@ -68,7 +68,7 @@ index a04d139f958a7aaef9b96e8c29317ccf7c97f009..e77cebd31967d28f3cb0db78e7360115 15 | // |reader| is for sending back ACK message. 16 | void HandleMessage(const std::string& current_dir, 17 | const std::vector& argv, 18 | -+ const std::vector additional_data, 19 | ++ const std::vector additional_data, 20 | SocketReader* reader); 21 | 22 | private: 23 | @@ -79,7 +79,7 @@ index a04d139f958a7aaef9b96e8c29317ccf7c97f009..e77cebd31967d28f3cb0db78e7360115 24 | - const std::string& current_dir, const std::vector& argv, 25 | + const std::string& current_dir, 26 | + const std::vector& argv, 27 | -+ const std::vector additional_data, 28 | ++ const std::vector additional_data, 29 | SocketReader* reader) { 30 | DCHECK(ui_task_runner_->BelongsToCurrentThread()); 31 | DCHECK(reader); 32 | @@ -109,7 +109,7 @@ index a04d139f958a7aaef9b96e8c29317ccf7c97f009..e77cebd31967d28f3cb0db78e7360115 33 | + base::StringToSizeT(tokens[0], &num_args); 34 | + std::vector command_line(tokens.begin() + 1, tokens.begin() + 1 + num_args); 35 | + 36 | -+ std::vector additional_data; 37 | ++ std::vector additional_data; 38 | + if (tokens.size() >= 3 + num_args) { 39 | + size_t additional_data_size; 40 | + base::StringToSizeT(tokens[1 + num_args], &additional_data_size); 41 | @@ -118,7 +118,7 @@ index a04d139f958a7aaef9b96e8c29317ccf7c97f009..e77cebd31967d28f3cb0db78e7360115 42 | + std::string(1, kTokenDelimiter)); 43 | + const uint8_t* additional_data_bits = 44 | + reinterpret_cast(remaining_args.c_str()); 45 | -+ additional_data = std::vector( 46 | ++ additional_data = std::vector( 47 | + additional_data_bits, additional_data_bits + additional_data_size); 48 | + } 49 | + 50 | @@ -184,7 +184,7 @@ index 19d5659d665321da54e05cee01be7da02e0c283b..600ff701b025ba190d05bc30994e3d3e 51 | base::CommandLine* parsed_command_line, 52 | - base::FilePath* current_directory) { 53 | + base::FilePath* current_directory, 54 | -+ std::vector* parsed_additional_data) { 55 | ++ std::vector* parsed_additional_data) { 56 | // We should have enough room for the shortest command (min_message_size) 57 | // and also be a multiple of wchar_t bytes. The shortest command 58 | - // possible is L"START\0\0" (empty current directory and command line). 59 | @@ -225,7 +225,7 @@ index 19d5659d665321da54e05cee01be7da02e0c283b..600ff701b025ba190d05bc30994e3d3e 60 | + msg.substr(fourth_null + 1, fifth_null - fourth_null); 61 | + const uint8_t* additional_data_bytes = 62 | + reinterpret_cast(additional_data.c_str()); 63 | -+ *parsed_additional_data = std::vector(additional_data_bytes, 64 | ++ *parsed_additional_data = std::vector(additional_data_bytes, 65 | + additional_data_bytes + additional_data_length); 66 | + 67 | return true; 68 | @@ -239,7 +239,7 @@ index 19d5659d665321da54e05cee01be7da02e0c283b..600ff701b025ba190d05bc30994e3d3e 69 | base::CommandLine parsed_command_line(base::CommandLine::NO_PROGRAM); 70 | base::FilePath current_directory; 71 | - if (!ParseCommandLine(cds, &parsed_command_line, ¤t_directory)) { 72 | -+ std::vector additional_data; 73 | ++ std::vector additional_data; 74 | + if (!ParseCommandLine(cds, &parsed_command_line, ¤t_directory, &additional_data)) { 75 | *result = TRUE; 76 | return true; 77 | diff --git a/shell/browser/api/electron_api_app.cc b/shell/browser/api/electron_api_app.cc 78 | index 7328cedf9..9945a04b2 100644 79 | --- a/shell/browser/api/electron_api_app.cc 80 | +++ b/shell/browser/api/electron_api_app.cc 81 | @@ -517,10 +517,10 @@ bool NotificationCallbackWrapper( 82 | const base::RepeatingCallback< 83 | void(const base::CommandLine& command_line, 84 | const base::FilePath& current_directory, 85 | - const std::vector additional_data)>& callback, 86 | + const std::vector additional_data)>& callback, 87 | const base::CommandLine& cmd, 88 | const base::FilePath& cwd, 89 | - const std::vector additional_data) { 90 | + const std::vector additional_data) { 91 | // Make sure the callback is called after app gets ready. 92 | if (Browser::Get()->is_ready()) { 93 | callback.Run(cmd, cwd, std::move(additional_data)); 94 | @@ -1081,7 +1081,7 @@ std::string App::GetLocaleCountryCode() { 95 | 96 | void App::OnSecondInstance(const base::CommandLine& cmd, 97 | const base::FilePath& cwd, 98 | - const std::vector additional_data) { 99 | + const std::vector additional_data) { 100 | v8::Isolate* isolate = JavascriptEnvironment::GetIsolate(); 101 | v8::Locker locker(isolate); 102 | v8::HandleScope handle_scope(isolate); 103 | diff --git a/shell/browser/api/electron_api_app.h b/shell/browser/api/electron_api_app.h 104 | index fd644ed95..838366041 100644 105 | --- a/shell/browser/api/electron_api_app.h 106 | +++ b/shell/browser/api/electron_api_app.h 107 | @@ -190,7 +190,7 @@ class App : public ElectronBrowserClient::Delegate, 108 | std::string GetLocaleCountryCode(); 109 | void OnSecondInstance(const base::CommandLine& cmd, 110 | const base::FilePath& cwd, 111 | - const std::vector additional_data); 112 | + const std::vector additional_data); 113 | bool HasSingleInstanceLock() const; 114 | bool RequestSingleInstanceLock(gin::Arguments* args); 115 | void ReleaseSingleInstanceLock(); 116 | -------------------------------------------------------------------------------- /dev-util/electron/files/electron-use-published-nan.patch: -------------------------------------------------------------------------------- 1 | From 36d3027a737f8795a23e801b33bd2c7d21105b4b Mon Sep 17 00:00:00 2001 2 | From: Elvis Pranskevichus 3 | Date: Wed, 29 May 2024 12:24:32 -0700 4 | Subject: [PATCH] Use published nan 5 | 6 | --- 7 | package.json | 2 +- 8 | yarn.lock | 7 ++++--- 9 | 2 files changed, 5 insertions(+), 4 deletions(-) 10 | 11 | diff --git a/package.json b/package.json 12 | index 942d190506..1ca66ccef9 100644 13 | --- a/package.json 14 | +++ b/package.json 15 | @@ -152,6 +152,6 @@ 16 | ] 17 | }, 18 | "resolutions": { 19 | - "nan": "nodejs/nan#e14bdcd1f72d62bca1d541b66da43130384ec213" 20 | + "nan": "^2.19.0" 21 | } 22 | } 23 | diff --git a/yarn.lock b/yarn.lock 24 | index 12711fc4f6..99604483b4 100644 25 | --- a/yarn.lock 26 | +++ b/yarn.lock 27 | @@ -4691,9 +4691,10 @@ mute-stream@0.0.8: 28 | resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" 29 | integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== 30 | 31 | -nan@nodejs/nan#e14bdcd1f72d62bca1d541b66da43130384ec213: 32 | - version "2.18.0" 33 | - resolved "https://codeload.github.com/nodejs/nan/tar.gz/e14bdcd1f72d62bca1d541b66da43130384ec213" 34 | +nan@^2.19.0: 35 | + version "2.19.0" 36 | + resolved "https://registry.yarnpkg.com/nan/-/nan-2.19.0.tgz#bb58122ad55a6c5bc973303908d5b16cfdd5a8c0" 37 | + integrity sha512-nO1xXxfh/RWNxfd/XPfbIfFk5vgLsAxUR9y5O0cHMJu/AW9U95JLXqthYHjEp+8gQ5p96K9jUp8nbVOxCdRbtw== 38 | 39 | natural-compare-lite@^1.4.0: 40 | version "1.4.0" 41 | -- 42 | 2.44.1 43 | 44 | -------------------------------------------------------------------------------- /dev-util/electron/files/fix_patches.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from __future__ import print_function 4 | 5 | import argparse 6 | import glob 7 | import json 8 | import os 9 | import os.path 10 | import sys 11 | 12 | import unidiff 13 | 14 | 15 | PY2 = sys.version_info[0] == 2 16 | if not PY2: 17 | unicode = str 18 | 19 | 20 | def parse_args(): 21 | parser = argparse.ArgumentParser(description="List Electron patches") 22 | parser.add_argument( 23 | "config", 24 | nargs="+", 25 | type=argparse.FileType("r"), 26 | help="patches' config(s) the JSON format", 27 | ) 28 | return parser.parse_args() 29 | 30 | 31 | def die(msg): 32 | print("ERROR: {}".format(msg), file=sys.stderr) 33 | sys.exit(1) 34 | 35 | 36 | def note(msg): 37 | print(" >>> {}".format(msg), file=sys.stderr) 38 | 39 | 40 | def main(): 41 | configs = parse_args().config 42 | for config_json in configs: 43 | note(f"Cleaning up Electron patches declared in {config_json.name}...") 44 | for patch_dir, repo in json.load(config_json).items(): 45 | index = os.path.join(patch_dir, ".patches") 46 | if not os.path.isfile(index): 47 | die("patch index does not exist in {}".format(patch_dir)) 48 | 49 | with open(index) as f: 50 | patches = [line.strip() for line in f.readlines()] 51 | patches_set = set(patches) 52 | 53 | for fn in os.listdir(patch_dir): 54 | fpath = os.path.join(patch_dir, fn) 55 | if ( 56 | os.path.isfile(fpath) 57 | and ( 58 | fpath.endswith(".patch") 59 | or fpath.endswith(".diff") 60 | ) 61 | and fn not in patches_set 62 | ): 63 | note("Removing redundant {}".format(fn)) 64 | os.unlink(fpath) 65 | 66 | for i, patch_name in enumerate(patches): 67 | patch_path = os.path.join(patch_dir, patch_name) 68 | if not os.path.isfile(patch_path): 69 | die("patch does not exist: {}".format(patch_path)) 70 | 71 | new_patch_name = "{i:04}-{patch_name}".format( 72 | i=i, 73 | patch_name=patch_name, 74 | ) 75 | new_patch_path = os.path.join(patch_dir, new_patch_name) 76 | os.rename(patch_path, new_patch_path) 77 | 78 | patch = unidiff.PatchSet.from_filename( 79 | new_patch_path, 80 | encoding="utf-8", 81 | ) 82 | patched_files = [] 83 | removals = False 84 | for file in patch: 85 | if not file.source_file.endswith("/dev/null"): 86 | source_file = os.path.join( 87 | repo, 88 | "/".join(file.source_file.split("/")[1:]), 89 | ) 90 | else: 91 | continue 92 | 93 | if not os.path.exists(source_file): 94 | note( 95 | "Patch source file {} " 96 | "does not exist, skipping.".format(source_file) 97 | ) 98 | removals = True 99 | else: 100 | patched_files.append(file) 101 | 102 | if removals: 103 | if patched_files: 104 | with open(new_patch_path, "w") as f: 105 | f.write( 106 | "".join(str(pf) for pf in patched_files), 107 | ) 108 | else: 109 | note("Removing redundant {}".format(new_patch_path)) 110 | os.unlink(new_patch_path) 111 | 112 | if not os.path.exists(repo) or ( 113 | not glob.glob(os.path.join(patch_dir, "*.patch")) 114 | and not glob.glob(os.path.join(patch_dir, "*.diff")) 115 | ): 116 | continue 117 | 118 | print("{}:{}".format(patch_dir, repo)) 119 | 120 | 121 | if __name__ == "__main__": 122 | main() 123 | -------------------------------------------------------------------------------- /dev-util/electron/files/fix_patches_r1.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from __future__ import print_function 4 | 5 | import argparse 6 | import glob 7 | import json 8 | import os 9 | import os.path 10 | import sys 11 | 12 | import unidiff 13 | 14 | 15 | PY2 = sys.version_info[0] == 2 16 | if not PY2: 17 | unicode = str 18 | 19 | 20 | def parse_args(): 21 | parser = argparse.ArgumentParser(description="List Electron patches") 22 | parser.add_argument( 23 | "config", 24 | nargs="+", 25 | type=argparse.FileType("r"), 26 | help="patches' config(s) the JSON format", 27 | ) 28 | return parser.parse_args() 29 | 30 | 31 | def die(msg): 32 | print("ERROR: {}".format(msg), file=sys.stderr) 33 | sys.exit(1) 34 | 35 | 36 | def note(msg): 37 | print(" >>> {}".format(msg), file=sys.stderr) 38 | 39 | 40 | def main(): 41 | configs = parse_args().config 42 | for config_json in configs: 43 | note(f"Cleaning up Electron patches declared in {config_json.name}...") 44 | for entry in json.load(config_json): 45 | patch_dir = entry["patch_dir"] 46 | repo = entry["repo"] 47 | index = os.path.join(patch_dir, ".patches") 48 | if not os.path.isfile(index): 49 | die("patch index does not exist in {}".format(patch_dir)) 50 | 51 | with open(index) as f: 52 | patches = [line.strip() for line in f.readlines()] 53 | patches_set = set(patches) 54 | 55 | for fn in os.listdir(patch_dir): 56 | fpath = os.path.join(patch_dir, fn) 57 | if ( 58 | os.path.isfile(fpath) 59 | and ( 60 | fpath.endswith(".patch") 61 | or fpath.endswith(".diff") 62 | ) 63 | and fn not in patches_set 64 | ): 65 | note("Removing redundant {}".format(fn)) 66 | os.unlink(fpath) 67 | 68 | for i, patch_name in enumerate(patches): 69 | patch_path = os.path.join(patch_dir, patch_name) 70 | if not os.path.isfile(patch_path): 71 | die("patch does not exist: {}".format(patch_path)) 72 | 73 | new_patch_name = "{i:04}-{patch_name}".format( 74 | i=i, 75 | patch_name=patch_name, 76 | ) 77 | new_patch_path = os.path.join(patch_dir, new_patch_name) 78 | os.rename(patch_path, new_patch_path) 79 | 80 | patch = unidiff.PatchSet.from_filename( 81 | new_patch_path, 82 | encoding="utf-8", 83 | ) 84 | patched_files = [] 85 | removals = False 86 | for file in patch: 87 | if not file.source_file.endswith("/dev/null"): 88 | source_file = os.path.join( 89 | repo, 90 | "/".join(file.source_file.split("/")[1:]), 91 | ) 92 | else: 93 | continue 94 | 95 | if not os.path.exists(source_file): 96 | note( 97 | "Patch source file {} " 98 | "does not exist, skipping.".format(source_file) 99 | ) 100 | removals = True 101 | else: 102 | patched_files.append(file) 103 | 104 | if removals: 105 | if patched_files: 106 | with open(new_patch_path, "w") as f: 107 | f.write( 108 | "".join(str(pf) for pf in patched_files), 109 | ) 110 | else: 111 | note("Removing redundant {}".format(new_patch_path)) 112 | os.unlink(new_patch_path) 113 | 114 | if not os.path.exists(repo) or ( 115 | not glob.glob(os.path.join(patch_dir, "*.patch")) 116 | and not glob.glob(os.path.join(patch_dir, "*.diff")) 117 | ): 118 | continue 119 | 120 | print("{}:{}".format(patch_dir, repo)) 121 | 122 | 123 | if __name__ == "__main__": 124 | main() 125 | -------------------------------------------------------------------------------- /dev-util/electron/files/node-openssl-fips-decl-r1.patch: -------------------------------------------------------------------------------- 1 | From 97be4452fa05cad3af7fe21c265c06cbe6839107 Mon Sep 17 00:00:00 2001 2 | From: Elvis Pranskevichus 3 | Date: Mon, 7 Jun 2021 12:24:22 -0700 4 | Subject: [PATCH] Fix node openssl_fips declaration 5 | 6 | --- 7 | common.gypi | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/common.gypi b/common.gypi 11 | index e610650a01..f4179a50f6 100644 12 | --- a/common.gypi 13 | +++ b/common.gypi 14 | @@ -28,7 +28,7 @@ 15 | 'clang%': 0, 16 | 'error_on_warn%': 'false', 17 | 18 | - 'openssl_fips%': '', 19 | + 'openssl_fips': '', 20 | 'openssl_no_asm%': 0, 21 | 22 | # Don't use ICU data file (icudtl.dat) from V8, we use our own. 23 | -- 24 | 2.32.0 25 | 26 | -------------------------------------------------------------------------------- /dev-util/electron/metadata.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | elvis@magic.io 6 | Elvis Pranskevichus 7 | 8 | 9 | proxy-maint@gentoo.org 10 | Proxy Maintainers 11 | 12 | 13 | Use Clang compiler instead of GCC 14 | Split build into more shared libraries to speed up linking. Mostly intended for debugging and development, NOT RECOMMENDED for general use. 15 | Build Ozone only with headless backend, NOT RECOMMENDED for general use. 16 | Build with GTK4 headers. 17 | Enable JavaScript type-checking for Chrome's web technology-based UI. Requires Java. 18 | Build with link time optimization enabled 19 | Disable optimized assembly code that is not PIC friendly 20 | Enable proprietary codecs like H.264, MP3 21 | Enable support for remote desktop and screen cast using media-video/pipewire 22 | Use system ffmpeg instead of the bundled one 23 | Use system harfbuzz instead of the bundled one. 24 | Use system icu instead of the bundled one 25 | Use system libpng instead of the bundled one. 26 | 27 | 28 | -------------------------------------------------------------------------------- /electron-overlay.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | https://github.com/elprans/electron-overlay 8 | 9 | elvis@magic.io 10 | 11 | 12 | git://github.com/elprans/electron-overlay.git 13 | https://github.com/elprans/electron-overlay/commits/master.atom 14 | 15 | 16 | -------------------------------------------------------------------------------- /licenses/MS-vscode: -------------------------------------------------------------------------------- 1 | This license applies to the Visual Studio Code product. Source Code for Visual Studio Code is available at https://github.com/Microsoft/vscode under the MIT license agreement at https://github.com/Microsoft/vscode/blob/master/license.txt. Additional license information can be found in our FAQ at https://code.visualstudio.com/docs/supporting/faq. 2 | MICROSOFT SOFTWARE LICENSE TERMS 3 | MICROSOFT VISUAL STUDIO CODE 4 | These license terms are an agreement between you and Microsoft Corporation (or based on where you live, one of its affiliates). They apply to the software named above. The terms also apply to any Microsoft services or updates for the software, except to the extent those have different terms. 5 | IF YOU COMPLY WITH THESE LICENSE TERMS, YOU HAVE THE RIGHTS BELOW. 6 | 1. INSTALLATION AND USE RIGHTS. 7 | a. General. You may use any number of copies of the software to develop and test your applications, including deployment within your internal corporate network. 8 | b. Demo use. The uses permitted above include use of the software in demonstrating your applications. 9 | c. Third Party Components. The software may include third party components with separate legal notices or governed by other agreements, as may be described in the ThirdPartyNotices file accompanying the software. 10 | d. Extensions. The software gives you the option to download other Microsoft and third party software packages from our extension marketplace or package managers. Those packages are under their own licenses, and not this agreement. Microsoft does not distribute, license or provide any warranties for any of the third party packages. By accessing or using our extension marketplace, you agree to the extension marketplace terms located at https://aka.ms/VSMarketplace-ToU. 11 | 2. DATA. 12 | e. Data Collection. The software may collect information about you and your use of the software, and send that to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may opt-out of many of these scenarios, but not all, as described in the product documentation located at https://code.visualstudio.com/docs/supporting/faq#_how-to-disable-telemetry-reporting. There may also be some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with Microsoft’s privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices. 13 | f. Processing of Personal Data. To the extent Microsoft is a processor or subprocessor of personal data in connection with the software, Microsoft makes the commitments in the European Union General Data Protection Regulation Terms of the Online Services Terms to all customers effective May 25, 2018, at http://go.microsoft.com/?linkid=9840733. 14 | 3. UPDATES. The software may periodically check for updates and download and install them for you. You may obtain updates only from Microsoft or authorized sources. Microsoft may need to update your system to provide you with updates. You agree to receive these automatic updates without any additional notice. Updates may not include or support all existing software features, services, or peripheral devices. If you do not want automatic updates, you may turn them off by following the instructions in the documentation at http://go.microsoft.com/fwlink/?LinkID=616397. 15 | 4. FEEDBACK. If you give feedback about the software to Microsoft, you give to Microsoft, without charge, the right to use, share and commercialize your feedback in any way and for any purpose. You will not give feedback that is subject to a license that requires Microsoft to license its software or documentation to third parties because we include your feedback in them. These rights survive this agreement. 16 | 5. SCOPE OF LICENSE. This license applies to the Visual Studio Code product. Source code for Visual Studio Code is available at https://github.com/Microsoft/vscode under the MIT license agreement. The software is licensed, not sold. This agreement only gives you some rights to use the software. Microsoft reserves all other rights. Unless applicable law gives you more rights despite this limitation, you may use the software only as expressly permitted in this agreement. In doing so, you must comply with any technical limitations in the software that only allow you to use it in certain ways. You may not 17 | • reverse engineer, decompile or disassemble the software, or otherwise attempt to derive the source code for the software except and solely to the extent required by third party licensing terms governing use of certain open source components that may be included in the software; 18 | • remove, minimize, block or modify any notices of Microsoft or its suppliers in the software; 19 | • use the software in any way that is against the law; 20 | • share, publish, rent or lease the software, or provide the software as a stand-alone offering for others to use. 21 | 6. SUPPORT SERVICES. Because this software is “as is,” we may not provide support services for it. 22 | 7. ENTIRE AGREEMENT. This agreement, and the terms for supplements, updates, Internet-based services and support services that you use, are the entire agreement for the software and support services. 23 | 8. EXPORT RESTRICTIONS. You must comply with all domestic and international export laws and regulations that apply to the software, which include restrictions on destinations, end-users, and end use. For further information on export restrictions, see www.microsoft.com/exporting. 24 | 9. APPLICABLE LAW. If you acquired the software in the United States, Washington law applies to interpretation of and claims for breach of this agreement, and the laws of the state where you live apply to all other claims. If you acquired the software in any other country, its laws apply. 25 | 10. CONSUMER RIGHTS; REGIONAL VARIATIONS. This agreement describes certain legal rights. You may have other rights, including consumer rights, under the laws of your state or country. Separate and apart from your relationship with Microsoft, you may also have rights with respect to the party from which you acquired the software. This agreement does not change those other rights if the laws of your state or country do not permit it to do so. For example, if you acquired the software in one of the below regions, or mandatory country law applies, then the following provisions apply to you: 26 | a) Australia. You have statutory guarantees under the Australian Consumer Law and nothing in this agreement is intended to affect those rights. 27 | b) Canada. If you acquired this software in Canada, you may stop receiving updates by turning off the automatic update feature, disconnecting your device from the Internet (if and when you re-connect to the Internet, however, the software will resume checking for and installing updates), or uninstalling the software. The product documentation, if any, may also specify how to turn off updates for your specific device or software. 28 | c) Germany and Austria. 29 | (i) Warranty. The properly licensed software will perform substantially as described in any Microsoft materials that accompany the software. However, Microsoft gives no contractual guarantee in relation to the licensed software. 30 | (ii) Limitation of Liability. In case of intentional conduct, gross negligence, claims based on the Product Liability Act, as well as, in case of death or personal or physical injury, Microsoft is liable according to the statutory law. 31 | Subject to the foregoing clause (ii), Microsoft will only be liable for slight negligence if Microsoft is in breach of such material contractual obligations, the fulfillment of which facilitate the due performance of this agreement, the breach of which would endanger the purpose of this agreement and the compliance with which a party may constantly trust in (so-called "cardinal obligations"). In other cases of slight negligence, Microsoft will not be liable for slight negligence. 32 | 11. DISCLAIMER OF WARRANTY. The software is licensed “as-is.”  You bear the risk of using it. Microsoft gives no express warranties, guarantees or conditions. To the extent permitted under your local laws, Microsoft excludes the implied warranties of merchantability, fitness for a particular purpose and non-infringement. 33 | 12. LIMITATION ON AND EXCLUSION OF DAMAGES. You can recover from Microsoft and its suppliers only direct damages up to U.S. $5.00. You cannot recover any other damages, including consequential, lost profits, special, indirect or incidental damages. 34 | This limitation applies to (a) anything related to the software, services, content (including code) on third party Internet sites, or third party applications; and (b) claims for breach of contract, breach of warranty, guarantee or condition, strict liability, negligence, or other tort to the extent permitted by applicable law. 35 | • It also applies even if Microsoft knew or should have known about the possibility of the damages. The above limitation or exclusion may not apply to you because your state or country may not allow the exclusion or limitation of incidental, consequential or other damages. 36 | EULA ID: Visual Studio Code 14 November 2018 37 | -------------------------------------------------------------------------------- /metadata/.gitignore: -------------------------------------------------------------------------------- 1 | /md5-cache 2 | -------------------------------------------------------------------------------- /metadata/layout.conf: -------------------------------------------------------------------------------- 1 | masters = gentoo 2 | -------------------------------------------------------------------------------- /profiles/eapi: -------------------------------------------------------------------------------- 1 | 7 2 | -------------------------------------------------------------------------------- /profiles/package.mask: -------------------------------------------------------------------------------- 1 | #################################################################### 2 | # 3 | # When you add an entry to the top of this file, add your name, the date, and 4 | # an explanation of why something is getting masked. Please be extremely 5 | # careful not to commit atoms that are not valid, as it can cause large-scale 6 | # breakage, especially if it ends up in the daily snapshot. 7 | # 8 | ## Example: 9 | ## 10 | ## # Dev E. Loper (28 Jun 2012) 11 | ## # Masking these versions until we can get the 12 | ## # v4l stuff to work properly again 13 | ## =media-video/mplayer-0.90_pre5 14 | ## =media-video/mplayer-0.90_pre5-r1 15 | # 16 | # - Best last rites (removal) practices - 17 | # Include the following info: 18 | # a) reason for masking 19 | # b) bug # for the removal (and yes you should have one) 20 | # c) date of removal (either the date or "in x days") 21 | # 22 | ## Example: 23 | ## 24 | ## # Dev E. Loper (23 May 2015) 25 | ## # Masked for removal in 30 days. Doesn't work 26 | ## # with new libfoo. Upstream dead, gtk-1, smells 27 | ## # funny. (bug #987654) 28 | ## app-misc/some-package 29 | 30 | #--- END OF EXAMPLES --- 31 | -------------------------------------------------------------------------------- /profiles/package.use.mask: -------------------------------------------------------------------------------- 1 | # Qt support isn't quite there yet 2 | =dev-util/electron-22.3* qt5 3 | -------------------------------------------------------------------------------- /profiles/repo_name: -------------------------------------------------------------------------------- 1 | electron 2 | --------------------------------------------------------------------------------