├── .editorconfig ├── .gitignore ├── README.md ├── apm ├── PKGBUILD ├── apm.js ├── git-utils.patch └── no-scripts.patch ├── atom ├── PKGBUILD ├── atom.js ├── dugite-use-system-git.patch ├── fix-atom-sh.patch ├── fix-license-path.patch ├── fix-restart.patch ├── git-utils.patch ├── no-unsafe-eval-warning.patch ├── node-env-production.patch ├── symbols-view-use-system-ctags.patch ├── use-system-apm.patch └── use-system-electron.patch ├── electron ├── .gitignore ├── PKGBUILD ├── default_app-icon.patch ├── electron-launcher.sh ├── electron.desktop ├── enable-GlobalMediaControlsCastStartStop.patch ├── fix-no-member-named-tie-in-namespace-std.patch ├── iwyu-add-utility-for-std-exchange.patch ├── iwyu-add-vector-needed-by-statsentry.patch ├── jinja-python-3.10.patch ├── sql-make-VirtualCursor-standard-layout-type.patch ├── std-vector-non-const.patch ├── use-system-libraries-in-node.patch ├── webcodecs-stop-using-AudioOpusEncoder.patch └── webrtc-check-existence-of-cursor-metadata.patch ├── genrepo.sh └── sync.sh /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | insert_final_newline = true 7 | indent_size = 4 8 | indent_style = space 9 | trim_trailing_whitespace = true 10 | 11 | [PKGBUILD] 12 | indent_size = 2 13 | 14 | [*.patch] 15 | trim_trailing_whitespace = false 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | */*.pkg.tar.* 2 | */pkg/ 3 | */src/ 4 | */git-utils/ 5 | */*.tar.gz 6 | */*.tar.gz.part 7 | */*.log 8 | repository/ 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This repository contains `PKGBUILD`s and related files necessary to build Atom 2 | and Electron binary packages for [Arch Linux][arch]. Pre-built packages are 3 | available by enabling `[atom]` repository in `/etc/pacman.conf`: 4 | 5 | ```sh 6 | [atom] 7 | Server = http://noaxiom.org/$repo/$arch 8 | ``` 9 | 10 | You should also add the repo's key to your trusted keys: 11 | 12 | ```sh 13 | sudo pacman-key -r B0544167 14 | sudo pacman-key --lsign-key B0544167 15 | ``` 16 | 17 | Check the Arch [wiki][atom-wiki] for more information. 18 | 19 | # Build method 20 | 21 | Our method of building Atom is slightly different from the one officially 22 | recommended by the Atom team. 23 | 24 | If you follow [Atom build instructions][atom-build], the build system will 25 | download a binary copy of Electron and include it in your distribution. If you 26 | follow [Electron build instructions][electron-build], it will use a binary copy 27 | of [libchromiumcontent][libchromiumcontent], the library upon which Electron is 28 | based. 29 | 30 | Our packages, on the other hand, are entirely built for source. 31 | 32 | Another difference with upstream builds is that they ship Atom, Electron and apm 33 | (the Atom package manager) all in one distribution, and they rename the 34 | `electron` executable as `atom`. We ship three distinct packages named atom, 35 | electron and nodejs-atom-package-manager, and the atom package depends on the 36 | other two. Moreover, nodejs-atom-package-manager uses the system nodejs 37 | installation, rather than downloading a binary node executable as the official 38 | build does. 39 | 40 | [arch]: https://www.archlinux.org/ "Arch Linux" 41 | [atom-build]: https://github.com/atom/atom/blob/master/docs/build-instructions/linux.md 42 | [atom-wiki]: https://wiki.archlinux.org/index.php/Atom "Atom - ArchWiki" 43 | [electron-build]: https://github.com/atom/electron/blob/master/docs/development/build-instructions-linux.md 44 | [libchromiumcontent]: https://github.com/atom/libchromiumcontent 45 | -------------------------------------------------------------------------------- /apm/PKGBUILD: -------------------------------------------------------------------------------- 1 | # Maintainer: Nicola Squartini 2 | 3 | pkgname=apm 4 | pkgver=2.6.4 5 | pkgrel=1 6 | pkgdesc='Atom package manager' 7 | arch=('x86_64') 8 | url='https://github.com/atom/apm' 9 | license=('MIT') 10 | depends=('libsecret' 'nodejs>=10' 'npm' 'python') 11 | makedepends=('git') 12 | provides=('nodejs-atom-package-manager') 13 | conflicts=('nodejs-atom-package-manager') 14 | replaces=('nodejs-atom-package-manager') 15 | options=(!emptydirs) 16 | source=("${pkgname}-${pkgver}.tar.gz::https://github.com/atom/apm/archive/v${pkgver}.tar.gz" 17 | 'apm.js' 18 | 'no-scripts.patch' 19 | 'git-utils.patch') 20 | sha512sums=('6549b7546afe3053f61804ee324b6dec72e409dbf433b2e7191b99deb189f94d640b7e140b689ab380f5269ba0b9a78132d2745dd6d2689673261d6445183868' 21 | '36bbf34a3a7ba9ed63ed1d805be9d7906d284077ff72a4c8199efc1f04ac672c4a1a75568f2c9d81037481452d3a47c3e54370a76e9ed7b35e67fda93acd1726' 22 | 'a962ecc1557bcfe92c8d771a44c3bbbd72d0bf9c81285662ef26a1f99f3604efcca0307e7edb59eb99c2cbc83db4ab844f0db0532ca990581eff28e50c42acd6' 23 | 'bf9f4023bfbdc7240e5ed8a87bc9097eb7a57b2bae44f1044098eb380b15ff8a12f92347b99b6754c6adb537b8310d1f47bdfd3e60db411e4d69d575ce70b2a6') 24 | 25 | _apmdir='/usr/lib/node_modules/atom-package-manager' 26 | 27 | prepare() { 28 | rm -rf "${srcdir}"/apm-build 29 | 30 | cd apm-${pkgver} 31 | 32 | # Use custom launcher 33 | rm bin/apm{,.cmd} bin/npm{,.cmd} 34 | rm src/cli.coffee 35 | install -m755 "${srcdir}"/apm.js bin/apm 36 | 37 | # Don't download binary Node 38 | patch -Np1 -i "${srcdir}"/no-scripts.patch 39 | rm BUNDLED_NODE_VERSION script/* 40 | } 41 | 42 | build() { 43 | cd apm-${pkgver} 44 | 45 | npm install 46 | npx coffee --compile --output lib src 47 | npm uninstall coffee-script coffeelint express jasmine-focused shx node-gyp 48 | 49 | cd node_modules/git-utils 50 | patch -Np1 -i "${srcdir}/git-utils.patch" 51 | node-gyp rebuild 52 | cd ../.. 53 | 54 | npm pack 55 | } 56 | 57 | package() { 58 | cd apm-${pkgver} 59 | 60 | install -d -m755 "${pkgdir}${_apmdir}" 61 | tar -xf atom-package-manager-*.tgz --strip-components 1 \ 62 | -C "${pkgdir}${_apmdir}" 63 | cp -r node_modules "${pkgdir}${_apmdir}" 64 | 65 | install -d -m755 "${pkgdir}/usr/bin" 66 | ln -s \ 67 | "$(realpath --relative-to="${pkgdir}/usr/bin" "${pkgdir}${_apmdir}/bin/apm")" \ 68 | "${pkgdir}/usr/bin" 69 | 70 | # Install license file 71 | install -d -m755 "${pkgdir}/usr/share/licenses/${pkgname}" 72 | ln -s \ 73 | "$(realpath --relative-to="${pkgdir}/usr/share/licenses/${pkgname}" "${pkgdir}${_apmdir}/LICENSE.md")" \ 74 | "${pkgdir}/usr/share/licenses/${pkgname}" 75 | 76 | # Remove occurrences of ${srcdir} 77 | find "${pkgdir}" -name "package.json" \ 78 | -exec sed -e "s|${srcdir}/apm-${pkgver}|${_apmdir}|" \ 79 | -i '{}' \; 80 | 81 | # Remove useless stuff 82 | find "${pkgdir}"/usr/lib \ 83 | -name ".*" -prune -exec rm -r '{}' \; \ 84 | -or -name "*.a" -exec rm '{}' \; \ 85 | -or -name "*.bat" -exec rm '{}' \; \ 86 | -or -name "*.mk" -exec rm '{}' \; \ 87 | -or -path "*/git-utils/binding.gyp" -exec rm '{}' \; \ 88 | -or -path "*/git-utils/src/*.cc" -exec rm '{}' \; \ 89 | -or -path "*/git-utils/src/*.h" -exec rm '{}' \; \ 90 | -or -path "*/keytar/binding.gyp" -exec rm '{}' \; \ 91 | -or -path "*/keytar/src" -prune -exec rm -r '{}' \; \ 92 | -or -path "*/oniguruma/binding.gyp" -exec rm '{}' \; \ 93 | -or -path "*/oniguruma/src" -prune -exec rm -r '{}' \; \ 94 | -or -name "appveyor.yml" -exec rm '{}' \; \ 95 | -or -name "benchmark" -prune -exec rm -r '{}' \; \ 96 | -or -name "binding.Makefile" -exec rm '{}' \; \ 97 | -or -name "config.gypi" -exec rm '{}' \; \ 98 | -or -name "deps" -prune -exec rm -r '{}' \; \ 99 | -or -name "doc" -prune -exec rm -r '{}' \; \ 100 | -or -name "html" -prune -exec rm -r '{}' \; \ 101 | -or -name "Makefile" -exec rm '{}' \; \ 102 | -or -name "man" -prune -exec rm -r '{}' \; \ 103 | -or -name "obj.target" -prune -exec rm -r '{}' \; \ 104 | -or -name "samples" -prune -exec rm -r '{}' \; \ 105 | -or -name "scripts" -prune -exec rm -r '{}' \; \ 106 | -or -name "test" -prune -exec rm -r '{}' \; \ 107 | -or -name "tests" -prune -exec rm -r '{}' \; 108 | } 109 | -------------------------------------------------------------------------------- /apm/apm.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/node 2 | 3 | "use strict"; 4 | 5 | process.env.ATOM_RESOURCE_PATH = process.env.ATOM_RESOURCE_PATH || "/usr/lib/atom"; 6 | 7 | process.env.ATOM_ELECTRON_VERSION = process.env.ATOM_ELECTRON_VERSION || require("fs").readFileSync("/usr/lib/electron9/version", "utf8"); 8 | 9 | require("../lib/apm-cli.js").run(process.argv.slice(2), function (error) { 10 | process.exitCode = Number(Boolean(error)); 11 | }); 12 | -------------------------------------------------------------------------------- /apm/git-utils.patch: -------------------------------------------------------------------------------- 1 | --- a/binding.gyp 2 | +++ b/binding.gyp 3 | @@ -162,6 +162,7 @@ 4 | 'deps/libgit2/src/message.h', 5 | 'deps/libgit2/src/mwindow.c', 6 | 'deps/libgit2/src/mwindow.h', 7 | + 'deps/libgit2/src/net.c', 8 | 'deps/libgit2/src/netops.c', 9 | 'deps/libgit2/src/netops.h', 10 | 'deps/libgit2/src/notes.c', 11 | -------------------------------------------------------------------------------- /apm/no-scripts.patch: -------------------------------------------------------------------------------- 1 | --- a/package.json 2 | +++ b/package.json 3 | @@ -14,18 +14,6 @@ 4 | "bin": { 5 | "apm": "bin/apm" 6 | }, 7 | - "scripts": { 8 | - "check-version": "node script/check-version.js", 9 | - "clean:bin": "shx rm -rf bin/node_darwin_x64 bin/node.exe bin/node", 10 | - "clean:lib": "shx rm -rf lib && shx mkdir -p lib", 11 | - "clean": "npm run clean:lib && npm run clean:bin", 12 | - "lint": "coffeelint src spec", 13 | - "coffee": "coffee --compile --output lib src", 14 | - "build": "npm run clean:lib && npm run coffee", 15 | - "prepare": "npm run build", 16 | - "postinstall": "node script/postinstall.js", 17 | - "test": "npm run check-version && npm run lint && jasmine-focused --captureExceptions --coffee spec" 18 | - }, 19 | "dependencies": { 20 | "@atom/plist": "0.4.4", 21 | "asar-require": "0.3.0", 22 | -------------------------------------------------------------------------------- /atom/PKGBUILD: -------------------------------------------------------------------------------- 1 | # Maintainer: Nicola Squartini 2 | 3 | pkgname=atom 4 | pkgver=1.58.0 5 | _commit=550c1dae66f97bd3fc31c59e6d8ba5f1299ccaf7 6 | pkgrel=1 7 | pkgdesc='A hackable text editor for the 21st Century' 8 | arch=('x86_64') 9 | url='https://github.com/atom/atom' 10 | license=('MIT' 'custom') 11 | depends=('apm' 'electron9' 'libxkbfile' 'ripgrep') 12 | makedepends=('git' 'npm') 13 | optdepends=('ctags: symbol indexing support' 14 | 'git: Git and GitHub integration') 15 | replaces=('atom-editor') 16 | options=(!emptydirs) 17 | source=("git+https://github.com/atom/atom.git#commit=${_commit}" 18 | 'atom.js' 19 | 'dugite-use-system-git.patch' 20 | 'fix-atom-sh.patch' 21 | 'fix-license-path.patch' 22 | 'fix-restart.patch' 23 | 'git-utils.patch' 24 | 'no-unsafe-eval-warning.patch' 25 | 'node-env-production.patch' 26 | 'symbols-view-use-system-ctags.patch' 27 | 'use-system-apm.patch' 28 | 'use-system-electron.patch') 29 | sha256sums=('SKIP' 30 | 'a4f198ae1040637ce72c163585662d94e0d59b593f69d919d0acd7044c316cac' 31 | '530b46d31df0f5e8f5881e1608a66fe75d549092a6db2e72ba3ad69c48714153' 32 | 'b3d3706519556a59ba557b695017c9debe8b23efe2782cdb440131520bc0540d' 33 | '954a82abeb0d144891449e3db2126ee3007bea63737146a2239997c932520cbc' 34 | '5f9946b33024b429b3951629b0e3fd6deeb88895b3467a7e8e0c504b0accd9c5' 35 | 'e321fdfe880cd465918dd1dbb90e4c7d46fc5310f20666eddf0a41cbca4f8ac8' 36 | '40d783794d62f12f3c429c624a84265871c7ed95f4120c9db800348896dd5437' 37 | 'a09439c2a908ca174ff3be1f0d85071d12c792ae19748e36fe601e372d6d925b' 38 | 'c93cc88dd704388d4b26a0de0a5938df7ff90cedf8eed0b3b8a675f9cc7d487c' 39 | '08ae0c93b5ec7eb7d90c65d5d2adbaca538482fba902ed1f8414024db0d21854' 40 | 'fbd64067aa513f9b51fd33501a8310f976c18049866e636f19542c493246fd19') 41 | 42 | prepare() { 43 | cd ${pkgname} 44 | 45 | patch -Np1 -i ../fix-atom-sh.patch 46 | patch -Np1 -i ../use-system-electron.patch 47 | patch -Np1 -i ../use-system-apm.patch 48 | patch -Np1 -i ../fix-license-path.patch 49 | patch -Np1 -i ../fix-restart.patch 50 | patch -Np1 -i ../node-env-production.patch 51 | patch -Np1 -i ../no-unsafe-eval-warning.patch 52 | } 53 | 54 | build() { 55 | cd ${pkgname} 56 | 57 | ATOM_RESOURCE_PATH="${PWD}" \ 58 | npm_config_build_from_source=true \ 59 | npm_config_target=$(< /usr/lib/electron9/version) \ 60 | apm install 61 | 62 | # Use system ctags 63 | cd node_modules/symbols-view 64 | patch -Np1 -i "${srcdir}"/symbols-view-use-system-ctags.patch 65 | rm -r lib/ctags-config vendor 66 | cd ../.. 67 | 68 | # Use system git 69 | cd node_modules/dugite 70 | patch -Np1 -i "${srcdir}"/dugite-use-system-git.patch 71 | rm -r git 72 | cd ../.. 73 | 74 | # Fix issue with: 75 | # build/Release/git.node: undefined symbol: git_net_url_is_default_port 76 | cd node_modules/git-utils 77 | patch -Np1 -i "${srcdir}"/git-utils.patch 78 | env \ 79 | npm_config_disturl=https://electronjs.org/headers \ 80 | npm_config_runtime=electron \ 81 | npm_config_target=$(< /usr/lib/electron9/version) \ 82 | node-gyp rebuild 83 | cd ../.. 84 | 85 | cd script 86 | npm install 87 | # Hack to avoid using Node > 12 (https://github.com/babel/babel/issues/11216) 88 | # Set ELECTRON_VERSION (see use-system-electron.patch) 89 | env \ 90 | ELECTRON_RUN_AS_NODE=1 \ 91 | ELECTRON_VERSION=$(< /usr/lib/electron9/version) \ 92 | electron9 \ 93 | build --no-bootstrap 94 | } 95 | 96 | package() { 97 | cd ${pkgname} 98 | 99 | install -d -m 755 "${pkgdir}"/usr/lib 100 | cp -r out/app "${pkgdir}"/usr/lib/atom 101 | install -m 644 out/startup.js "${pkgdir}"/usr/lib/atom 102 | install -m 755 "${srcdir}/atom.js" "${pkgdir}"/usr/lib/atom/atom 103 | 104 | ln -sf /usr/bin/rg "${pkgdir}/usr/lib/atom/node_modules/vscode-ripgrep/bin/rg" 105 | 106 | install -d -m 755 "${pkgdir}/usr/share/applications" 107 | sed -e "s|<%= appName %>|Atom|" \ 108 | -e "s/<%= description %>/${pkgdesc}/" \ 109 | -e "s|<%= installDir %>|/usr|" \ 110 | -e "s|<%= appFileName %>|atom|" \ 111 | -e "s|<%= iconPath %>|atom|" \ 112 | resources/linux/atom.desktop.in > "${pkgdir}/usr/share/applications/atom.desktop" 113 | 114 | for size in 16 24 32 48 64 128 256 512 1024; do 115 | install -D -m 644 resources/app-icons/stable/png/${size}.png \ 116 | "${pkgdir}"/usr/share/icons/hicolor/${size}x${size}/apps/atom.png 117 | done 118 | ln -sf ../../../share/icons/hicolor/1024x1024/apps/atom.png \ 119 | "${pkgdir}"/usr/lib/atom/resources/atom.png 120 | 121 | install -D -m 755 atom.sh "${pkgdir}/usr/bin/atom" 122 | 123 | install -d -m 755 "${pkgdir}/usr/share/licenses/${pkgname}" 124 | node -e "require('./script/lib/get-license-text')().then((licenseText) => require('fs').writeFileSync('${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.md', licenseText))" 125 | 126 | # Remove useless stuff 127 | find "${pkgdir}"/usr/lib/atom/node_modules \ 128 | -name "*.a" -exec rm '{}' \; \ 129 | -or -name "*.bat" -exec rm '{}' \; \ 130 | -or -name "*.c" -exec rm '{}' \; \ 131 | -or -name "*.cpp" -exec rm '{}' \; \ 132 | -or -name "*.node" -exec chmod a-x '{}' \; \ 133 | -or -name "benchmark" -prune -exec rm -r '{}' \; \ 134 | -or -name "doc" -prune -exec rm -r '{}' \; \ 135 | -or -name "html" -prune -exec rm -r '{}' \; \ 136 | -or -name "man" -prune -exec rm -r '{}' \; \ 137 | -or -name "scripts" -prune -exec rm -r '{}' \; \ 138 | -or -path "*/less/gradle" -prune -exec rm -r '{}' \; \ 139 | -or -path "*/task-lists/src" -prune -exec rm -r '{}' \; 140 | } 141 | -------------------------------------------------------------------------------- /atom/atom.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/electron9 2 | 3 | const name = "atom"; 4 | 5 | const {app} = require("electron"); 6 | const fs = require("fs"); 7 | const Module = require("module"); 8 | const {join} = require("path"); 9 | const vm = require("vm"); 10 | 11 | // Change command name. 12 | const fd = fs.openSync("/proc/self/comm", fs.constants.O_WRONLY); 13 | fs.writeSync(fd, name); 14 | fs.closeSync(fd); 15 | 16 | // Remove first command line argument (/usr/bin/electron). 17 | process.argv.splice(0, 1); 18 | 19 | // Set application paths. 20 | const appPath = __dirname; 21 | const packageJson = require(join(appPath, "package.json")); 22 | const productName = packageJson.productName; 23 | app.setAppPath(appPath); 24 | app.setDesktopName(name + ".desktop"); 25 | app.setName(productName); 26 | app.setPath("userCache", join(app.getPath("cache"), productName)); 27 | app.setPath("userData", join(app.getPath("appData"), productName)); 28 | app.setVersion(packageJson.version); 29 | 30 | // Run the application. 31 | const startupJs = fs.readFileSync(join(appPath, "startup.js"), "utf-8"); 32 | vm.runInThisContext(startupJs); 33 | Module._load(appPath, Module, true); 34 | -------------------------------------------------------------------------------- /atom/dugite-use-system-git.patch: -------------------------------------------------------------------------------- 1 | --- a/build/lib/git-environment.js 2 | +++ b/build/lib/git-environment.js 3 | @@ -24,7 +24,7 @@ 4 | return path.resolve(process.env.LOCAL_GIT_DIRECTORY); 5 | } 6 | else { 7 | - return resolveEmbeddedGitDir(); 8 | + return '/usr'; 9 | } 10 | } 11 | /** 12 | @@ -57,7 +57,7 @@ 13 | return path.join(gitDir, 'mingw32', 'libexec', 'git-core'); 14 | } 15 | else { 16 | - return path.join(gitDir, 'libexec', 'git-core'); 17 | + return path.join(gitDir, 'lib', 'git-core'); 18 | } 19 | } 20 | /** 21 | @@ -108,9 +108,9 @@ 22 | if (!env.GIT_SSL_CAINFO && !env.LOCAL_GIT_DIRECTORY) { 23 | // use the SSL certificate bundle included in the distribution only 24 | // when using embedded Git and not providing your own bundle 25 | - const distDir = resolveEmbeddedGitDir(); 26 | - const sslCABundle = `${distDir}/ssl/cacert.pem`; 27 | - env.GIT_SSL_CAINFO = sslCABundle; 28 | + // const distDir = resolveEmbeddedGitDir(); 29 | + // const sslCABundle = `${distDir}/ssl/cacert.pem`; 30 | + // env.GIT_SSL_CAINFO = sslCABundle; 31 | } 32 | } 33 | return { env, gitLocation }; 34 | -------------------------------------------------------------------------------- /atom/fix-atom-sh.patch: -------------------------------------------------------------------------------- 1 | --- a/atom.sh 2 | +++ b/atom.sh 3 | @@ -1,29 +1,5 @@ 4 | #!/bin/bash 5 | 6 | -if [ "$(uname)" == 'Darwin' ]; then 7 | - OS='Mac' 8 | -elif [ "$(expr substr $(uname -s) 1 5)" == 'Linux' ]; then 9 | - OS='Linux' 10 | -else 11 | - echo "Your platform ($(uname -a)) is not supported." 12 | - exit 1 13 | -fi 14 | - 15 | -case $(basename $0) in 16 | - atom-beta) 17 | - CHANNEL=beta 18 | - ;; 19 | - atom-nightly) 20 | - CHANNEL=nightly 21 | - ;; 22 | - atom-dev) 23 | - CHANNEL=dev 24 | - ;; 25 | - *) 26 | - CHANNEL=stable 27 | - ;; 28 | -esac 29 | - 30 | # Only set the ATOM_DISABLE_SHELLING_OUT_FOR_ENVIRONMENT env var if it hasn't been set. 31 | if [ -z "$ATOM_DISABLE_SHELLING_OUT_FOR_ENVIRONMENT" ] 32 | then 33 | @@ -90,105 +66,24 @@ 34 | ATOM_HOME="${ATOM_HOME:-$HOME/.atom}" 35 | mkdir -p "$ATOM_HOME" 36 | 37 | -if [ $OS == 'Mac' ]; then 38 | - if [ -L "$0" ]; then 39 | - SCRIPT="$(readlink "$0")" 40 | - else 41 | - SCRIPT="$0" 42 | - fi 43 | - ATOM_APP="$(dirname "$(dirname "$(dirname "$(dirname "$SCRIPT")")")")" 44 | - if [ "$ATOM_APP" == . ]; then 45 | - unset ATOM_APP 46 | - else 47 | - ATOM_PATH="$(dirname "$ATOM_APP")" 48 | - ATOM_APP_NAME="$(basename "$ATOM_APP")" 49 | - fi 50 | +ATOM_PATH="/usr/lib/atom/atom" 51 | 52 | - if [ ! -z "${ATOM_APP_NAME}" ]; then 53 | - # If ATOM_APP_NAME is known, use it as the executable name 54 | - ATOM_EXECUTABLE_NAME="${ATOM_APP_NAME%.*}" 55 | +if [ $EXPECT_OUTPUT ]; then 56 | + "$ATOM_PATH" --executed-from="$(pwd)" --pid=$$ "$@" 57 | + ATOM_EXIT=$? 58 | + if [ ${ATOM_EXIT} -eq 0 ] && [ -n "${EXIT_CODE_OVERRIDE}" ]; then 59 | + exit "${EXIT_CODE_OVERRIDE}" 60 | else 61 | - # Else choose it from the inferred channel name 62 | - if [ "$CHANNEL" == 'beta' ]; then 63 | - ATOM_EXECUTABLE_NAME="Atom Beta" 64 | - elif [ "$CHANNEL" == 'nightly' ]; then 65 | - ATOM_EXECUTABLE_NAME="Atom Nightly" 66 | - elif [ "$CHANNEL" == 'dev' ]; then 67 | - ATOM_EXECUTABLE_NAME="Atom Dev" 68 | - else 69 | - ATOM_EXECUTABLE_NAME="Atom" 70 | - fi 71 | - fi 72 | - 73 | - if [ -z "${ATOM_PATH}" ]; then 74 | - # If ATOM_PATH isn't set, check /Applications and then ~/Applications for Atom.app 75 | - if [ -x "/Applications/$ATOM_APP_NAME" ]; then 76 | - ATOM_PATH="/Applications" 77 | - elif [ -x "$HOME/Applications/$ATOM_APP_NAME" ]; then 78 | - ATOM_PATH="$HOME/Applications" 79 | - else 80 | - # We haven't found an Atom.app, use spotlight to search for Atom 81 | - ATOM_PATH="$(mdfind "kMDItemCFBundleIdentifier == 'com.github.atom'" | grep -v ShipIt | head -1 | xargs -0 dirname)" 82 | - 83 | - # Exit if Atom can't be found 84 | - if [ ! -x "$ATOM_PATH/$ATOM_APP_NAME" ]; then 85 | - echo "Cannot locate ${ATOM_APP_NAME}, it is usually located in /Applications. Set the ATOM_PATH environment variable to the directory containing ${ATOM_APP_NAME}." 86 | - exit 1 87 | - fi 88 | - fi 89 | + exit ${ATOM_EXIT} 90 | fi 91 | - 92 | - if [ $EXPECT_OUTPUT ]; then 93 | - "$ATOM_PATH/$ATOM_APP_NAME/Contents/MacOS/$ATOM_EXECUTABLE_NAME" --executed-from="$(pwd)" --pid=$$ "$@" 94 | - ATOM_EXIT=$? 95 | - if [ ${ATOM_EXIT} -eq 0 ] && [ -n "${EXIT_CODE_OVERRIDE}" ]; then 96 | - exit "${EXIT_CODE_OVERRIDE}" 97 | - else 98 | - exit ${ATOM_EXIT} 99 | - fi 100 | - else 101 | - open -a "$ATOM_PATH/$ATOM_APP_NAME" -n --args --executed-from="$(pwd)" --pid=$$ --path-environment="$PATH" "$@" 102 | - fi 103 | -elif [ $OS == 'Linux' ]; then 104 | - SCRIPT=$(readlink -f "$0") 105 | - USR_DIRECTORY=$(readlink -f $(dirname $SCRIPT)/..) 106 | - 107 | - case $CHANNEL in 108 | - beta) 109 | - ATOM_PATH="$USR_DIRECTORY/share/atom-beta/atom" 110 | - ;; 111 | - nightly) 112 | - ATOM_PATH="$USR_DIRECTORY/share/atom-nightly/atom" 113 | - ;; 114 | - dev) 115 | - ATOM_PATH="$USR_DIRECTORY/share/atom-dev/atom" 116 | - ;; 117 | - *) 118 | - ATOM_PATH="$USR_DIRECTORY/share/atom/atom" 119 | - ;; 120 | - esac 121 | - 122 | - : ${TMPDIR:=/tmp} 123 | - 124 | - [ -x "$ATOM_PATH" ] || ATOM_PATH="$TMPDIR/atom-build/Atom/atom" 125 | - 126 | - if [ $EXPECT_OUTPUT ]; then 127 | - "$ATOM_PATH" --executed-from="$(pwd)" --pid=$$ "$@" 128 | - ATOM_EXIT=$? 129 | - if [ ${ATOM_EXIT} -eq 0 ] && [ -n "${EXIT_CODE_OVERRIDE}" ]; then 130 | - exit "${EXIT_CODE_OVERRIDE}" 131 | - else 132 | - exit ${ATOM_EXIT} 133 | - fi 134 | - else 135 | - ( 136 | - nohup "$ATOM_PATH" --executed-from="$(pwd)" --pid=$$ "$@" > "$ATOM_HOME/nohup.out" 2>&1 137 | - if [ $? -ne 0 ]; then 138 | - cat "$ATOM_HOME/nohup.out" 139 | - exit $? 140 | - fi 141 | - ) & 142 | +else 143 | + ( 144 | + nohup "$ATOM_PATH" --executed-from="$(pwd)" --pid=$$ "$@" > "$ATOM_HOME/nohup.out" 2>&1 145 | + if [ $? -ne 0 ]; then 146 | + cat "$ATOM_HOME/nohup.out" 147 | + exit $? 148 | fi 149 | + ) & 150 | fi 151 | 152 | # Exits this process when Atom is used as $EDITOR 153 | -------------------------------------------------------------------------------- /atom/fix-license-path.patch: -------------------------------------------------------------------------------- 1 | --- a/src/main-process/atom-application.js 2 | +++ b/src/main-process/atom-application.js 3 | @@ -697,7 +697,7 @@ 4 | ); 5 | this.openPathOnEvent( 6 | 'application:open-license', 7 | - path.join(process.resourcesPath, 'LICENSE.md') 8 | + '/usr/share/licenses/atom/LICENSE.md' 9 | ); 10 | 11 | this.configFile.onDidChange(settings => { 12 | --- a/src/workspace.js 13 | +++ b/src/workspace.js 14 | @@ -1301,7 +1301,7 @@ 15 | 16 | // Open Atom's license in the active pane. 17 | openLicense() { 18 | - return this.open(path.join(process.resourcesPath, 'LICENSE.md')); 19 | + return this.open('/usr/share/licenses/atom/LICENSE.md'); 20 | } 21 | 22 | // Synchronously open the given URI in the active pane. **Only use this method 23 | -------------------------------------------------------------------------------- /atom/fix-restart.patch: -------------------------------------------------------------------------------- 1 | --- a/src/main-process/atom-application.js 2 | +++ b/src/main-process/atom-application.js 3 | @@ -2044,7 +2044,7 @@ 4 | } 5 | 6 | restart() { 7 | - const args = []; 8 | + const args = ['/usr/lib/atom/atom']; 9 | if (this.safeMode) args.push('--safe'); 10 | if (this.logFile != null) args.push(`--log-file=${this.logFile}`); 11 | if (this.userDataDir != null) 12 | -------------------------------------------------------------------------------- /atom/git-utils.patch: -------------------------------------------------------------------------------- 1 | --- a/binding.gyp 2 | +++ b/binding.gyp 3 | @@ -162,6 +162,8 @@ 4 | 'deps/libgit2/src/message.h', 5 | 'deps/libgit2/src/mwindow.c', 6 | 'deps/libgit2/src/mwindow.h', 7 | + 'deps/libgit2/src/net.c', 8 | + 'deps/libgit2/src/net.h', 9 | 'deps/libgit2/src/netops.c', 10 | 'deps/libgit2/src/netops.h', 11 | 'deps/libgit2/src/notes.c', 12 | -------------------------------------------------------------------------------- /atom/no-unsafe-eval-warning.patch: -------------------------------------------------------------------------------- 1 | --- a/static/index.js 2 | +++ b/static/index.js 3 | @@ -13,6 +13,8 @@ 4 | let blobStore = null; 5 | let useSnapshot = false; 6 | 7 | + process.env.ELECTRON_DISABLE_SECURITY_WARNINGS = true; 8 | + 9 | const startupMarkers = electron.remote.getCurrentWindow().startupMarkers; 10 | 11 | if (startupMarkers) { 12 | -------------------------------------------------------------------------------- /atom/node-env-production.patch: -------------------------------------------------------------------------------- 1 | --- a/static/index.js 2 | +++ b/static/index.js 3 | @@ -85,6 +85,10 @@ 4 | ); 5 | } 6 | 7 | + if (!devMode) { 8 | + process.env.NODE_ENV = 'production'; 9 | + } 10 | + 11 | const FileSystemBlobStore = useSnapshot 12 | ? snapshotResult.customRequire('../src/file-system-blob-store.js') 13 | : require('../src/file-system-blob-store'); 14 | -------------------------------------------------------------------------------- /atom/symbols-view-use-system-ctags.patch: -------------------------------------------------------------------------------- 1 | --- a/lib/tag-generator.js 2 | +++ b/lib/tag-generator.js 3 | @@ -79,9 +79,8 @@ 4 | generate() { 5 | let tags = {}; 6 | const packageRoot = this.getPackageRoot(); 7 | - const command = path.join(packageRoot, 'vendor', `ctags-${process.platform}`); 8 | - const defaultCtagsFile = path.join(packageRoot, 'lib', 'ctags-config'); 9 | - const args = [`--options=${defaultCtagsFile}`, '--fields=+KS']; 10 | + const command = 'ctags'; 11 | + const args = ['--fields=+KS']; 12 | 13 | if (atom.config.get('symbols-view.useEditorGrammarAsCtagsLanguage')) { 14 | const language = this.getLanguage(); 15 | -------------------------------------------------------------------------------- /atom/use-system-apm.patch: -------------------------------------------------------------------------------- 1 | --- a/script/lib/run-apm-install.js 2 | +++ b/script/lib/run-apm-install.js 3 | @@ -9,7 +9,7 @@ 4 | // Set resource path so that apm can load metadata related to Atom. 5 | installEnv.ATOM_RESOURCE_PATH = CONFIG.repositoryRootPath; 6 | 7 | - childProcess.execFileSync(CONFIG.getApmBinPath(), [ci ? 'ci' : 'install'], { 8 | + childProcess.execFileSync('apm', [ci ? 'ci' : 'install'], { 9 | env: installEnv, 10 | cwd: packagePath, 11 | stdio: stdioOptions || 'inherit' 12 | --- a/src/package-manager.js 13 | +++ b/src/package-manager.js 14 | @@ -194,19 +194,7 @@ 15 | return configPath || this.apmPath; 16 | } 17 | 18 | - const commandName = process.platform === 'win32' ? 'apm.cmd' : 'apm'; 19 | - const apmRoot = path.join(process.resourcesPath, 'app', 'apm'); 20 | - this.apmPath = path.join(apmRoot, 'bin', commandName); 21 | - if (!fs.isFileSync(this.apmPath)) { 22 | - this.apmPath = path.join( 23 | - apmRoot, 24 | - 'node_modules', 25 | - 'atom-package-manager', 26 | - 'bin', 27 | - commandName 28 | - ); 29 | - } 30 | - return this.apmPath; 31 | + return '/usr/lib/node_modules/atom-package-manager/bin/apm'; 32 | } 33 | 34 | // Public: Get the paths being used to look for packages. 35 | -------------------------------------------------------------------------------- /atom/use-system-electron.patch: -------------------------------------------------------------------------------- 1 | --- a/package.json 2 | +++ b/package.json 3 | @@ -12,7 +12,6 @@ 4 | "url": "https://github.com/atom/atom/issues" 5 | }, 6 | "license": "MIT", 7 | - "electronVersion": "9.4.4", 8 | "dependencies": { 9 | "@atom/fuzzy-native": "^1.2.0", 10 | "@atom/nsfw": "^1.0.27", 11 | --- a/script/build 12 | +++ b/script/build 13 | @@ -33,7 +33,7 @@ 14 | .wrap(yargs.terminalWidth()) 15 | .argv 16 | 17 | -const checkChromedriverVersion = require('./lib/check-chromedriver-version') 18 | +// const checkChromedriverVersion = require('./lib/check-chromedriver-version') 19 | const cleanOutputDirectory = require('./lib/clean-output-directory') 20 | const codeSignOnMac = require('./lib/code-sign-on-mac') 21 | const codeSignOnWindows = require('./lib/code-sign-on-windows') 22 | @@ -66,12 +66,12 @@ 23 | const CONFIG = require('./config') 24 | 25 | // Used by the 'github' package for Babel configuration 26 | -process.env.ELECTRON_VERSION = CONFIG.appMetadata.electronVersion 27 | +// process.env.ELECTRON_VERSION = CONFIG.appMetadata.electronVersion 28 | 29 | let binariesPromise = Promise.resolve() 30 | 31 | if (!argv.existingBinaries) { 32 | - checkChromedriverVersion() 33 | + // checkChromedriverVersion() 34 | cleanOutputDirectory() 35 | copyAssets() 36 | transpilePackagesWithCustomTranspilerPaths() 37 | @@ -90,74 +90,5 @@ 38 | 39 | if (!argv.generateApiDocs) { 40 | binariesPromise 41 | - .then(packageApplication) 42 | .then(packagedAppPath => generateStartupSnapshot(packagedAppPath).then(() => packagedAppPath)) 43 | - .then(async packagedAppPath => { 44 | - switch (process.platform) { 45 | - case 'darwin': { 46 | - if (argv.codeSign) { 47 | - await codeSignOnMac(packagedAppPath) 48 | - await notarizeOnMac(packagedAppPath) 49 | - } else if (argv.testSign) { 50 | - testSignOnMac(packagedAppPath) 51 | - } else { 52 | - console.log('Skipping code-signing. Specify the --code-sign option to perform code-signing'.gray) 53 | - } 54 | - break 55 | - } 56 | - case 'win32': { 57 | - if (argv.testSign) { 58 | - console.log('Test signing is not supported on Windows, skipping.'.gray) 59 | - } 60 | - 61 | - if (argv.codeSign) { 62 | - const executablesToSign = [ path.join(packagedAppPath, CONFIG.executableName) ] 63 | - if (argv.createWindowsInstaller) { 64 | - executablesToSign.push(path.join(__dirname, 'node_modules', '@atom', 'electron-winstaller', 'vendor', 'Squirrel.exe')) 65 | - } 66 | - codeSignOnWindows(executablesToSign) 67 | - } else { 68 | - console.log('Skipping code-signing. Specify the --code-sign option to perform code-signing'.gray) 69 | - } 70 | - if (argv.createWindowsInstaller) { 71 | - return createWindowsInstaller(packagedAppPath) 72 | - .then((installerPath) => { 73 | - argv.codeSign && codeSignOnWindows([installerPath]) 74 | - return packagedAppPath 75 | - }) 76 | - } else { 77 | - console.log('Skipping creating installer. Specify the --create-windows-installer option to create a Squirrel-based Windows installer.'.gray) 78 | - } 79 | - break 80 | - } 81 | - case 'linux': { 82 | - if (argv.createDebianPackage) { 83 | - createDebianPackage(packagedAppPath) 84 | - } else { 85 | - console.log('Skipping creating debian package. Specify the --create-debian-package option to create it.'.gray) 86 | - } 87 | - 88 | - if (argv.createRpmPackage) { 89 | - createRpmPackage(packagedAppPath) 90 | - } else { 91 | - console.log('Skipping creating rpm package. Specify the --create-rpm-package option to create it.'.gray) 92 | - } 93 | - break 94 | - } 95 | - } 96 | - 97 | - return Promise.resolve(packagedAppPath) 98 | - }).then(packagedAppPath => { 99 | - if (argv.compressArtifacts) { 100 | - compressArtifacts(packagedAppPath) 101 | - } else { 102 | - console.log('Skipping artifacts compression. Specify the --compress-artifacts option to compress Atom binaries (and symbols on macOS)'.gray) 103 | - } 104 | - 105 | - if (argv.install != null) { 106 | - installApplication(packagedAppPath, argv.install) 107 | - } else { 108 | - console.log('Skipping installation. Specify the --install option to install Atom'.gray) 109 | - } 110 | - }) 111 | } 112 | --- a/script/lib/generate-startup-snapshot.js 113 | +++ b/script/lib/generate-startup-snapshot.js 114 | @@ -288,17 +288,14 @@ 115 | CONFIG.executableName 116 | ); 117 | } else { 118 | - nodeBundledInElectronPath = path.join( 119 | - packagedAppPath, 120 | - CONFIG.executableName 121 | - ); 122 | + nodeBundledInElectronPath = 'electron9'; 123 | } 124 | childProcess.execFileSync( 125 | nodeBundledInElectronPath, 126 | [verifySnapshotScriptPath, snapshotScriptPath], 127 | { env: Object.assign({}, process.env, { ELECTRON_RUN_AS_NODE: 1 }) } 128 | ); 129 | - 130 | + /* 131 | console.log('Generating startup blob with mksnapshot'); 132 | childProcess.spawnSync(process.execPath, [ 133 | path.join( 134 | @@ -340,5 +337,6 @@ 135 | destinationPath 136 | ); 137 | } 138 | + */ 139 | }); 140 | }; 141 | --- a/script/package.json 142 | +++ b/script/package.json 143 | @@ -12,9 +12,7 @@ 144 | "coffeelint": "1.15.7", 145 | "colors": "1.1.2", 146 | "donna": "1.0.16", 147 | - "electron-chromedriver": "^9.0.0", 148 | "electron-link": "^0.6.0", 149 | - "electron-mksnapshot": "^9.0.2", 150 | "electron-packager": "^15.0.0", 151 | "eslint": "^5.16.0", 152 | "eslint-config-prettier": "^4.2.0", 153 | --- a/src/compile-cache.js 154 | +++ b/src/compile-cache.js 155 | @@ -135,7 +135,7 @@ exports.install = function(resourcesPath, nodeRequire) { 156 | return { 157 | column, 158 | line: row, 159 | - source: path.join(resourcesPath, 'app', 'static', relativePath), 160 | + source: path.join(resourcesPath, 'static', relativePath), 161 | name: null 162 | }; 163 | } 164 | --- a/src/module-cache.js 165 | +++ b/src/module-cache.js 166 | @@ -270,7 +270,7 @@ 167 | function registerBuiltins(devMode) { 168 | if ( 169 | devMode || 170 | - !cache.resourcePath.startsWith(`${process.resourcesPath}${path.sep}`) 171 | + !cache.resourcePath.startsWith('/usr/lib/atom/') 172 | ) { 173 | const fs = require('fs-plus'); 174 | const atomJsPath = path.join(cache.resourcePath, 'exports', 'atom.js'); 175 | --- a/src/package-manager.js 176 | +++ b/src/package-manager.js 177 | @@ -949,7 +949,7 @@ 178 | isBundledPackagePath(packagePath) { 179 | if ( 180 | this.devMode && 181 | - !this.resourcePath.startsWith(`${process.resourcesPath}${path.sep}`) 182 | + !this.resourcePath.startsWith('/usr/lib/atom/') 183 | ) { 184 | return false; 185 | } 186 | --- a/src/task-bootstrap.js 187 | +++ b/src/task-bootstrap.js 188 | @@ -3,7 +3,7 @@ 189 | 190 | const CompileCache = require('./compile-cache'); 191 | CompileCache.setCacheDirectory(compileCachePath); 192 | -CompileCache.install(`${process.resourcesPath}`, require); 193 | +CompileCache.install('/usr/lib/atom', require); 194 | 195 | const setupGlobals = function() { 196 | global.attachEvent = function() {}; 197 | --- a/static/index.js 198 | +++ b/static/index.js 199 | @@ -40,7 +40,7 @@ 200 | const devMode = 201 | getWindowLoadSettings().devMode || 202 | !getWindowLoadSettings().resourcePath.startsWith( 203 | - process.resourcesPath + path.sep 204 | + '/usr/lib/atom' 205 | ); 206 | useSnapshot = !devMode && typeof snapshotResult !== 'undefined'; 207 | 208 | @@ -134,7 +134,7 @@ 209 | ? snapshotResult.customRequire('../src/compile-cache.js') 210 | : require('../src/compile-cache'); 211 | CompileCache.setAtomHomeDirectory(process.env.ATOM_HOME); 212 | - CompileCache.install(process.resourcesPath, require); 213 | + CompileCache.install('/usr/lib/atom', require); 214 | 215 | const ModuleCache = useSnapshot 216 | ? snapshotResult.customRequire('../src/module-cache.js') 217 | -------------------------------------------------------------------------------- /electron/.gitignore: -------------------------------------------------------------------------------- 1 | boto/ 2 | breakpad/ 3 | brightray/ 4 | crashpad/ 5 | electron/ 6 | google-breakpad/ 7 | gyp/ 8 | libchromiumcontent/ 9 | native_mate/ 10 | node/ 11 | requests/ 12 | chromium-*.tar.xz 13 | -------------------------------------------------------------------------------- /electron/PKGBUILD: -------------------------------------------------------------------------------- 1 | # Maintainer: Nicola Squartini 2 | 3 | _use_suffix=0 4 | pkgver=18.2.4 5 | _commit=f4ba63536a3558f814a81015ecbfaf3451be5694 6 | _chromiumver=100.0.4896.160 7 | _gcc_patchset=4 8 | # shellcheck disable=SC2034 9 | pkgrel=1 10 | 11 | _major_ver=${pkgver%%.*} 12 | if [[ ${_use_suffix} != 0 ]]; then 13 | pkgname="electron${_major_ver}" 14 | else 15 | pkgname=electron 16 | fi 17 | # shellcheck disable=SC2034 18 | pkgdesc='Build cross platform desktop apps with web technologies' 19 | # shellcheck disable=SC2034 20 | arch=('x86_64') 21 | # shellcheck disable=SC2034 22 | url='https://electronjs.org/' 23 | # shellcheck disable=SC2034 24 | license=('MIT' 'custom') 25 | # shellcheck disable=SC2034 26 | depends=('c-ares' 'ffmpeg' 'gtk3' 'libevent' 'libxslt' 'minizip' 'nss' 're2' 27 | 'snappy') 28 | # shellcheck disable=SC2034 29 | makedepends=('clang' 'git' 'gn' 'gperf' 'harfbuzz-icu' 'http-parser' 30 | 'java-runtime-headless' 'jsoncpp' 'libnotify' 'lld' 'llvm' 'ninja' 31 | 'npm' 'pciutils' 'pipewire' 'python' 'python-httplib2' 32 | 'python-pyparsing' 'python-six' 'wget' 'yarn') 33 | # shellcheck disable=SC2034 34 | optdepends=('kde-cli-tools: file deletion support (kioclient5)' 35 | 'libappindicator-gtk3: StatusNotifierItem support' 36 | 'pipewire: WebRTC desktop sharing under Wayland' 37 | 'trash-cli: file deletion support (trash-put)' 38 | "xdg-utils: open URLs with desktop's default (xdg-email, xdg-open)") 39 | if [[ ${_use_suffix} == 0 ]]; then 40 | # shellcheck disable=SC2034 41 | conflicts=("electron${_major_ver}") 42 | # shellcheck disable=SC2034 43 | provides=("electron${_major_ver}") 44 | fi 45 | # shellcheck disable=SC2034 46 | options=('!lto') # Electron adds its own flags for ThinLTO 47 | # shellcheck disable=SC2034 48 | source=('git+https://github.com/electron/electron.git' 49 | 'git+https://chromium.googlesource.com/chromium/tools/depot_tools.git#branch=main' 50 | "https://github.com/stha09/chromium-patches/releases/download/chromium-${_chromiumver%%.*}-patchset-${_gcc_patchset}/chromium-${_chromiumver%%.*}-patchset-${_gcc_patchset}.tar.xz" 51 | "electron-launcher.sh" 52 | "electron.desktop" 53 | 'default_app-icon.patch' 54 | 'jinja-python-3.10.patch' 55 | 'std-vector-non-const.patch' 56 | 'use-system-libraries-in-node.patch' 57 | 'webcodecs-stop-using-AudioOpusEncoder.patch' 58 | 'webrtc-check-existence-of-cursor-metadata.patch' 59 | 'fix-no-member-named-tie-in-namespace-std.patch' 60 | 'iwyu-add-utility-for-std-exchange.patch' 61 | 'iwyu-add-vector-needed-by-statsentry.patch' 62 | 'enable-GlobalMediaControlsCastStartStop.patch' 63 | 'sql-make-VirtualCursor-standard-layout-type.patch' 64 | ) 65 | # shellcheck disable=SC2034 66 | sha256sums=('SKIP' 67 | 'SKIP' 68 | 'a6120e7d4eb5e131b87b6ab3b922e0c6cd78e15501e54cfb2019875173688d80' 69 | '3953f532a3ea5fce19ee33600c6ead89dcd066df6a01d3c3ab4c24f96e46fca2' 70 | '4484200d90b76830b69eea3a471c103999a3ce86bb2c29e6c14c945bf4102bae' 71 | 'dd2d248831dd4944d385ebf008426e66efe61d6fdf66f8932c963a12167947b4' 72 | '55dbe71dbc1f3ab60bf1fa79f7aea7ef1fe76436b1d7df48728a1f8227d2134e' 73 | '880abb38ea94058ad553eaec9989cb33aa3b10c54b44afcfddacef3e975152de' 74 | 'c70652a8b24c237bcfd27469de32797a2cb46d9f0d63d897bb6418314a25644c' 75 | '064daaa2b9d95b96ec04d8ddebf4af441f92263d123365b58fe73966866080af' 76 | '88b2c8d9c6c1917f6632453f18aad7a3fd94d605eecb6c77ae2394ac5856ba95' 77 | '7ad0106161bbf25e2e603ae1a723ae4217155ebb26eb4778363ad396e8c14156' 78 | '6f666ef0acb08704ca58cc0d5e97e7ce64d8fea51042e593adae1ce15a61231c' 79 | '0ec88c8022c946ac333cbc1060d6b9cacbef6c4a86fe8763d23add6939a3c490' 80 | '779fb13f2494209d3a7f1f23a823e59b9dded601866d3ab095937a1a04e19ac6' 81 | 'b94b2e88f63cfb7087486508b8139599c89f96d7a4181c61fec4b4e250ca327a' 82 | ) 83 | 84 | _system_libs=('ffmpeg' 85 | 'flac' 86 | 'fontconfig' 87 | 'freetype' 88 | 'harfbuzz-ng' 89 | 'icu' 90 | 'libdrm' 91 | 'libevent' 92 | 'libjpeg' 93 | 'libpng' 94 | # 'libvpx' 95 | 'libwebp' 96 | 'libxml' 97 | 'libxslt' 98 | # 'openh264' 99 | 'opus' 100 | 're2' 101 | 'snappy' 102 | 'zlib' 103 | ) 104 | 105 | prepare() { 106 | sed -i "s|@ELECTRON@|${pkgname}|" electron-launcher.sh 107 | sed -i "s|@ELECTRON@|${pkgname}|" electron.desktop 108 | if [[ ${_use_suffix} != 0 ]]; then 109 | sed -i "s|@ELECTRON_NAME@|Electron ${_major_ver}|" electron.desktop 110 | else 111 | sed -i "s|@ELECTRON_NAME@|Electron|" electron.desktop 112 | fi 113 | 114 | export PATH="${PATH}:${srcdir:?}/depot_tools" 115 | 116 | echo "Fetching chromium..." 117 | git clone --branch=${_chromiumver} --depth=1 \ 118 | https://chromium.googlesource.com/chromium/src.git 119 | 120 | echo "solutions = [ 121 | { 122 | \"name\": \"src/electron\", 123 | \"url\": \"file://${srcdir}/electron@${_commit}\", 124 | \"deps_file\": \"DEPS\", 125 | \"managed\": False, 126 | \"custom_deps\": { 127 | \"src\": None, 128 | }, 129 | \"custom_vars\": {}, 130 | }, 131 | ]" > .gclient 132 | 133 | python "${srcdir}/depot_tools/gclient.py" sync \ 134 | --with_branch_heads \ 135 | --with_tags \ 136 | --nohooks 137 | 138 | ( 139 | cd src/electron || exit 140 | patch -Np1 -i ../../std-vector-non-const.patch 141 | ) 142 | 143 | echo "Running hooks..." 144 | # python "${srcdir}/depot_tools/gclient.py" runhooks 145 | src/build/landmines.py 146 | src/build/util/lastchange.py -o src/build/util/LASTCHANGE 147 | src/build/util/lastchange.py -m GPU_LISTS_VERSION \ 148 | --revision-id-only --header src/gpu/config/gpu_lists_version.h 149 | src/build/util/lastchange.py -m SKIA_COMMIT_HASH \ 150 | -s src/third_party/skia --header src/skia/ext/skia_commit_hash.h 151 | # Create sysmlink to system clang-format 152 | ln -s /usr/bin/clang-format src/buildtools/linux64 153 | # Create sysmlink to system Node.js 154 | mkdir -p src/third_party/node/linux/node-linux-x64/bin 155 | ln -sf /usr/bin/node src/third_party/node/linux/node-linux-x64/bin 156 | src/third_party/depot_tools/download_from_google_storage.py \ 157 | --no_resume --extract --no_auth --bucket chromium-nodejs \ 158 | -s src/third_party/node/node_modules.tar.gz.sha1 159 | python src/tools/download_optimization_profile.py \ 160 | --newest_state=src/chrome/android/profiles/newest.txt \ 161 | --local_state=src/chrome/android/profiles/local.txt \ 162 | --output_name=src/chrome/android/profiles/afdo.prof \ 163 | --gs_url_base=chromeos-prebuilt/afdo-job/llvm 164 | #vpython src/tools/update_pgo_profiles.py \ 165 | # --target=linux \ 166 | # update \ 167 | # --gs-url-base=chromium-optimization-profiles/pgo_profiles 168 | src/electron/script/apply_all_patches.py \ 169 | src/electron/patches/config.json 170 | cd src/electron || exit 171 | yarn install --frozen-lockfile 172 | cd .. 173 | 174 | echo "Applying local patches..." 175 | # Upstream fixes 176 | patch -Np1 -i ../webcodecs-stop-using-AudioOpusEncoder.patch 177 | patch -Np1 -d third_party/webrtc <../webrtc-check-existence-of-cursor-metadata.patch 178 | 179 | # Upstream fixes 180 | patch -Np1 -i ../fix-no-member-named-tie-in-namespace-std.patch 181 | patch -Np1 -i ../iwyu-add-utility-for-std-exchange.patch 182 | patch -Np1 -i ../iwyu-add-vector-needed-by-statsentry.patch 183 | 184 | # Revert kGlobalMediaControlsCastStartStop enabled by default 185 | # https://crbug.com/1314342 186 | patch -Rp1 -F3 -i ../enable-GlobalMediaControlsCastStartStop.patch 187 | 188 | # https://chromium-review.googlesource.com/c/chromium/src/+/2862724 189 | patch -Np1 -i ../sql-make-VirtualCursor-standard-layout-type.patch 190 | 191 | # Fixes for building with libstdc++ instead of libc++ 192 | #patch -Np1 -i ../patches/ 193 | 194 | # Electron specific fixes 195 | patch -d third_party/electron_node/tools/inspector_protocol/jinja2 \ 196 | -Np1 -i ../../../../../../jinja-python-3.10.patch 197 | patch -Np1 -i ../use-system-libraries-in-node.patch 198 | patch -Np1 -i ../default_app-icon.patch # Icon from .desktop file 199 | 200 | echo "Patching Chromium for using system libraries..." 201 | sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \ 202 | tools/generate_shim_headers/generate_shim_headers.py 203 | for lib in $(printf "%s\n" "${_system_libs[@]}" | sed 's/^libjpeg$/&_turbo/'); do 204 | third_party_dir="third_party/${lib}" 205 | if [ ! -d "${third_party_dir}" ]; then 206 | third_party_dir="base/${third_party_dir}" 207 | fi 208 | find "${third_party_dir}" -type f \ 209 | \! -path "${third_party_dir}/chromium/*" \ 210 | \! -path "${third_party_dir}/google/*" \ 211 | \! -path 'third_party/harfbuzz-ng/utils/hb_scoped.h' \ 212 | \! -regex '.*\.\(gn\|gni\|isolate\)' \ 213 | -delete 214 | done 215 | build/linux/unbundle/replace_gn_files.py \ 216 | --system-libraries \ 217 | "${_system_libs[@]}" 218 | } 219 | 220 | build() { 221 | export CC=clang 222 | export CXX=clang++ 223 | export AR=ar 224 | export NM=nm 225 | 226 | CFLAGS="${CFLAGS/-fexceptions/}" 227 | CXXFLAGS="${CXXFLAGS/-fexceptions/}" 228 | 229 | # This appears to cause random segfaults when combined with ThinLTO 230 | # https://bugs.archlinux.org/task/73518 231 | CFLAGS=${CFLAGS/-fstack-clash-protection} 232 | CXXFLAGS=${CXXFLAGS/-fstack-clash-protection} 233 | 234 | # https://crbug.com/957519#c122 235 | CXXFLAGS=${CXXFLAGS/-Wp,-D_GLIBCXX_ASSERTIONS} 236 | 237 | # Do not warn about unknown warning options 238 | CFLAGS+=' -Wno-unknown-warning-option' 239 | CXXFLAGS+=' -Wno-unknown-warning-option' 240 | 241 | cd src || exit 242 | export CHROMIUM_BUILDTOOLS_PATH="${PWD}/buildtools" 243 | GN_EXTRA_ARGS=' 244 | blink_symbol_level = 0 245 | chrome_pgo_phase = 0 246 | clang_use_chrome_plugins = false 247 | custom_toolchain = "//build/toolchain/linux/unbundle:default" 248 | host_toolchain = "//build/toolchain/linux/unbundle:default" 249 | icu_use_data_file = false 250 | is_component_ffmpeg = false 251 | link_pulseaudio = true 252 | rtc_use_pipewire = true 253 | treat_warnings_as_errors = false 254 | use_custom_libcxx = false 255 | use_gnome_keyring = false 256 | use_sysroot = false 257 | ' 258 | gn gen out/Release \ 259 | --args="import(\"//electron/build/args/release.gn\") ${GN_EXTRA_ARGS}" 260 | ninja -C out/Release electron 261 | # Strip before zip to avoid 262 | # zipfile.LargeZipFile: Filesize would require ZIP64 extensions 263 | strip -s out/Release/electron 264 | ninja -C out/Release electron_dist_zip 265 | # ninja -C out/Release third_party/electron_node:headers 266 | } 267 | 268 | package() { 269 | install -dm755 "${pkgdir:?}/usr/lib/${pkgname}" 270 | bsdtar -xf src/out/Release/dist.zip -C "${pkgdir}/usr/lib/${pkgname}" 271 | 272 | chmod u+s "${pkgdir}/usr/lib/${pkgname}/chrome-sandbox" 273 | 274 | install -dm755 "${pkgdir}/usr/share/licenses/${pkgname}" 275 | for l in "${pkgdir}/usr/lib/${pkgname}"/{LICENSE,LICENSES.chromium.html}; do 276 | ln -s \ 277 | "$(realpath --relative-to="${pkgdir}/usr/share/licenses/${pkgname}" "${l}")" \ 278 | "${pkgdir}/usr/share/licenses/${pkgname}" 279 | done 280 | 281 | install -Dm755 "${srcdir}/electron-launcher.sh" \ 282 | "${pkgdir}/usr/bin/${pkgname}" 283 | if [[ "${_use_suffix}" == 0 ]]; then 284 | ln "${pkgdir}/usr/bin/${pkgname}" \ 285 | "${pkgdir}/usr/bin/${pkgname}${_major_ver}" 286 | fi 287 | 288 | # Install .desktop and icon file (see default_app-icon.patch) 289 | install -Dm644 electron.desktop \ 290 | "${pkgdir}/usr/share/applications/${pkgname}.desktop" 291 | install -Dm644 src/electron/default_app/icon.png \ 292 | "${pkgdir}/usr/share/pixmaps/${pkgname}.png" # hicolor has no 1024x1024 293 | } 294 | -------------------------------------------------------------------------------- /electron/default_app-icon.patch: -------------------------------------------------------------------------------- 1 | --- a/electron/default_app/default_app.ts 2 | +++ b/electron/default_app/default_app.ts 3 | @@ -60,7 +60,7 @@ 4 | }; 5 | 6 | if (process.platform === 'linux') { 7 | - options.icon = path.join(__dirname, 'icon.png'); 8 | + options.icon = '/usr/share/pixmaps/electron.png'; 9 | } 10 | 11 | mainWindow = new BrowserWindow(options); 12 | --- a/electron/filenames.gni 13 | +++ b/electron/filenames.gni 14 | @@ -6,7 +6,6 @@ 15 | ] 16 | 17 | default_app_static_sources = [ 18 | - "default_app/icon.png", 19 | "default_app/index.html", 20 | "default_app/package.json", 21 | "default_app/styles.css", 22 | -------------------------------------------------------------------------------- /electron/electron-launcher.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | 3 | set -euo pipefail 4 | 5 | name=@ELECTRON@ 6 | flags_file="${XDG_CONFIG_HOME:-$HOME/.config}/${name}-flags.conf" 7 | 8 | declare -a flags 9 | 10 | if [[ -f "${flags_file}" ]]; then 11 | mapfile -t < "${flags_file}" 12 | fi 13 | 14 | for line in "${MAPFILE[@]}"; do 15 | if [[ ! "${line}" =~ ^[[:space:]]*#.* ]]; then 16 | flags+=("${line}") 17 | fi 18 | done 19 | 20 | exec /usr/lib/${name}/electron "$@" "${flags[@]}" 21 | -------------------------------------------------------------------------------- /electron/electron.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=Application 3 | Name=@ELECTRON_NAME@ 4 | Icon=@ELECTRON@ 5 | Exec=@ELECTRON@ %u 6 | Categories=Development;GTK; 7 | StartupNotify=true 8 | -------------------------------------------------------------------------------- /electron/enable-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 f28f9b0b802..a8d544f7d6d 100644 22 | --- a/chrome/browser/media/router/media_router_feature.cc 23 | +++ b/chrome/browser/media/router/media_router_feature.cc 24 | @@ -33,7 +33,7 @@ const base::Feature kMediaRouter{"MediaRouter", 25 | const base::Feature kCastAllowAllIPsFeature{"CastAllowAllIPs", 26 | base::FEATURE_DISABLED_BY_DEFAULT}; 27 | const base::Feature kGlobalMediaControlsCastStartStop{ 28 | - "GlobalMediaControlsCastStartStop", base::FEATURE_DISABLED_BY_DEFAULT}; 29 | + "GlobalMediaControlsCastStartStop", base::FEATURE_ENABLED_BY_DEFAULT}; 30 | const base::Feature kAllowAllSitesToInitiateMirroring{ 31 | "AllowAllSitesToInitiateMirroring", base::FEATURE_DISABLED_BY_DEFAULT}; 32 | const base::Feature kDialMediaRouteProvider{"DialMediaRouteProvider", 33 | -------------------------------------------------------------------------------- /electron/fix-no-member-named-tie-in-namespace-std.patch: -------------------------------------------------------------------------------- 1 | From 68c9c63c0b148ff5246a0cdad59000697bbd8645 Mon Sep 17 00:00:00 2001 2 | From: Maksim Sisov 3 | Date: Tue, 12 Apr 2022 15:11:34 +0000 4 | Subject: [PATCH] Fix no member named 'tie' in namespace 'std' 5 | 6 | Bug: None 7 | Change-Id: I8a097af2b16b738fa9bbb8231536bca85522f350 8 | Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3581869 9 | Auto-Submit: Maksim Sisov 10 | Reviewed-by: Matt Menke 11 | Commit-Queue: Matt Menke 12 | Cr-Commit-Position: refs/heads/main@{#991529} 13 | --- 14 | net/base/address_list.h | 1 + 15 | 1 file changed, 1 insertion(+) 16 | 17 | diff --git a/net/base/address_list.h b/net/base/address_list.h 18 | index 029af1aded3..a93093e41f3 100644 19 | --- a/net/base/address_list.h 20 | +++ b/net/base/address_list.h 21 | @@ -8,6 +8,7 @@ 22 | #include 23 | 24 | #include 25 | +#include 26 | #include 27 | #include 28 | 29 | -------------------------------------------------------------------------------- /electron/iwyu-add-utility-for-std-exchange.patch: -------------------------------------------------------------------------------- 1 | From 9dd0503835dc875807ab63efb1f477bffed2a852 Mon Sep 17 00:00:00 2001 2 | From: Stephan Hartmann 3 | Date: Mon, 25 Apr 2022 23:18:30 +0000 4 | Subject: [PATCH] IWYU: add utility for std::exchange 5 | 6 | Bug: 957519 7 | Change-Id: I307d520fdc34d2452018ed32a505e7e519739410 8 | Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3604643 9 | Reviewed-by: Wez 10 | Commit-Queue: Stephan Hartmann 11 | Cr-Commit-Position: refs/heads/main@{#995855} 12 | --- 13 | base/third_party/symbolize/symbolize.h | 1 + 14 | 1 file changed, 1 insertion(+) 15 | 16 | diff --git a/base/third_party/symbolize/symbolize.h b/base/third_party/symbolize/symbolize.h 17 | index 99029a968d5..278078f6071 100644 18 | --- a/base/third_party/symbolize/symbolize.h 19 | +++ b/base/third_party/symbolize/symbolize.h 20 | @@ -61,6 +61,7 @@ 21 | #ifdef HAVE_SYMBOLIZE 22 | 23 | #include 24 | +#include 25 | 26 | #if defined(__ELF__) // defined by gcc 27 | #if defined(__OpenBSD__) 28 | -------------------------------------------------------------------------------- /electron/iwyu-add-vector-needed-by-statsentry.patch: -------------------------------------------------------------------------------- 1 | From 72b521be7640a1b06adf6881b12277276ab8609d Mon Sep 17 00:00:00 2001 2 | From: Piotr Tworek 3 | Date: Wed, 06 Apr 2022 19:34:29 +0000 4 | Subject: [PATCH] IWYU: Add vector needed by StatsEntry. 5 | 6 | This builds fine with libc++, but fails due to std::vector being 7 | undefined when using libstdc++. Add missing vector include to fix this. 8 | 9 | Bug: 957519 10 | Change-Id: I12f91636fe9c69046ae36528e48782acf741b66c 11 | Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3557455 12 | Auto-Submit: Piotr Tworek 13 | Reviewed-by: Chrome Cunningham 14 | Commit-Queue: Chrome Cunningham 15 | Cr-Commit-Position: refs/heads/main@{#989578} 16 | --- 17 | 18 | diff --git a/media/capabilities/webrtc_video_stats_db.h b/media/capabilities/webrtc_video_stats_db.h 19 | index 8a5c0cf..0e8653b 100644 20 | --- a/media/capabilities/webrtc_video_stats_db.h 21 | +++ b/media/capabilities/webrtc_video_stats_db.h 22 | @@ -7,6 +7,7 @@ 23 | 24 | #include 25 | #include 26 | +#include 27 | 28 | #include "base/callback_forward.h" 29 | #include "base/check.h" 30 | -------------------------------------------------------------------------------- /electron/jinja-python-3.10.patch: -------------------------------------------------------------------------------- 1 | --- a/runtime.py 2 | +++ b/runtime.py 3 | @@ -315,7 +315,7 @@ class Context(with_metaclass(ContextMeta 4 | 5 | # register the context as mapping if possible 6 | try: 7 | - from collections import Mapping 8 | + from collections.abc import Mapping 9 | Mapping.register(Context) 10 | except ImportError: 11 | pass 12 | --- a/sandbox.py 13 | +++ b/sandbox.py 14 | @@ -14,7 +14,7 @@ 15 | """ 16 | import types 17 | import operator 18 | -from collections import Mapping 19 | +from collections.abc import Mapping 20 | from jinja2.environment import Environment 21 | from jinja2.exceptions import SecurityError 22 | from jinja2._compat import string_types, PY2 23 | -------------------------------------------------------------------------------- /electron/sql-make-VirtualCursor-standard-layout-type.patch: -------------------------------------------------------------------------------- 1 | From 144479ad7b4287bee4067f95e4218f614798a865 Mon Sep 17 00:00:00 2001 2 | From: Stephan Hartmann 3 | Date: Sun, 16 Jan 2022 19:15:26 +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. 10 | 11 | Bug: 1189788 12 | Change-Id: Ia6dc388cc5ef1c0f2afc75f8ca45b9f12687ca9c 13 | --- 14 | sql/recover_module/btree.cc | 18 ++++++++++++------ 15 | sql/recover_module/btree.h | 21 +++++++++++++++------ 16 | sql/recover_module/cursor.cc | 24 ++++++++++++------------ 17 | sql/recover_module/cursor.h | 2 +- 18 | sql/recover_module/pager.cc | 5 ++--- 19 | sql/recover_module/pager.h | 6 +++--- 20 | 6 files changed, 45 insertions(+), 31 deletions(-) 21 | 22 | diff --git a/sql/recover_module/btree.cc b/sql/recover_module/btree.cc 23 | index cc9420e5c05..f12d8fa32a2 100644 24 | --- a/sql/recover_module/btree.cc 25 | +++ b/sql/recover_module/btree.cc 26 | @@ -136,16 +136,22 @@ static_assert(std::is_trivially_destructible::value, 27 | "Move the destructor to the .cc file if it's non-trival"); 28 | #endif // !DCHECK_IS_ON() 29 | 30 | -LeafPageDecoder::LeafPageDecoder(DatabasePageReader* db_reader) noexcept 31 | - : page_id_(db_reader->page_id()), 32 | - db_reader_(db_reader), 33 | - cell_count_(ComputeCellCount(db_reader)), 34 | - next_read_index_(0), 35 | - last_record_size_(0) { 36 | +LeafPageDecoder::LeafPageDecoder() noexcept = default; 37 | + 38 | +void LeafPageDecoder::Initialize(DatabasePageReader* db_reader) { 39 | + page_id_ = db_reader->page_id(); 40 | + db_reader_ = db_reader; 41 | + cell_count_ = ComputeCellCount(db_reader); 42 | + next_read_index_ = 0; 43 | + last_record_size_ = 0; 44 | DCHECK(IsOnValidPage(db_reader)); 45 | DCHECK(DatabasePageReader::IsValidPageId(page_id_)); 46 | } 47 | 48 | +void LeafPageDecoder::Reset() { 49 | + db_reader_ = nullptr; 50 | +} 51 | + 52 | bool LeafPageDecoder::TryAdvance() { 53 | DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); 54 | DCHECK(CanAdvance()); 55 | diff --git a/sql/recover_module/btree.h b/sql/recover_module/btree.h 56 | index eaa087a5c52..df0e0c937c0 100644 57 | --- a/sql/recover_module/btree.h 58 | +++ b/sql/recover_module/btree.h 59 | @@ -101,9 +101,7 @@ class LeafPageDecoder { 60 | public: 61 | // Creates a decoder for a DatabasePageReader's last read page. 62 | // 63 | - // |db_reader| must have been used to read an inner page of a table B-tree. 64 | - // |db_reader| must outlive this instance. 65 | - explicit LeafPageDecoder(DatabasePageReader* db_reader) noexcept; 66 | + LeafPageDecoder() noexcept; 67 | ~LeafPageDecoder() noexcept = default; 68 | 69 | LeafPageDecoder(const LeafPageDecoder&) = delete; 70 | @@ -151,6 +149,17 @@ class LeafPageDecoder { 71 | // read as long as CanAdvance() returns true. 72 | bool TryAdvance(); 73 | 74 | + // Initialize with DatabasePageReader 75 | + // |db_reader| must have been used to read an inner page of a table B-tree. 76 | + // |db_reader| must outlive this instance. 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 | @@ -164,14 +173,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 4f827edf1b4..240de4999fe 100644 108 | --- a/sql/recover_module/cursor.cc 109 | +++ b/sql/recover_module/cursor.cc 110 | @@ -28,7 +28,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 | @@ -38,18 +38,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 | @@ -101,13 +101,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 | @@ -115,7 +115,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 845b7852648..cc4e85f83f9 100644 173 | --- a/sql/recover_module/cursor.h 174 | +++ b/sql/recover_module/cursor.h 175 | @@ -130,7 +130,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 58e75de2704..69d98cef98d 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->page_size()), table_(table) { 195 | DCHECK(table != nullptr); 196 | DCHECK(IsValidPageSize(table->page_size())); 197 | } 198 | @@ -58,7 +57,7 @@ int DatabasePageReader::ReadPage(int page_id) { 199 | "The |read_offset| computation above may overflow"); 200 | 201 | int sqlite_status = 202 | - RawRead(sqlite_file, read_size, read_offset, page_data_.get()); 203 | + RawRead(sqlite_file, read_size, read_offset, page_data_.data()); 204 | 205 | // |page_id_| needs to be set to kInvalidPageId if the read failed. 206 | // Otherwise, future ReadPage() calls with the previous |page_id_| value 207 | diff --git a/sql/recover_module/pager.h b/sql/recover_module/pager.h 208 | index 07cac3cb989..d08f0932fab 100644 209 | --- a/sql/recover_module/pager.h 210 | +++ b/sql/recover_module/pager.h 211 | @@ -6,8 +6,8 @@ 212 | #define SQL_RECOVER_MODULE_PAGER_H_ 213 | 214 | #include 215 | -#include 216 | #include 217 | +#include 218 | 219 | #include "base/check_op.h" 220 | #include "base/memory/raw_ptr.h" 221 | @@ -72,7 +72,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 | @@ -139,7 +139,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 | + std::vector page_data_; 236 | // Raw pointer usage is acceptable because this instance's owner is expected 237 | // to ensure that the VirtualTable outlives this. 238 | const raw_ptr table_; 239 | -------------------------------------------------------------------------------- /electron/std-vector-non-const.patch: -------------------------------------------------------------------------------- 1 | --- a/patches/chromium/feat_add_data_transfer_to_requestsingleinstancelock.patch 2 | +++ b/patches/chromium/feat_add_data_transfer_to_requestsingleinstancelock.patch 3 | @@ -46,7 +46,7 @@ 4 | base::RepeatingCallback; 6 | + const base::FilePath& current_directory, 7 | -+ const std::vector additional_data, 8 | ++ const std::vector additional_data, 9 | + const NotificationAckCallback& ack_callback)>; 10 | 11 | #if BUILDFLAG(IS_WIN) 12 | @@ -112,7 +112,7 @@ 13 | // |reader| is for sending back ACK message. 14 | void HandleMessage(const std::string& current_dir, 15 | const std::vector& argv, 16 | -+ const std::vector additional_data, 17 | ++ const std::vector additional_data, 18 | SocketReader* reader); 19 | 20 | private: 21 | @@ -133,7 +133,7 @@ 22 | - const std::string& current_dir, const std::vector& argv, 23 | + const std::string& current_dir, 24 | + const std::vector& argv, 25 | -+ const std::vector additional_data, 26 | ++ const std::vector additional_data, 27 | SocketReader* reader) { 28 | DCHECK(ui_task_runner_->BelongsToCurrentThread()); 29 | DCHECK(reader); 30 | @@ -195,7 +195,7 @@ 31 | + base::StringToSizeT(tokens[0], &num_args); 32 | + std::vector command_line(tokens.begin() + 1, tokens.begin() + 1 + num_args); 33 | + 34 | -+ std::vector additional_data; 35 | ++ std::vector additional_data; 36 | + if (tokens.size() >= 3 + num_args) { 37 | + size_t additional_data_size; 38 | + base::StringToSizeT(tokens[1 + num_args], &additional_data_size); 39 | @@ -204,7 +204,7 @@ 40 | + std::string(1, kTokenDelimiter)); 41 | + const uint8_t* additional_data_bits = 42 | + reinterpret_cast(remaining_args.c_str()); 43 | -+ additional_data = std::vector(additional_data_bits, 44 | ++ additional_data = std::vector(additional_data_bits, 45 | + additional_data_bits + additional_data_size); 46 | + } 47 | + 48 | @@ -301,7 +301,7 @@ 49 | +const DWORD kPipeTimeout = 10000; 50 | +const DWORD kMaxMessageLength = 32 * 1024; 51 | + 52 | -+std::unique_ptr> g_ack_data; 53 | ++std::unique_ptr> g_ack_data; 54 | +base::OneShotTimer g_ack_timer; 55 | +HANDLE g_write_ack_pipe; 56 | +bool g_write_ack_callback_called = false; 57 | @@ -314,7 +314,7 @@ 58 | base::CommandLine* parsed_command_line, 59 | - base::FilePath* current_directory) { 60 | + base::FilePath* current_directory, 61 | -+ std::vector* parsed_additional_data) { 62 | ++ std::vector* parsed_additional_data) { 63 | // We should have enough room for the shortest command (min_message_size) 64 | // and also be a multiple of wchar_t bytes. The shortest command 65 | - // possible is L"START\0\0" (empty current directory and command line). 66 | @@ -355,7 +355,7 @@ 67 | + msg.substr(fourth_null + 1, fifth_null - fourth_null); 68 | + const uint8_t* additional_data_bytes = 69 | + reinterpret_cast(additional_data.c_str()); 70 | -+ *parsed_additional_data = std::vector(additional_data_bytes, 71 | ++ *parsed_additional_data = std::vector(additional_data_bytes, 72 | + additional_data_bytes + additional_data_length); 73 | + 74 | return true; 75 | @@ -365,7 +365,7 @@ 76 | 77 | +void StoreAck(const base::span* ack_data) { 78 | + if (ack_data) { 79 | -+ g_ack_data = std::make_unique>(ack_data->begin(), 80 | ++ g_ack_data = std::make_unique>(ack_data->begin(), 81 | + ack_data->end()); 82 | + } else { 83 | + g_ack_data = nullptr; 84 | @@ -414,7 +414,7 @@ 85 | base::CommandLine parsed_command_line(base::CommandLine::NO_PROGRAM); 86 | base::FilePath current_directory; 87 | - if (!ParseCommandLine(cds, &parsed_command_line, ¤t_directory)) { 88 | -+ std::vector additional_data; 89 | ++ std::vector additional_data; 90 | + if (!ParseCommandLine(cds, &parsed_command_line, ¤t_directory, 91 | + &additional_data)) { 92 | *result = TRUE; 93 | --- a/shell/browser/api/electron_api_app.cc 94 | +++ b/shell/browser/api/electron_api_app.cc 95 | @@ -519,12 +519,12 @@ 96 | const base::RepeatingCallback< 97 | void(const base::CommandLine& command_line, 98 | const base::FilePath& current_directory, 99 | - const std::vector additional_data, 100 | + const std::vector additional_data, 101 | const ProcessSingleton::NotificationAckCallback& ack_callback)>& 102 | callback, 103 | const base::CommandLine& cmd, 104 | const base::FilePath& cwd, 105 | - const std::vector additional_data, 106 | + const std::vector additional_data, 107 | const ProcessSingleton::NotificationAckCallback& ack_callback) { 108 | // Make sure the callback is called after app gets ready. 109 | if (Browser::Get()->is_ready()) { 110 | @@ -1118,7 +1118,7 @@ 111 | void App::OnSecondInstance( 112 | const base::CommandLine& cmd, 113 | const base::FilePath& cwd, 114 | - const std::vector additional_data, 115 | + const std::vector additional_data, 116 | const ProcessSingleton::NotificationAckCallback& ack_callback) { 117 | v8::Isolate* isolate = JavascriptEnvironment::GetIsolate(); 118 | v8::Locker locker(isolate); 119 | --- a/shell/browser/api/electron_api_app.h 120 | +++ b/shell/browser/api/electron_api_app.h 121 | @@ -197,7 +197,7 @@ 122 | void OnSecondInstance( 123 | const base::CommandLine& cmd, 124 | const base::FilePath& cwd, 125 | - const std::vector additional_data, 126 | + const std::vector additional_data, 127 | const ProcessSingleton::NotificationAckCallback& ack_callback); 128 | bool HasSingleInstanceLock() const; 129 | bool RequestSingleInstanceLock(gin::Arguments* args); 130 | -------------------------------------------------------------------------------- /electron/use-system-libraries-in-node.patch: -------------------------------------------------------------------------------- 1 | --- a/third_party/electron_node/BUILD.gn 2 | +++ b/third_party/electron_node/BUILD.gn 3 | @@ -42,6 +42,18 @@ 4 | node_module_version = "" 5 | } 6 | 7 | +if (is_linux) { 8 | + import("//build/config/linux/pkg_config.gni") 9 | + 10 | + pkg_config("cares") { 11 | + packages = [ "libcares" ] 12 | + } 13 | + 14 | + pkg_config("nghttp2") { 15 | + packages = [ "libnghttp2" ] 16 | + } 17 | +} 18 | + 19 | assert(!node_use_dtrace, "node_use_dtrace not supported in GN") 20 | assert(!node_use_etw, "node_use_etw not supported in GN") 21 | 22 | @@ -182,11 +194,9 @@ 23 | component("node_lib") { 24 | deps = [ 25 | ":node_js2c", 26 | - "deps/cares", 27 | "deps/histogram", 28 | "deps/googletest:gtest", 29 | "deps/llhttp", 30 | - "deps/nghttp2", 31 | "deps/uvwasi", 32 | "//third_party/zlib", 33 | "//third_party/brotli:dec", 34 | @@ -202,6 +212,19 @@ 35 | public_configs = [ ":node_lib_config" ] 36 | include_dirs = [ "src" ] 37 | libs = [] 38 | + if (is_linux) { 39 | + configs += [ 40 | + ":cares", 41 | + ":nghttp2", 42 | + ] 43 | + libs += [ "http_parser" ] 44 | + } else { 45 | + deps += [ 46 | + "deps/cares", 47 | + "deps/http_parser", 48 | + "deps/nghttp2", 49 | + ] 50 | + } 51 | frameworks = [] 52 | cflags_cc = [ 53 | "-Wno-deprecated-declarations", 54 | -------------------------------------------------------------------------------- /electron/webcodecs-stop-using-AudioOpusEncoder.patch: -------------------------------------------------------------------------------- 1 | From 3bd46cb9a51773f103ef52b39d6407740eb0d60a Mon Sep 17 00:00:00 2001 2 | From: Eugene Zemtsov 3 | Date: Thu, 24 Feb 2022 23:17:20 +0000 4 | Subject: [PATCH] webcodecs: Stop using AudioOpusEncoder as backed for mojo 5 | audio encoder 6 | 7 | AudioOpusEncoder was only used here for testing. Let's not let it get 8 | comfortable. We'll use MF AAC encoder here when we have it. (Soon...) 9 | 10 | Bug: 1259883 11 | Change-Id: Ia1819395c8c8fd6d403d4b8558c12f9a1bf7e761 12 | Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3489449 13 | Commit-Queue: Eugene Zemtsov 14 | Auto-Submit: Eugene Zemtsov 15 | Reviewed-by: Dale Curtis 16 | Commit-Queue: Dale Curtis 17 | Cr-Commit-Position: refs/heads/main@{#974895} 18 | --- 19 | media/mojo/services/gpu_mojo_media_client.cc | 10 +--------- 20 | 1 file changed, 1 insertion(+), 9 deletions(-) 21 | 22 | diff --git a/media/mojo/services/gpu_mojo_media_client.cc b/media/mojo/services/gpu_mojo_media_client.cc 23 | index 8f83a4d6cf6..40cdaff8d3a 100644 24 | --- a/media/mojo/services/gpu_mojo_media_client.cc 25 | +++ b/media/mojo/services/gpu_mojo_media_client.cc 26 | @@ -13,7 +13,6 @@ 27 | #include "build/chromeos_buildflags.h" 28 | #include "gpu/ipc/service/gpu_channel.h" 29 | #include "media/audio/audio_features.h" 30 | -#include "media/audio/audio_opus_encoder.h" 31 | #include "media/base/audio_decoder.h" 32 | #include "media/base/cdm_factory.h" 33 | #include "media/base/media_switches.h" 34 | @@ -119,14 +118,7 @@ std::unique_ptr GpuMojoMediaClient::CreateAudioEncoder( 35 | scoped_refptr task_runner) { 36 | if (!base::FeatureList::IsEnabled(features::kPlatformAudioEncoder)) 37 | return nullptr; 38 | - // TODO(crbug.com/1259883) Right now Opus encoder is all we have, later on 39 | - // we'll create a real platform encoder here. 40 | - auto opus_encoder = std::make_unique(); 41 | - auto encoding_runner = base::ThreadPool::CreateSequencedTaskRunner( 42 | - {base::TaskPriority::USER_BLOCKING}); 43 | - return std::make_unique(std::move(opus_encoder), 44 | - std::move(encoding_runner), 45 | - std::move(task_runner)); 46 | + return nullptr; 47 | } 48 | 49 | VideoDecoderType GpuMojoMediaClient::GetDecoderImplementationType() { 50 | -------------------------------------------------------------------------------- /electron/webrtc-check-existence-of-cursor-metadata.patch: -------------------------------------------------------------------------------- 1 | From c2cd814cdd8cbf8dda6ccec2266327a5321fbde8 Mon Sep 17 00:00:00 2001 2 | From: Jan Grulich 3 | Date: Tue, 15 Mar 2022 14:31:55 +0100 4 | Subject: [PATCH] PipeWire capturer: check existence of cursor metadata 5 | 6 | Check whether there are any cursor metadata before we try to validate 7 | and use them, otherwise we might crash on this. 8 | 9 | Bug: webrtc:13429 10 | Change-Id: I365da59a189b6b974cebafc94fec49d5b942efae 11 | Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/255601 12 | Reviewed-by: Alexander Cooper 13 | Commit-Queue: Alexander Cooper 14 | Cr-Commit-Position: refs/heads/main@{#36240} 15 | --- 16 | .../desktop_capture/linux/wayland/shared_screencast_stream.cc | 2 +- 17 | 1 file changed, 1 insertion(+), 1 deletion(-) 18 | 19 | diff --git a/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc b/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc 20 | index a8c86e26..9e81df4c 100644 21 | --- a/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc 22 | +++ b/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc 23 | @@ -650,7 +650,7 @@ void SharedScreenCastStreamPrivate::ProcessBuffer(pw_buffer* buffer) { 24 | const struct spa_meta_cursor* cursor = 25 | static_cast(spa_buffer_find_meta_data( 26 | spa_buffer, SPA_META_Cursor, sizeof(*cursor))); 27 | - if (spa_meta_cursor_is_valid(cursor)) { 28 | + if (cursor && spa_meta_cursor_is_valid(cursor)) { 29 | struct spa_meta_bitmap* bitmap = nullptr; 30 | 31 | if (cursor->bitmap_offset) 32 | -------------------------------------------------------------------------------- /genrepo.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | 3 | pkgs=('apm' 4 | 'atom' 5 | 'electron' 6 | ) 7 | 8 | add=() 9 | 10 | mkdir -p repository 11 | 12 | for pkg in "${pkgs[@]}"; do 13 | source ${pkg}/PKGBUILD 14 | path="${pkgname}-${pkgver}-${pkgrel}-x86_64.pkg.tar.xz" 15 | if [ ! -e "repository/${path}" ]; then 16 | echo "Copying ${path}..." 17 | cp ${pkg}/${path} repository 18 | add+=("${path}") 19 | fi 20 | if [ ! -e "repository/${path}.sig" ]; then 21 | echo "Signing ${path}..." 22 | (cd repository; gpg2 --detach-sign ${path}) 23 | fi 24 | done 25 | 26 | if [ ${#add[@]} -ne 0 ]; then 27 | cd repository 28 | add_args='--sign --verify --delta --remove' 29 | repo-add ${add_args} atom.db.tar.xz ${add[@]} 30 | fi 31 | -------------------------------------------------------------------------------- /sync.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | 3 | repo_host='root@noaxiom.org' 4 | repo_name='atom' 5 | repo_path="/srv/noaxiom/${repo_name}" 6 | 7 | rsync_args=('-rtlvH' 8 | '--delete-after' 9 | '--delay-updates' 10 | '--safe-links' 11 | '--max-delete=1000' 12 | ) 13 | 14 | arch='x86_64' 15 | echo "Syncing ${arch} repository..." 16 | if [ -d repository ]; then 17 | cd repository 18 | rsync "${rsync_args[@]}" . "${repo_host}:${repo_path}/${arch}" 19 | fi 20 | --------------------------------------------------------------------------------