diff options
author | Narrat | 2020-01-18 22:47:08 +0100 |
---|---|---|
committer | Narrat | 2020-01-18 22:50:05 +0100 |
commit | ef0adeac3420d6dc7ad41e10470bd09bfec31f30 (patch) | |
tree | 22171e0c0cfae4698298bb5ffbf595d359360be4 | |
parent | 0d7a9648cb7e112299d84c814466e2447fce925c (diff) | |
download | aur-ef0adeac3420d6dc7ad41e10470bd09bfec31f30.tar.gz |
sync with community (1.43.0)
untested, needs to checked if this will work
-rw-r--r-- | .SRCINFO | 39 | ||||
-rw-r--r-- | PKGBUILD | 100 | ||||
-rw-r--r-- | atom.js | 2 | ||||
-rw-r--r-- | electron-3.patch | 11 | ||||
-rw-r--r-- | enable-transparency.patch | 11 | ||||
-rw-r--r-- | fix-atom-sh.patch | 46 | ||||
-rw-r--r-- | fix-license-path.patch | 22 | ||||
-rw-r--r-- | fix-middle-click.patch | 21 | ||||
-rw-r--r-- | fix-restart.patch | 14 | ||||
-rw-r--r-- | git-utils.patch | 11 | ||||
-rw-r--r-- | no-unsafe-eval-warning.patch | 11 | ||||
-rw-r--r-- | node-env-production.patch | 13 | ||||
-rw-r--r-- | use-system-apm.patch | 41 | ||||
-rw-r--r-- | use-system-electron.patch | 193 |
14 files changed, 300 insertions, 235 deletions
@@ -1,6 +1,6 @@ pkgbase = atom-transparent - pkgdesc = A hackable text editor for the 21st Century, with transparency patch. - pkgver = 1.35.1 + pkgdesc = A hackable text editor for the 21st Century, with transparency patch + pkgver = 1.43.0 pkgrel = 1 url = https://github.com/atom/atom arch = x86_64 @@ -9,37 +9,40 @@ pkgbase = atom-transparent makedepends = git makedepends = npm depends = apm - depends = electron + depends = electron4 depends = libxkbfile + depends = ripgrep optdepends = ctags: symbol indexing support optdepends = git: Git and GitHub integration - replaces = atom-editor - replaces = atom-editor-transparent + provides = atom + conflicts = atom options = !emptydirs - source = atom-1.35.1.tar.gz::https://github.com/atom/atom/archive/v1.35.1.tar.gz + source = git+https://github.com/atom/atom.git#commit=417cdc71bafff747ed16b363bbd576212fc03a78 source = atom.js source = dugite-use-system-git.patch - source = electron-3.patch source = fix-atom-sh.patch source = fix-license-path.patch - source = fix-middle-click.patch source = fix-restart.patch + source = git-utils.patch + source = no-unsafe-eval-warning.patch + source = node-env-production.patch source = symbols-view-use-system-ctags.patch source = use-system-apm.patch source = use-system-electron.patch source = enable-transparency.patch - sha256sums = a50bcfcda4cfe6017fb76defc3a0eeaca209954d86a631f5963e69a0c064c2e8 - sha256sums = cdf87ab82cfcf69e8904684c59b08c35a68540ea16ab173fce06037ac341efcd + sha256sums = SKIP + sha256sums = d286e0766e47cfea73cd207abb9d6f7375846688823e72732c871a852b4b261d sha256sums = 530b46d31df0f5e8f5881e1608a66fe75d549092a6db2e72ba3ad69c48714153 - sha256sums = 328da3b30f4e20e56b38e588d9fe871c01bbbe69865a79e9586919564bdfa869 - sha256sums = ab9eed3d4c8bfefea256953428379ab1e636b9c7d4c4af30ddc3f485330183c2 - sha256sums = 5c77deec5896b658395bdf695c3bc044c9140ad0a5a87f34520c4a31972e51d1 - sha256sums = 142d540259296396f6d528ecf2f7c6a363f89f8a0d2ad66497f8392da06202bc - sha256sums = c4b883265d16ee30402c449d07be78b7088c1aa60c4f3e712b8bfe857c95f346 + sha256sums = b3d3706519556a59ba557b695017c9debe8b23efe2782cdb440131520bc0540d + sha256sums = 2894cce31935d45291c5fe4c625473bb83fc51e1b899f162aa6b419491c7ace1 + sha256sums = e3c30c03006d23a72f07fa77f4309b16a6059af1179343033a87f74f50124076 + sha256sums = e321fdfe880cd465918dd1dbb90e4c7d46fc5310f20666eddf0a41cbca4f8ac8 + sha256sums = 40d783794d62f12f3c429c624a84265871c7ed95f4120c9db800348896dd5437 + sha256sums = a09439c2a908ca174ff3be1f0d85071d12c792ae19748e36fe601e372d6d925b sha256sums = 3c68e6b3751313e1d386e721f8f819fb051351fb2cf8e753b1d773a0f475fef8 - sha256sums = 53f43c9328a66e24b3467a0a06d9dfde83475f7e54251bf7a523beafaa043806 - sha256sums = 457bd1b06604aec1e2ebb6e0ea473742747e183e833fffb36377aad64c37bcd5 - sha256sums = 2cb262dfd15f67dd1a01a9b314983f535da8b06ce4a814d214e12ec369631d58 + sha256sums = 8d48dca4571136375b325f4bf94ccfb996e90e57b7fdf83d53c1eb2e69b3b0d4 + sha256sums = 81af763f05c1afd87705b8c7a6647e35f524b2e952adb2e596de2a7e8fe4e69e + sha256sums = 2693e528c689b770ba976aeaba125e4b269a57a02294d3c3f2a0d85ed65a93eb pkgname = atom-transparent @@ -1,67 +1,67 @@ -# Maintainer: OriginCode <origincoder@yahoo.com +# Contributor: OriginCode <origincoder@yahoo.com +# Contributor: Nicola Squartini <tensor5@gmail.com> pkgname=atom-transparent -pkgver=1.35.1 +pkgver=1.43.0 +_commit=417cdc71bafff747ed16b363bbd576212fc03a78 pkgrel=1 -pkgdesc='A hackable text editor for the 21st Century, with transparency patch.' +pkgdesc='A hackable text editor for the 21st Century, with transparency patch' arch=('x86_64') url='https://github.com/atom/atom' license=('MIT' 'custom') -depends=('apm' 'electron' 'libxkbfile') +depends=('apm' 'electron4' 'libxkbfile' 'ripgrep') makedepends=('git' 'npm') optdepends=('ctags: symbol indexing support' 'git: Git and GitHub integration') -replaces=('atom-editor' 'atom-editor-transparent') +conflicts=('atom') +provides=('atom') options=(!emptydirs) -source=("atom-${pkgver}.tar.gz::https://github.com/atom/atom/archive/v${pkgver}.tar.gz" +source=("git+https://github.com/atom/atom.git#commit=${_commit}" 'atom.js' 'dugite-use-system-git.patch' - 'electron-3.patch' 'fix-atom-sh.patch' 'fix-license-path.patch' - 'fix-middle-click.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' 'enable-transparency.patch') -sha256sums=('a50bcfcda4cfe6017fb76defc3a0eeaca209954d86a631f5963e69a0c064c2e8' - 'cdf87ab82cfcf69e8904684c59b08c35a68540ea16ab173fce06037ac341efcd' +sha256sums=('SKIP' + 'd286e0766e47cfea73cd207abb9d6f7375846688823e72732c871a852b4b261d' '530b46d31df0f5e8f5881e1608a66fe75d549092a6db2e72ba3ad69c48714153' - '328da3b30f4e20e56b38e588d9fe871c01bbbe69865a79e9586919564bdfa869' - 'ab9eed3d4c8bfefea256953428379ab1e636b9c7d4c4af30ddc3f485330183c2' - '5c77deec5896b658395bdf695c3bc044c9140ad0a5a87f34520c4a31972e51d1' - '142d540259296396f6d528ecf2f7c6a363f89f8a0d2ad66497f8392da06202bc' - 'c4b883265d16ee30402c449d07be78b7088c1aa60c4f3e712b8bfe857c95f346' + 'b3d3706519556a59ba557b695017c9debe8b23efe2782cdb440131520bc0540d' + '2894cce31935d45291c5fe4c625473bb83fc51e1b899f162aa6b419491c7ace1' + 'e3c30c03006d23a72f07fa77f4309b16a6059af1179343033a87f74f50124076' + 'e321fdfe880cd465918dd1dbb90e4c7d46fc5310f20666eddf0a41cbca4f8ac8' + '40d783794d62f12f3c429c624a84265871c7ed95f4120c9db800348896dd5437' + 'a09439c2a908ca174ff3be1f0d85071d12c792ae19748e36fe601e372d6d925b' '3c68e6b3751313e1d386e721f8f819fb051351fb2cf8e753b1d773a0f475fef8' - '53f43c9328a66e24b3467a0a06d9dfde83475f7e54251bf7a523beafaa043806' - '457bd1b06604aec1e2ebb6e0ea473742747e183e833fffb36377aad64c37bcd5' - '2cb262dfd15f67dd1a01a9b314983f535da8b06ce4a814d214e12ec369631d58') + '8d48dca4571136375b325f4bf94ccfb996e90e57b7fdf83d53c1eb2e69b3b0d4' + '81af763f05c1afd87705b8c7a6647e35f524b2e952adb2e596de2a7e8fe4e69e' + '2693e528c689b770ba976aeaba125e4b269a57a02294d3c3f2a0d85ed65a93eb') prepare() { - cd "${srcdir}/atom-${pkgver}" - - patch -Np1 -i "${srcdir}"/fix-atom-sh.patch - patch -Np1 -i "${srcdir}"/use-system-electron.patch - patch -Np1 -i "${srcdir}"/use-system-apm.patch - patch -Np1 -i "${srcdir}"/fix-license-path.patch - patch -Np1 -i "${srcdir}"/fix-restart.patch + cd ${pkgname} + + patch -Np1 -i ../fix-atom-sh.patch + patch -Np1 -i ../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 patch -Np1 -i "${srcdir}"/enable-transparency.patch - - # Fix for Electron 3 - patch -Np1 -i "${srcdir}"/electron-3.patch } build() { - cd "${srcdir}/atom-${pkgver}" - - # Fix for Electron 3 - npm install --package-lock-only @atom/nsfw@1.0.20 node-abi - - rm package-lock.json + cd ${pkgname} ATOM_RESOURCE_PATH="${PWD}" \ - npm_config_target=$(tail -c +2 /usr/lib/electron/version) \ + npm_config_build_from_source=true \ + npm_config_target=$(< /usr/lib/electron4/version) \ apm install # Use system ctags @@ -76,24 +76,42 @@ build() { rm -r git cd ../.. - # https://bugs.archlinux.org/task/61047 - cd node_modules/tabs - patch -Np1 -i "${srcdir}"/fix-middle-click.patch + # 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 + env \ + npm_config_disturl=https://electronjs.org/headers \ + npm_config_runtime=electron \ + npm_config_target=$(< /usr/lib/electron4/version) \ + node-gyp rebuild cd ../.. cd script - npm install - ./build + # Hack to avoid using Node 12 + env \ + npm_config_disturl=https://electronjs.org/headers \ + npm_config_runtime=electron \ + npm_config_target=$(< /usr/lib/electron4/version) \ + npm install + # Set ELECTRON_VERSION (see use-system-electron.patch) + env \ + ELECTRON_RUN_AS_NODE=1 \ + ELECTRON_VERSION=$(< /usr/lib/electron4/version) \ + electron4 \ + build --no-bootstrap } package() { - cd "${srcdir}/atom-${pkgver}" + cd ${pkgname} 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 + ln -sf /usr/bin/rg "${pkgdir}/usr/lib/atom/node_modules/vscode-ripgrep/bin/rg" + install -d -m 755 "${pkgdir}/usr/share/applications" sed -e "s|<%= appName %>|Atom|" \ -e "s/<%= description %>/${pkgdesc}/" \ @@ -1,4 +1,4 @@ -#!/usr/bin/electron +#!/usr/bin/electron4 const name = "atom"; diff --git a/electron-3.patch b/electron-3.patch deleted file mode 100644 index f317c92a12a5..000000000000 --- a/electron-3.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/src/text-editor-component.js -+++ b/src/text-editor-component.js -@@ -4433,7 +4433,7 @@ - - if (element) { - element.className = className || '' -- element.styleMap.forEach((value, key) => { -+ element.attributeStyleMap.forEach((value, key) => { - if (!style || style[key] == null) element.style[key] = '' - }) - if (style) Object.assign(element.style, style) diff --git a/enable-transparency.patch b/enable-transparency.patch index 2c00b6d6b69c..454e11ca13d4 100644 --- a/enable-transparency.patch +++ b/enable-transparency.patch @@ -1,13 +1,17 @@ diff -ur a/atom.sh b/atom.sh --- a/atom.sh 2018-06-03 20:13:22.329490169 +0800 +++ b/atom.sh 2018-06-03 20:22:19.346842103 +0800 -@@ -44,11 +44,11 @@ - mkdir -p "$ATOM_HOME" +@@ -69,7 +69,7 @@ + ATOM_PATH="/usr/lib/atom/atom" if [ $EXPECT_OUTPUT ]; then - "$ATOM_PATH" --executed-from="$(pwd)" --pid=$$ "$@" + "$ATOM_PATH" --executed-from="$(pwd)" --pid=$$ --enable-transparent-visuals --disable-gpu "$@" - exit $? + ATOM_EXIT=$? + if [ ${ATOM_EXIT} -eq 0 ] && [ -n "${EXIT_CODE_OVERRIDE}" ]; then + exit "${EXIT_CODE_OVERRIDE}" +@@ -78,7 +78,7 @@ + fi else ( - nohup "$ATOM_PATH" --executed-from="$(pwd)" --pid=$$ "$@" > "$ATOM_HOME/nohup.out" 2>&1 @@ -15,6 +19,7 @@ diff -ur a/atom.sh b/atom.sh if [ $? -ne 0 ]; then cat "$ATOM_HOME/nohup.out" exit $? + diff -ur a/src/main-process/atom-window.js b/src/main-process/atom-window.js --- a/src/main-process/atom-window.js 2018-05-19 06:49:28.000000000 +0800 +++ b/src/main-process/atom-window.js 2018-06-03 20:18:09.254908066 +0800 diff --git a/fix-atom-sh.patch b/fix-atom-sh.patch index 6d7106a9b316..98d294918a28 100644 --- a/fix-atom-sh.patch +++ b/fix-atom-sh.patch @@ -27,10 +27,10 @@ - ;; -esac - - export ATOM_DISABLE_SHELLING_OUT_FOR_ENVIRONMENT=true - - while getopts ":wtfvh-:" opt; do -@@ -65,95 +41,19 @@ + # 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 @@ ATOM_HOME="${ATOM_HOME:-$HOME/.atom}" mkdir -p "$ATOM_HOME" @@ -52,7 +52,12 @@ - if [ ! -z "${ATOM_APP_NAME}" ]; then - # If ATOM_APP_NAME is known, use it as the executable name - ATOM_EXECUTABLE_NAME="${ATOM_APP_NAME%.*}" -- 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 - # Else choose it from the inferred channel name - if [ "$CHANNEL" == 'beta' ]; then - ATOM_EXECUTABLE_NAME="Atom Beta" @@ -81,11 +86,17 @@ - exit 1 - fi - fi -- fi ++ exit ${ATOM_EXIT} + fi - - if [ $EXPECT_OUTPUT ]; then - "$ATOM_PATH/$ATOM_APP_NAME/Contents/MacOS/$ATOM_EXECUTABLE_NAME" --executed-from="$(pwd)" --pid=$$ "$@" -- exit $? +- ATOM_EXIT=$? +- if [ ${ATOM_EXIT} -eq 0 ] && [ -n "${EXIT_CODE_OVERRIDE}" ]; then +- exit "${EXIT_CODE_OVERRIDE}" +- else +- exit ${ATOM_EXIT} +- fi - else - open -a "$ATOM_PATH/$ATOM_APP_NAME" -n --args --executed-from="$(pwd)" --pid=$$ --path-environment="$PATH" "$@" - fi @@ -114,15 +125,12 @@ - - if [ $EXPECT_OUTPUT ]; then - "$ATOM_PATH" --executed-from="$(pwd)" --pid=$$ "$@" -+if [ $EXPECT_OUTPUT ]; then -+ "$ATOM_PATH" --executed-from="$(pwd)" --pid=$$ "$@" -+ exit $? -+else -+ ( -+ nohup "$ATOM_PATH" --executed-from="$(pwd)" --pid=$$ "$@" > "$ATOM_HOME/nohup.out" 2>&1 -+ if [ $? -ne 0 ]; then -+ cat "$ATOM_HOME/nohup.out" - exit $? +- ATOM_EXIT=$? +- if [ ${ATOM_EXIT} -eq 0 ] && [ -n "${EXIT_CODE_OVERRIDE}" ]; then +- exit "${EXIT_CODE_OVERRIDE}" +- else +- exit ${ATOM_EXIT} +- fi - else - ( - nohup "$ATOM_PATH" --executed-from="$(pwd)" --pid=$$ "$@" > "$ATOM_HOME/nohup.out" 2>&1 @@ -131,6 +139,12 @@ - exit $? - fi - ) & ++else ++ ( ++ nohup "$ATOM_PATH" --executed-from="$(pwd)" --pid=$$ "$@" > "$ATOM_HOME/nohup.out" 2>&1 ++ if [ $? -ne 0 ]; then ++ cat "$ATOM_HOME/nohup.out" ++ exit $? fi + ) & fi diff --git a/fix-license-path.patch b/fix-license-path.patch index 6612b23ad0ca..ecffc1eb0cab 100644 --- a/fix-license-path.patch +++ b/fix-license-path.patch @@ -1,22 +1,22 @@ --- a/src/main-process/atom-application.js +++ b/src/main-process/atom-application.js -@@ -430,7 +430,7 @@ - this.openPathOnEvent('application:open-your-keymap', 'atom://.atom/keymap') - this.openPathOnEvent('application:open-your-snippets', 'atom://.atom/snippets') - this.openPathOnEvent('application:open-your-stylesheet', 'atom://.atom/stylesheet') -- this.openPathOnEvent('application:open-license', path.join(process.resourcesPath, 'LICENSE.md')) -+ this.openPathOnEvent('application:open-license', '/usr/share/licenses/atom/LICENSE.md') +@@ -716,7 +716,7 @@ + ); + this.openPathOnEvent( + 'application:open-license', +- path.join(process.resourcesPath, 'LICENSE.md') ++ '/usr/share/licenses/atom/LICENSE.md' + ); this.configFile.onDidChange(settings => { - for (let window of this.getAllWindows()) { --- a/src/workspace.js +++ b/src/workspace.js -@@ -1132,7 +1132,7 @@ +@@ -1300,7 +1300,7 @@ // Open Atom's license in the active pane. - openLicense () { -- return this.open(path.join(process.resourcesPath, 'LICENSE.md')) -+ return this.open('/usr/share/licenses/atom/LICENSE.md') + openLicense() { +- return this.open(path.join(process.resourcesPath, 'LICENSE.md')); ++ return this.open('/usr/share/licenses/atom/LICENSE.md'); } // Synchronously open the given URI in the active pane. **Only use this method diff --git a/fix-middle-click.patch b/fix-middle-click.patch deleted file mode 100644 index ae8d672d7d01..000000000000 --- a/fix-middle-click.patch +++ /dev/null @@ -1,21 +0,0 @@ -From 82e767bfafcc882f3c3811bb9eb008b8f7c2c731 Mon Sep 17 00:00:00 2001 -From: Mario Pilz <mario@pilz-at.net> -Date: Fri, 21 Dec 2018 03:48:36 +0100 -Subject: [PATCH] Fix tab close on middle click for Electron 3 - ---- - lib/tab-bar-view.coffee | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/lib/tab-bar-view.coffee b/lib/tab-bar-view.coffee -index 93e958e..2b91ad6 100644 ---- a/lib/tab-bar-view.coffee -+++ b/lib/tab-bar-view.coffee -@@ -87,6 +87,7 @@ class TabBarView - - @element.addEventListener "mousedown", @onMouseDown.bind(this) - @element.addEventListener "click", @onClick.bind(this) -+ @element.addEventListener "auxclick", @onClick.bind(this) - @element.addEventListener "dblclick", @onDoubleClick.bind(this) - - @onDropOnOtherWindow = @onDropOnOtherWindow.bind(this) diff --git a/fix-restart.patch b/fix-restart.patch index 81659517d95d..c12d3346157f 100644 --- a/fix-restart.patch +++ b/fix-restart.patch @@ -1,11 +1,11 @@ --- a/src/main-process/atom-application.js +++ b/src/main-process/atom-application.js -@@ -1370,7 +1370,7 @@ +@@ -2047,7 +2047,7 @@ } - restart () { -- const args = [] -+ const args = ['/usr/lib/atom/atom'] - if (this.safeMode) args.push('--safe') - if (this.logFile != null) args.push(`--log-file=${this.logFile}`) - if (this.socketPath != null) args.push(`--socket-path=${this.socketPath}`) + restart() { +- const args = []; ++ const args = ['/usr/lib/atom/atom']; + if (this.safeMode) args.push('--safe'); + if (this.logFile != null) args.push(`--log-file=${this.logFile}`); + if (this.userDataDir != null) diff --git a/git-utils.patch b/git-utils.patch new file mode 100644 index 000000000000..93bb181f1d6a --- /dev/null +++ b/git-utils.patch @@ -0,0 +1,11 @@ +--- a/binding.gyp ++++ b/binding.gyp +@@ -162,6 +162,8 @@ + 'deps/libgit2/src/message.h', + 'deps/libgit2/src/mwindow.c', + 'deps/libgit2/src/mwindow.h', ++ 'deps/libgit2/src/net.c', ++ 'deps/libgit2/src/net.h', + 'deps/libgit2/src/netops.c', + 'deps/libgit2/src/netops.h', + 'deps/libgit2/src/notes.c', diff --git a/no-unsafe-eval-warning.patch b/no-unsafe-eval-warning.patch new file mode 100644 index 000000000000..c54d91a18718 --- /dev/null +++ b/no-unsafe-eval-warning.patch @@ -0,0 +1,11 @@ +--- a/static/index.js ++++ b/static/index.js +@@ -13,6 +13,8 @@ + let blobStore = null; + let useSnapshot = false; + ++ process.env.ELECTRON_DISABLE_SECURITY_WARNINGS = true; ++ + const startupMarkers = electron.remote.getCurrentWindow().startupMarkers; + + if (startupMarkers) { diff --git a/node-env-production.patch b/node-env-production.patch new file mode 100644 index 000000000000..1d2904b49313 --- /dev/null +++ b/node-env-production.patch @@ -0,0 +1,13 @@ +--- a/static/index.js ++++ b/static/index.js +@@ -85,6 +85,10 @@ + ); + } + ++ if (!devMode) { ++ process.env.NODE_ENV = 'production'; ++ } ++ + const FileSystemBlobStore = useSnapshot + ? snapshotResult.customRequire('../src/file-system-blob-store.js') + : require('../src/file-system-blob-store'); diff --git a/use-system-apm.patch b/use-system-apm.patch index 55be464c06a4..9cbcf8c75fb6 100644 --- a/use-system-apm.patch +++ b/use-system-apm.patch @@ -1,32 +1,37 @@ --- a/script/lib/run-apm-install.js +++ b/script/lib/run-apm-install.js -@@ -8,11 +8,8 @@ - const installEnv = Object.assign({}, process.env) +@@ -8,10 +8,7 @@ + const installEnv = Object.assign({}, process.env); // Set resource path so that apm can load metadata related to Atom. - installEnv.ATOM_RESOURCE_PATH = CONFIG.repositoryRootPath + installEnv.ATOM_RESOURCE_PATH = CONFIG.repositoryRootPath; - // Set our target (Electron) version so that node-pre-gyp can download the - // proper binaries. -- installEnv.npm_config_target = CONFIG.appMetadata.electronVersion - childProcess.execFileSync( -- CONFIG.getApmBinPath(), -+ 'apm', - ['--loglevel=error', ci ? 'ci' : 'install'], - {env: installEnv, cwd: packagePath, stdio: stdioOptions || 'inherit'} - ) +- installEnv.npm_config_target = CONFIG.appMetadata.electronVersion; +- childProcess.execFileSync(CONFIG.getApmBinPath(), [ci ? 'ci' : 'install'], { ++ childProcess.execFileSync('apm', [ci ? 'ci' : 'install'], { + env: installEnv, + cwd: packagePath, + stdio: stdioOptions || 'inherit' --- a/src/package-manager.js +++ b/src/package-manager.js -@@ -169,13 +169,7 @@ - return configPath || this.apmPath +@@ -194,19 +194,7 @@ + return configPath || this.apmPath; } -- const commandName = process.platform === 'win32' ? 'apm.cmd' : 'apm' -- const apmRoot = path.join(process.resourcesPath, 'app', 'apm') -- this.apmPath = path.join(apmRoot, 'bin', commandName) +- const commandName = process.platform === 'win32' ? 'apm.cmd' : 'apm'; +- const apmRoot = path.join(process.resourcesPath, 'app', 'apm'); +- this.apmPath = path.join(apmRoot, 'bin', commandName); - if (!fs.isFileSync(this.apmPath)) { -- this.apmPath = path.join(apmRoot, 'node_modules', 'atom-package-manager', 'bin', commandName) +- this.apmPath = path.join( +- apmRoot, +- 'node_modules', +- 'atom-package-manager', +- 'bin', +- commandName +- ); - } -- return this.apmPath -+ return '/usr/lib/node_modules/atom-package-manager/bin/apm' +- return this.apmPath; ++ return '/usr/lib/node_modules/atom-package-manager/bin/apm'; } // Public: Get the paths being used to look for packages. diff --git a/use-system-electron.patch b/use-system-electron.patch index 0f2bdec2288e..2cbc8b94e495 100644 --- a/use-system-electron.patch +++ b/use-system-electron.patch @@ -4,40 +4,37 @@ "url": "https://github.com/atom/atom/issues" }, "license": "MIT", -- "electronVersion": "2.0.18", +- "electronVersion": "4.2.7", "dependencies": { - "@atom/nsfw": "1.0.18", + "@atom/nsfw": "1.0.26", "@atom/source-map-support": "^0.3.4", --- a/script/build +++ b/script/build -@@ -2,10 +2,6 @@ - - 'use strict' - --// Run bootstrap first to ensure all the dependencies used later in this script --// are installed. --require('./bootstrap') -- - // Needed so we can require src/module-cache.coffee during generateModuleCache - require('coffee-script/register') - require('colors') -@@ -28,7 +24,6 @@ +@@ -33,7 +33,7 @@ .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') -@@ -60,7 +55,6 @@ +@@ -63,12 +63,12 @@ + }) + + const CONFIG = require('./config') +-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() -@@ -79,67 +73,5 @@ +@@ -87,73 +87,5 @@ if (!argv.generateApiDocs) { binariesPromise @@ -48,16 +45,22 @@ - case 'darwin': { - if (argv.codeSign) { - codeSignOnMac(packagedAppPath) +- } else if (argv.testSign) { +- testSignOnMac(packagedAppPath) - } else { - console.log('Skipping code-signing. Specify the --code-sign option to perform code-signing'.gray) - } - break - } - case 'win32': { +- if (argv.testSign) { +- console.log('Test signing is not supported on Windows, skipping.'.gray) +- } +- - if (argv.codeSign) { -- const executablesToSign = [ path.join(packagedAppPath, 'Atom.exe') ] +- const executablesToSign = [ path.join(packagedAppPath, CONFIG.executableName) ] - if (argv.createWindowsInstaller) { -- executablesToSign.push(path.join(__dirname, 'node_modules', 'electron-winstaller', 'vendor', 'Update.exe')) +- executablesToSign.push(path.join(__dirname, 'node_modules', '@atom', 'electron-winstaller', 'vendor', 'Squirrel.exe')) - } - codeSignOnWindows(executablesToSign) - } else { @@ -107,104 +110,118 @@ } --- a/script/lib/generate-startup-snapshot.js +++ b/script/lib/generate-startup-snapshot.js -@@ -89,7 +89,7 @@ - } else if (process.platform === 'win32') { - nodeBundledInElectronPath = path.join(packagedAppPath, 'atom.exe') +@@ -265,17 +265,14 @@ + CONFIG.executableName + ); } else { -- nodeBundledInElectronPath = path.join(packagedAppPath, 'atom') -+ nodeBundledInElectronPath = 'electron' +- nodeBundledInElectronPath = path.join( +- packagedAppPath, +- CONFIG.executableName +- ); ++ nodeBundledInElectronPath = 'electron4'; } childProcess.execFileSync( nodeBundledInElectronPath, -@@ -97,6 +97,7 @@ - {env: Object.assign({}, process.env, {ELECTRON_RUN_AS_NODE: 1})} - ) - -+/* - const generatedStartupBlobPath = path.join(CONFIG.buildOutputPath, 'snapshot_blob.bin') - console.log(`Generating startup blob at "${generatedStartupBlobPath}"`) - childProcess.execFileSync( -@@ -114,5 +115,6 @@ - console.log(`Moving generated startup blob into "${startupBlobDestinationPath}"`) - fs.unlinkSync(startupBlobDestinationPath) - fs.renameSync(generatedStartupBlobPath, startupBlobDestinationPath) -+*/ - }) - } + [verifySnapshotScriptPath, snapshotScriptPath], + { env: Object.assign({}, process.env, { ELECTRON_RUN_AS_NODE: 1 }) } + ); +- ++ /* + console.log('Generating startup blob with mksnapshot'); + childProcess.spawnSync(process.execPath, [ + path.join( +@@ -317,5 +314,6 @@ + destinationPath + ); + } ++ */ + }); + }; --- a/script/package.json +++ b/script/package.json -@@ -8,9 +8,7 @@ +@@ -10,9 +10,7 @@ "coffeelint": "1.15.7", "colors": "1.1.2", "donna": "1.0.16", -- "electron-chromedriver": "~2.0", - "electron-link": "0.3.3", -- "electron-mksnapshot": "~2.0", - "electron-packager": "7.3.0", - "electron-winstaller": "2.6.4", - "fs-admin": "^0.1.5", +- "electron-chromedriver": "^4.2.0", + "electron-link": "0.4.0", +- "electron-mksnapshot": "^4.2.0", + "electron-packager": "12.2.0", + "@atom/electron-winstaller": "0.0.1", + "eslint": "^5.16.0", --- a/src/compile-cache.js +++ b/src/compile-cache.js -@@ -122,7 +122,7 @@ exports.install = function (resourcesPath, nodeRequire) { +@@ -138,7 +138,7 @@ exports.install = function(resourcesPath, nodeRequire) { return { column, line: row, - source: path.join(resourcesPath, 'app', 'static', relativePath), + source: path.join(resourcesPath, 'static', relativePath), name: null - } + }; } - function getConfig () { +--- a/src/main-process/atom-window.js ++++ b/src/main-process/atom-window.js +@@ -47,7 +47,8 @@ + // Disable the `auxclick` feature so that `click` events are triggered in + // response to a middle-click. + // (Ref: https://github.com/atom/atom/pull/12696#issuecomment-290496960) +- disableBlinkFeatures: 'Auxclick' ++ disableBlinkFeatures: 'Auxclick', ++ nodeIntegration: true + } + }; + --- a/src/module-cache.js +++ b/src/module-cache.js -@@ -227,7 +227,7 @@ - } - - function registerBuiltins (devMode) { -- if (devMode || !cache.resourcePath.startsWith(`${process.resourcesPath}${path.sep}`)) { -+ if (devMode || !cache.resourcePath.startsWith('/usr/lib/atom/')) { - const fs = require('fs-plus') - const atomJsPath = path.join(cache.resourcePath, 'exports', 'atom.js') - if (fs.isFileSync(atomJsPath)) { cache.builtins.atom = atomJsPath } +@@ -270,7 +270,7 @@ + function registerBuiltins(devMode) { + if ( + devMode || +- !cache.resourcePath.startsWith(`${process.resourcesPath}${path.sep}`) ++ !cache.resourcePath.startsWith('/usr/lib/atom/') + ) { + const fs = require('fs-plus'); + const atomJsPath = path.join(cache.resourcePath, 'exports', 'atom.js'); --- a/src/package-manager.js +++ b/src/package-manager.js -@@ -825,7 +825,7 @@ module.exports = class PackageManager { - } - - isBundledPackagePath (packagePath) { -- if (this.devMode && !this.resourcePath.startsWith(`${process.resourcesPath}${path.sep}`)) { -+ if (this.devMode && !this.resourcePath.startsWith('/usr/lib/atom/')) { - return false +@@ -939,7 +939,7 @@ + isBundledPackagePath(packagePath) { + if ( + this.devMode && +- !this.resourcePath.startsWith(`${process.resourcesPath}${path.sep}`) ++ !this.resourcePath.startsWith('/usr/lib/atom/') + ) { + return false; } - --- a/src/task-bootstrap.js +++ b/src/task-bootstrap.js -@@ -3,7 +3,7 @@ const [compileCachePath, taskPath] = process.argv.slice(2) +@@ -3,7 +3,7 @@ - const CompileCache = require('./compile-cache') - CompileCache.setCacheDirectory(compileCachePath) --CompileCache.install(`${process.resourcesPath}`, require) -+CompileCache.install('/usr/lib/atom', require) + const CompileCache = require('./compile-cache'); + CompileCache.setCacheDirectory(compileCachePath); +-CompileCache.install(`${process.resourcesPath}`, require); ++CompileCache.install('/usr/lib/atom', require); - const setupGlobals = function () { - global.attachEvent = function () {} + const setupGlobals = function() { + global.attachEvent = function() {}; --- a/static/index.js +++ b/static/index.js -@@ -23,7 +23,7 @@ - process.resourcesPath = path.normalize(process.resourcesPath) - - setupAtomHome() -- const devMode = getWindowLoadSettings().devMode || !getWindowLoadSettings().resourcePath.startsWith(process.resourcesPath + path.sep) -+ const devMode = getWindowLoadSettings().devMode || !getWindowLoadSettings().resourcePath.startsWith('/usr/lib/atom') - useSnapshot = !devMode && typeof snapshotResult !== 'undefined' +@@ -40,7 +40,7 @@ + const devMode = + getWindowLoadSettings().devMode || + !getWindowLoadSettings().resourcePath.startsWith( +- process.resourcesPath + path.sep ++ '/usr/lib/atom' + ); + useSnapshot = !devMode && typeof snapshotResult !== 'undefined'; - if (devMode) { -@@ -90,7 +90,7 @@ - function setupWindow () { - const CompileCache = useSnapshot ? snapshotResult.customRequire('../src/compile-cache.js') : require('../src/compile-cache') - CompileCache.setAtomHomeDirectory(process.env.ATOM_HOME) -- CompileCache.install(process.resourcesPath, require) -+ CompileCache.install('/usr/lib/atom', require) +@@ -134,7 +134,7 @@ + ? snapshotResult.customRequire('../src/compile-cache.js') + : require('../src/compile-cache'); + CompileCache.setAtomHomeDirectory(process.env.ATOM_HOME); +- CompileCache.install(process.resourcesPath, require); ++ CompileCache.install('/usr/lib/atom', require); - const ModuleCache = useSnapshot ? snapshotResult.customRequire('../src/module-cache.js') : require('../src/module-cache') - ModuleCache.register(getWindowLoadSettings()) + const ModuleCache = useSnapshot + ? snapshotResult.customRequire('../src/module-cache.js') |