Date: Wednesday, March 30, 2022 @ 12:18:03 Author: alerque Revision: 1177787
upgpkg: atom 1.61.0beta0-0; incomplete overhaul aiming to get rid of electron9 Modified: atom/trunk/PKGBUILD atom/trunk/atom.js atom/trunk/fix-atom-sh.patch atom/trunk/use-system-electron.patch ---------------------------+ PKGBUILD | 188 ++++++++++++++++++++++++-------------------- atom.js | 2 fix-atom-sh.patch | 33 ++++--- use-system-electron.patch | 24 ++--- 4 files changed, 135 insertions(+), 112 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2022-03-30 11:40:17 UTC (rev 1177786) +++ PKGBUILD 2022-03-30 12:18:03 UTC (rev 1177787) @@ -1,35 +1,44 @@ -# Maintainer: Nicola Squartini <tens...@gmail.com> +# Maintainer: Caleb Maclennan <ca...@alerque.com> +# Contributor: Nicola Squartini <tens...@gmail.com> pkgname=atom -pkgver=1.58.0 -_commit=550c1dae66f97bd3fc31c59e6d8ba5f1299ccaf7 -pkgrel=1 +pkgver=1.61.0beta0 +_sha=a19b6eed206e3d635367fbff69e2777bb04feb1d +pkgrel=0 pkgdesc='A hackable text editor for the 21st Century' -arch=('x86_64') -url='https://github.com/atom/atom' -license=('MIT' 'custom') -depends=('apm' 'electron9' 'libxkbfile' 'ripgrep') -makedepends=('git' 'npm') +arch=(x86_64) +url="https://github.com/atom/$pkgname" +license=(MIT) +_electron=electron11 +depends=(apm + $_electron + libxkbfile + ripgrep) +makedepends=(git + node-gyp + nodejs-lts-gallium + npm) optdepends=('ctags: symbol indexing support' 'git: Git and GitHub integration') -replaces=('atom-editor') +replaces=(atom-editor) options=(!emptydirs) -source=("git+https://github.com/atom/atom.git#commit=${_commit}" - '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') -sha256sums=('SKIP' - 'a4f198ae1040637ce72c163585662d94e0d59b593f69d919d0acd7044c316cac' +_archive="$pkgname-$_sha" +source=("$url/archive/$_sha/$_archive.tar.gz" + $pkgname.js + dugite-use-system-git.patch + fix-$pkgname-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) +sha256sums=('8fb62ee3aeb466d8a75fb3fd467b96836a4f2f9c594d1b701f9dcf8df12587f8' + 'cd39815e7f9a72be0c7ac2e15106f8bb8774c0cbc0960725b0b677d0ce67d828' '530b46d31df0f5e8f5881e1608a66fe75d549092a6db2e72ba3ad69c48714153' - 'b3d3706519556a59ba557b695017c9debe8b23efe2782cdb440131520bc0540d' + '13ed58df53ab8fb9a0f505ad4d860aa61e5ed00a280ad7ff27dcaa360e31d896' '954a82abeb0d144891449e3db2126ee3007bea63737146a2239997c932520cbc' '5f9946b33024b429b3951629b0e3fd6deeb88895b3467a7e8e0c504b0accd9c5' 'e321fdfe880cd465918dd1dbb90e4c7d46fc5310f20666eddf0a41cbca4f8ac8' @@ -37,104 +46,115 @@ 'a09439c2a908ca174ff3be1f0d85071d12c792ae19748e36fe601e372d6d925b' 'c93cc88dd704388d4b26a0de0a5938df7ff90cedf8eed0b3b8a675f9cc7d487c' '08ae0c93b5ec7eb7d90c65d5d2adbaca538482fba902ed1f8414024db0d21854' - 'fbd64067aa513f9b51fd33501a8310f976c18049866e636f19542c493246fd19') + '5e6e05fe09642e4a18d6c44764fb18498460b53b285420b5acc6a3622e9dc6d2') +_electron_version=$(< /usr/lib/$_electron/version) + prepare() { - cd ${pkgname} - - patch -Np1 -i ../fix-atom-sh.patch - patch -Np1 -i ../use-system-electron.patch + cd "$_archive" + patch -Np1 -i ../fix-$pkgname-sh.patch + patch -Np1 -i <(sed -e "s/@ELECTRON@/$_electron/" ../use-system-electron.patch) patch -Np1 -i ../use-system-apm.patch patch -Np1 -i ../fix-license-path.patch patch -Np1 -i ../fix-restart.patch patch -Np1 -i ../node-env-production.patch patch -Np1 -i ../no-unsafe-eval-warning.patch -} -build() { - cd ${pkgname} + rm {,script/}package-lock.json + set -x - ATOM_RESOURCE_PATH="${PWD}" \ - npm_config_build_from_source=true \ - npm_config_target=$(< /usr/lib/electron9/version) \ - apm install + env \ + ATOM_RESOURCE_PATH="$PWD" \ + npm_config_build_from_source=true \ + npm_config_target=$_electron_version \ + apm install --cache "$srcdir/npm-cache" # Use system ctags - cd node_modules/symbols-view - patch -Np1 -i "${srcdir}"/symbols-view-use-system-ctags.patch + pushd node_modules/symbols-view + patch -Np1 -i "$srcdir/symbols-view-use-system-ctags.patch" rm -r lib/ctags-config vendor - cd ../.. + popd # Use system git - cd node_modules/dugite - patch -Np1 -i "${srcdir}"/dugite-use-system-git.patch + pushd node_modules/dugite + patch -Np1 -i "$srcdir/dugite-use-system-git.patch" rm -r git - cd ../.. + popd # Fix issue with: # build/Release/git.node: undefined symbol: git_net_url_is_default_port - cd node_modules/git-utils - patch -Np1 -i "${srcdir}"/git-utils.patch + pushd node_modules/git-utils + patch -Np1 -i "$srcdir/git-utils.patch" + popd + + pushd script + npm install --cache "$srcdir/npm-cache" +} + +build() { + cd "$_archive" + set -x + + pushd node_modules/git-utils env \ npm_config_disturl=https://electronjs.org/headers \ - npm_config_runtime=electron \ - npm_config_target=$(< /usr/lib/electron9/version) \ + npm_config_runtime=$_electron \ + npm_config_target=$_electron_version \ node-gyp rebuild - cd ../.. + popd - cd script - npm install + pushd script # Hack to avoid using Node > 12 (https://github.com/babel/babel/issues/11216) # Set ELECTRON_VERSION (see use-system-electron.patch) env \ ELECTRON_RUN_AS_NODE=1 \ - ELECTRON_VERSION=$(< /usr/lib/electron9/version) \ - electron9 \ - build --no-bootstrap + ELECTRON_VERSION=$_electron_version \ + $_electron build --no-bootstrap } package() { - cd ${pkgname} + cd "$_archive" - install -d -m 755 "${pkgdir}"/usr/lib - cp -r out/app "${pkgdir}"/usr/lib/atom - install -m 644 out/startup.js "${pkgdir}"/usr/lib/atom - install -m 755 "${srcdir}/atom.js" "${pkgdir}"/usr/lib/atom/atom + install -dm0755 "$pkgdir/usr/lib" + cp -r out/app "$pkgdir/usr/lib/$pkgname" + install -m0644 out/startup.js "$pkgdir/usr/lib/$pkgname" + sed -e "s/@ELECTRON@/$_electron/" "$srcdir/$pkgname.js" | + install -Dm0755 /dev/stdin "$pkgdir/usr/lib/$pkgname/$pkgname" - ln -sf /usr/bin/rg "${pkgdir}/usr/lib/atom/node_modules/vscode-ripgrep/bin/rg" + ln -sf /usr/bin/rg "$pkgdir/usr/lib/$pkgname/node_modules/vscode-ripgrep/bin/rg" - install -d -m 755 "${pkgdir}/usr/share/applications" + install -dm0755 "$pkgdir/usr/share/applications" sed -e "s|<%= appName %>|Atom|" \ - -e "s/<%= description %>/${pkgdesc}/" \ + -e "s/<%= description %>/$pkgdesc/" \ -e "s|<%= installDir %>|/usr|" \ - -e "s|<%= appFileName %>|atom|" \ - -e "s|<%= iconPath %>|atom|" \ - resources/linux/atom.desktop.in > "${pkgdir}/usr/share/applications/atom.desktop" + -e "s|<%= appFileName %>|$pkgname|" \ + -e "s|<%= iconPath %>|$pkgname|" \ + resources/linux/atom.desktop.in > "$pkgdir/usr/share/applications/$pkgname.desktop" for size in 16 24 32 48 64 128 256 512 1024; do - install -D -m 644 resources/app-icons/stable/png/${size}.png \ - "${pkgdir}"/usr/share/icons/hicolor/${size}x${size}/apps/atom.png + install -Dm0644 "resources/app-icons/stable/png/$size.png" \ + "$pkgdir/usr/share/icons/hicolor/${size}x${size}/apps/$pkgname.png" done - ln -sf ../../../share/icons/hicolor/1024x1024/apps/atom.png \ - "${pkgdir}"/usr/lib/atom/resources/atom.png + ln -sf "../../../share/icons/hicolor/1024x1024/apps/$pkgname.png" \ + "$pkgdir/usr/lib/$pkgname/resources/$pkgname.png" - install -D -m 755 atom.sh "${pkgdir}/usr/bin/atom" + install -Dm0755 "$pkgname.sh" "$pkgdir/usr/bin/$pkgname" - install -d -m 755 "${pkgdir}/usr/share/licenses/${pkgname}" - node -e "require('./script/lib/get-license-text')().then((licenseText) => require('fs').writeFileSync('${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.md', licenseText))" + install -dm0755 "$pkgdir/usr/share/licenses/$pkgname" + node -e "require('./script/lib/get-license-text')().then((licenseText) => require('fs').writeFileSync('$pkgdir/usr/share/licenses/$pkgname/LICENSE.md', licenseText))" # Remove useless stuff - find "${pkgdir}"/usr/lib/atom/node_modules \ - -name "*.a" -exec rm '{}' \; \ - -or -name "*.bat" -exec rm '{}' \; \ - -or -name "*.c" -exec rm '{}' \; \ - -or -name "*.cpp" -exec rm '{}' \; \ - -or -name "*.node" -exec chmod a-x '{}' \; \ - -or -name "benchmark" -prune -exec rm -r '{}' \; \ - -or -name "doc" -prune -exec rm -r '{}' \; \ - -or -name "html" -prune -exec rm -r '{}' \; \ - -or -name "man" -prune -exec rm -r '{}' \; \ - -or -name "scripts" -prune -exec rm -r '{}' \; \ - -or -path "*/less/gradle" -prune -exec rm -r '{}' \; \ - -or -path "*/task-lists/src" -prune -exec rm -r '{}' \; + find "$pkgdir/usr/lib/$pkgname/node_modules" \ + -name '*.a' -exec rm '{}' \; \ + -or -name '*.bat' -exec rm '{}' \; \ + -or -name '*.c' -exec rm '{}' \; \ + -or -name '*.cpp' -exec rm '{}' \; \ + -or -name '*.node' -exec chmod a-x '{}' \; \ + -or -name 'benchmark' -prune -exec rm -r '{}' \; \ + -or -name 'doc' -prune -exec rm -r '{}' \; \ + -or -name 'html' -prune -exec rm -r '{}' \; \ + -or -name 'man' -prune -exec rm -r '{}' \; \ + -or -name 'scripts' -prune -exec rm -r '{}' \; \ + -or -path '*/less/gradle' -prune -exec rm -r '{}' \; \ + -or -path '*/task-lists/src' -prune -exec rm -r '{}' \; } Modified: atom.js =================================================================== --- atom.js 2022-03-30 11:40:17 UTC (rev 1177786) +++ atom.js 2022-03-30 12:18:03 UTC (rev 1177787) @@ -1,4 +1,4 @@ -#!/usr/bin/electron9 +#!/usr/bin/env @ELECTRON@ const name = "atom"; Modified: fix-atom-sh.patch =================================================================== --- fix-atom-sh.patch 2022-03-30 11:40:17 UTC (rev 1177786) +++ fix-atom-sh.patch 2022-03-30 12:18:03 UTC (rev 1177787) @@ -30,7 +30,7 @@ # Only set the ATOM_DISABLE_SHELLING_OUT_FOR_ENVIRONMENT env var if it hasn't been set. if [ -z "$ATOM_DISABLE_SHELLING_OUT_FOR_ENVIRONMENT" ] then -@@ -90,105 +66,24 @@ +@@ -90,110 +66,24 @@ ATOM_HOME="${ATOM_HOME:-$HOME/.atom}" mkdir -p "$ATOM_HOME" @@ -47,17 +47,11 @@ - ATOM_PATH="$(dirname "$ATOM_APP")" - ATOM_APP_NAME="$(basename "$ATOM_APP")" - fi -+ATOM_PATH="/usr/lib/atom/atom" - +- - if [ ! -z "${ATOM_APP_NAME}" ]; then - # If ATOM_APP_NAME is known, use it as the executable name - ATOM_EXECUTABLE_NAME="${ATOM_APP_NAME%.*}" -+if [ $EXPECT_OUTPUT ]; then -+ "$ATOM_PATH" --executed-from="$(pwd)" --pid=$$ "$@" -+ ATOM_EXIT=$? -+ if [ ${ATOM_EXIT} -eq 0 ] && [ -n "${EXIT_CODE_OVERRIDE}" ]; then -+ exit "${EXIT_CODE_OVERRIDE}" - else +- else - # Else choose it from the inferred channel name - if [ "$CHANNEL" == 'beta' ]; then - ATOM_EXECUTABLE_NAME="Atom Beta" @@ -86,9 +80,9 @@ - exit 1 - fi - fi -+ exit ${ATOM_EXIT} - fi -- +- fi ++ATOM_PATH="/usr/lib/atom/atom" + - if [ $EXPECT_OUTPUT ]; then - "$ATOM_PATH/$ATOM_APP_NAME/Contents/MacOS/$ATOM_EXECUTABLE_NAME" --executed-from="$(pwd)" --pid=$$ "$@" - ATOM_EXIT=$? @@ -97,9 +91,15 @@ - else - exit ${ATOM_EXIT} - fi -- else ++if [ $EXPECT_OUTPUT ]; then ++ "$ATOM_PATH" --executed-from="$(pwd)" --pid=$$ "$@" ++ ATOM_EXIT=$? ++ if [ ${ATOM_EXIT} -eq 0 ] && [ -n "${EXIT_CODE_OVERRIDE}" ]; then ++ exit "${EXIT_CODE_OVERRIDE}" + else - open -a "$ATOM_PATH/$ATOM_APP_NAME" -n --args --executed-from="$(pwd)" --pid=$$ --path-environment="$PATH" "$@" -- fi ++ exit ${ATOM_EXIT} + fi -elif [ $OS == 'Linux' ]; then - SCRIPT=$(readlink -f "$0") - USR_DIRECTORY=$(readlink -f $(dirname $SCRIPT)/..) @@ -119,6 +119,11 @@ - ;; - esac - +- #Will allow user to get context menu on cinnamon desktop enviroment +- if [[ "$(expr substr $(printenv | grep "DESKTOP_SESSION=") 17 8)" == "cinnamon" ]]; then +- cp "resources/linux/desktopenviroment/cinnamon/atom.nemo_action" "/usr/share/nemo/actions/atom.nemo_action" +- fi +- - : ${TMPDIR:=/tmp} - - [ -x "$ATOM_PATH" ] || ATOM_PATH="$TMPDIR/atom-build/Atom/atom" Modified: use-system-electron.patch =================================================================== --- use-system-electron.patch 2022-03-30 11:40:17 UTC (rev 1177786) +++ use-system-electron.patch 2022-03-30 12:18:03 UTC (rev 1177787) @@ -4,37 +4,35 @@ "url": "https://github.com/atom/atom/issues" }, "license": "MIT", -- "electronVersion": "9.4.4", +- "electronVersion": "11.4.12", "dependencies": { "@atom/fuzzy-native": "^1.2.0", "@atom/nsfw": "^1.0.27", --- a/script/build +++ b/script/build -@@ -33,7 +33,7 @@ +@@ -33,7 +33,6 @@ .wrap(yargs.terminalWidth()) .argv -const checkChromedriverVersion = require('./lib/check-chromedriver-version') -+// const checkChromedriverVersion = require('./lib/check-chromedriver-version') const cleanOutputDirectory = require('./lib/clean-output-directory') const codeSignOnMac = require('./lib/code-sign-on-mac') const codeSignOnWindows = require('./lib/code-sign-on-windows') -@@ -66,12 +66,12 @@ +@@ -65,13 +64,9 @@ + const CONFIG = require('./config') - // Used by the 'github' package for Babel configuration +-// Used by the 'github' package for Babel configuration -process.env.ELECTRON_VERSION = CONFIG.appMetadata.electronVersion -+// process.env.ELECTRON_VERSION = CONFIG.appMetadata.electronVersion - +- let binariesPromise = Promise.resolve() if (!argv.existingBinaries) { - checkChromedriverVersion() -+ // checkChromedriverVersion() cleanOutputDirectory() copyAssets() transpilePackagesWithCustomTranspilerPaths() -@@ -90,74 +90,5 @@ +@@ -90,74 +85,5 @@ if (!argv.generateApiDocs) { binariesPromise @@ -119,7 +117,7 @@ - packagedAppPath, - CONFIG.executableName - ); -+ nodeBundledInElectronPath = 'electron9'; ++ nodeBundledInElectronPath = '@ELECTRON@'; } childProcess.execFileSync( nodeBundledInElectronPath, @@ -144,10 +142,10 @@ "coffeelint": "1.15.7", "colors": "1.1.2", "donna": "1.0.16", -- "electron-chromedriver": "^9.0.0", +- "electron-chromedriver": "^11.0.0", "electron-link": "^0.6.0", -- "electron-mksnapshot": "^9.0.2", - "electron-packager": "^15.0.0", +- "electron-mksnapshot": "^11.0.1", + "electron-packager": "^15.1.0", "eslint": "^5.16.0", "eslint-config-prettier": "^4.2.0", --- a/src/compile-cache.js