summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorfrantic10482018-06-03 22:36:05 +0800
committerfrantic10482018-06-03 22:36:05 +0800
commit710e579d4db40869ff23b374a0b2d21b4811c5f7 (patch)
tree62e68febaa6c02873f7e6b4681189f5c0e0bacd2
downloadaur-710e579d4db40869ff23b374a0b2d21b4811c5f7.tar.gz
initial pkg, at version 1.27.1-1
replaces atom-editor-transparent 1.18.0-1
-rw-r--r--.SRCINFO45
-rw-r--r--.gitignore11
-rw-r--r--PKGBUILD132
-rw-r--r--atom.js33
-rw-r--r--dugite-use-system-git.patch24
-rw-r--r--enable-transparency.patch29
-rw-r--r--fix-atom-sh.patch127
-rw-r--r--fix-license-path.patch22
-rw-r--r--fix-node8.patch11
-rw-r--r--fix-restart.patch11
-rw-r--r--symbols-view-use-system-ctags.patch11
-rw-r--r--use-system-apm.patch32
-rw-r--r--use-system-electron.patch212
13 files changed, 700 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..83243db06fdb
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,45 @@
+# Generated by mksrcinfo v8
+# Sun Jun 3 14:31:20 UTC 2018
+pkgbase = atom-transparent
+ pkgdesc = A hackable text editor for the 21st Century - with transparent background support
+ pkgver = 1.27.1
+ pkgrel = 1
+ url = https://github.com/atom/atom
+ arch = x86_64
+ license = MIT
+ license = custom
+ makedepends = git
+ makedepends = npm
+ depends = apm
+ depends = electron
+ depends = libxkbfile
+ optdepends = ctags: symbol indexing support
+ optdepends = git: Git and GitHub integration
+ conflicts = atom-editor
+ replaces = atom-editor-transparent
+ options = !emptydirs
+ source = atom-1.27.1.tar.gz::https://github.com/atom/atom/archive/v1.27.1.tar.gz
+ source = atom.js
+ source = dugite-use-system-git.patch
+ source = fix-atom-sh.patch
+ source = fix-license-path.patch
+ source = fix-node8.patch
+ source = fix-restart.patch
+ source = symbols-view-use-system-ctags.patch
+ source = use-system-apm.patch
+ source = use-system-electron.patch
+ source = enable-transparency.patch
+ sha256sums = 147c237d944d0261ac2caf525badd8c76cf92da99bb6901c89e491fb5f0c16bf
+ sha256sums = cdf87ab82cfcf69e8904684c59b08c35a68540ea16ab173fce06037ac341efcd
+ sha256sums = 3fadee5a2d8c1ff35e085f9b9f3cf2eb71627bda9e8b10c2a0bd85b268591bf6
+ sha256sums = d8d77adebd7bd4eaf024988c68c30dc6b968044f7a6381227d13b6d77fa2b442
+ sha256sums = 7f0142c91e24236a3a6dcc70af9d4217f65c5a764091876a916e3bbafa4ed0fa
+ sha256sums = eb771d7c009be8d48c1387ed63f3e575dc12f3bd69455b4be4b78ab57cb49b86
+ sha256sums = f81a8dd53403fe76d80716b65d69bec141fae0b1a9a6ef56314f9e815e48f132
+ sha256sums = 3c68e6b3751313e1d386e721f8f819fb051351fb2cf8e753b1d773a0f475fef8
+ sha256sums = 4b91a1acd112838bd001f4e3c555de2a5fc7446c9eab6bc5dae0ca640306e81b
+ sha256sums = 1d0ff39e5bc5c0bfbb08a533bff9fb834a8dbc70d280bf93b5e2649fff181221
+ sha256sums = 2cb262dfd15f67dd1a01a9b314983f535da8b06ce4a814d214e12ec369631d58
+
+pkgname = atom-transparent
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..bb78200994e5
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,11 @@
+#dolphin
+.directory
+
+#pkg building files
+
+*.7z
+*.tar.xz
+*.tar.gz
+
+src/
+pkg/
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..c5c37c8b3fc7
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,132 @@
+# Maintainer: Frantic1048 <archer@frantic1048.com>
+# Upstream URL: https://github.com/atom/atom
+
+pkgname=atom-transparent
+pkgver=1.27.1
+pkgrel=1
+pkgdesc='A hackable text editor for the 21st Century - with transparent background support'
+arch=('x86_64')
+url='https://github.com/atom/atom'
+license=('MIT' 'custom')
+depends=('apm' 'electron' 'libxkbfile')
+makedepends=('git' 'npm')
+optdepends=('ctags: symbol indexing support'
+ 'git: Git and GitHub integration')
+conflicts=('atom-editor')
+replaces=('atom-editor-transparent')
+options=(!emptydirs)
+source=("atom-${pkgver}.tar.gz::https://github.com/atom/atom/archive/v${pkgver}.tar.gz"
+ 'atom.js'
+ 'dugite-use-system-git.patch'
+ 'fix-atom-sh.patch'
+ 'fix-license-path.patch'
+ 'fix-node8.patch'
+ 'fix-restart.patch'
+ 'symbols-view-use-system-ctags.patch'
+ 'use-system-apm.patch'
+ 'use-system-electron.patch'
+ 'enable-transparency.patch')
+sha256sums=('147c237d944d0261ac2caf525badd8c76cf92da99bb6901c89e491fb5f0c16bf'
+ 'cdf87ab82cfcf69e8904684c59b08c35a68540ea16ab173fce06037ac341efcd'
+ '3fadee5a2d8c1ff35e085f9b9f3cf2eb71627bda9e8b10c2a0bd85b268591bf6'
+ 'd8d77adebd7bd4eaf024988c68c30dc6b968044f7a6381227d13b6d77fa2b442'
+ '7f0142c91e24236a3a6dcc70af9d4217f65c5a764091876a916e3bbafa4ed0fa'
+ 'eb771d7c009be8d48c1387ed63f3e575dc12f3bd69455b4be4b78ab57cb49b86'
+ 'f81a8dd53403fe76d80716b65d69bec141fae0b1a9a6ef56314f9e815e48f132'
+ '3c68e6b3751313e1d386e721f8f819fb051351fb2cf8e753b1d773a0f475fef8'
+ '4b91a1acd112838bd001f4e3c555de2a5fc7446c9eab6bc5dae0ca640306e81b'
+ '1d0ff39e5bc5c0bfbb08a533bff9fb834a8dbc70d280bf93b5e2649fff181221'
+ '2cb262dfd15f67dd1a01a9b314983f535da8b06ce4a814d214e12ec369631d58')
+
+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-node8.patch
+ patch -Np1 -i "${srcdir}"/fix-restart.patch
+ patch -Np1 -i "${srcdir}"/enable-transparency.patch
+
+ # Workaround for Node 10
+ sed -e 's|"electron-link": "0.2.0"|"electron-link": "../../electron-link"|' \
+ -i script/package.json
+ cd ..
+ git clone https://github.com/atom/electron-link.git
+ cd electron-link
+ git checkout v0.2.0
+ sed -e 's/"leveldown": "^1.6.0"/"leveldown": "^2.0.1"/' -i package.json
+ npm install
+ npx babel src -d lib
+ cd node_modules/levelup
+ sed -e 's/"leveldown": "^1.1.0"/"leveldown": "^2.0.1"/' -i package.json
+}
+
+build() {
+ cd "${srcdir}/atom-${pkgver}"
+
+ export ATOM_RESOURCE_PATH="$srcdir/atom-$pkgver"
+ # If unset, ~/.atom/.node-gyp/.atom/.npm is used
+ export NPM_CONFIG_CACHE="${HOME}/.atom/.npm"
+ apm clean
+ apm install
+
+ # Use system ctags
+ cd node_modules/symbols-view
+ patch -Np1 -i "${srcdir}"/symbols-view-use-system-ctags.patch
+ rm -r vendor
+ cd ../..
+
+ # Use system git (TODO: set LOCAL_GIT_DIRECTORY=/usr)
+ cd node_modules/dugite
+ patch -Np1 -i "${srcdir}"/dugite-use-system-git.patch
+ rm -r git
+ cd ../..
+
+ cd script
+ npm install
+ ./build
+}
+
+package() {
+ cd "${srcdir}/atom-${pkgver}"
+
+ 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 -d -m 755 "${pkgdir}/usr/share/applications"
+ sed -e "s|<%= appName %>|Atom|" \
+ -e "s/<%= description %>/${pkgdesc}/" \
+ -e "s|<%= installDir %>/share/<%= appFileName %>/atom|/usr/lib/atom/atom|" \
+ -e "s|<%= iconPath %>|atom|" \
+ resources/linux/atom.desktop.in > "${pkgdir}/usr/share/applications/atom.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
+ done
+ ln -sf ../../../share/icons/hicolor/1024x1024/apps/atom.png \
+ "${pkgdir}"/usr/lib/atom/resources/atom.png
+
+ install -D -m 755 atom.sh "${pkgdir}/usr/bin/atom"
+
+ 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))"
+
+ # Remove useless stuff
+ rm "${pkgdir}"/usr/lib/atom/node_modules/.bin/pegjs
+ find "${pkgdir}"/usr/lib/atom/node_modules \
+ -name "*.a" -exec rm '{}' \; \
+ -or -name "*.bat" -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 '{}' \;
+}
diff --git a/atom.js b/atom.js
new file mode 100644
index 000000000000..386929835763
--- /dev/null
+++ b/atom.js
@@ -0,0 +1,33 @@
+#!/usr/bin/electron
+
+const name = "atom";
+
+const {app} = require("electron");
+const fs = require("fs");
+const Module = require("module");
+const {join} = require("path");
+const vm = require("vm");
+
+// Change command name.
+const fd = fs.openSync("/proc/self/comm", fs.constants.O_WRONLY);
+fs.writeSync(fd, name);
+fs.closeSync(fd);
+
+// Remove first command line argument (/usr/bin/electron).
+process.argv.splice(0, 1);
+
+// Set application paths.
+const appPath = __dirname;
+const packageJson = require(join(appPath, "package.json"));
+const productName = packageJson.productName;
+app.setAppPath(appPath);
+app.setDesktopName(name + ".desktop");
+app.setName(productName);
+app.setPath("userCache", join(app.getPath("cache"), productName));
+app.setPath("userData", join(app.getPath("appData"), productName));
+app.setVersion(packageJson.version);
+
+// Run the application.
+const startupJs = fs.readFileSync(join(appPath, "startup.js"), "utf-8");
+vm.runInThisContext(startupJs);
+Module._load(appPath, Module, true);
diff --git a/dugite-use-system-git.patch b/dugite-use-system-git.patch
new file mode 100644
index 000000000000..3f6feec740a7
--- /dev/null
+++ b/dugite-use-system-git.patch
@@ -0,0 +1,24 @@
+--- a/build/lib/git-environment.js
++++ b/build/lib/git-environment.js
+@@ -18,7 +18,7 @@
+ return path.resolve(process.env.LOCAL_GIT_DIRECTORY);
+ }
+ else {
+- return resolveEmbeddedGitDir();
++ return '/usr';
+ }
+ }
+ /**
+@@ -100,9 +100,9 @@
+ if (!env.GIT_SSL_CAINFO && !env.LOCAL_GIT_DIRECTORY) {
+ // use the SSL certificate bundle included in the distribution only
+ // when using embedded Git and not providing your own bundle
+- const distDir = resolveEmbeddedGitDir();
+- const sslCABundle = `${distDir}/ssl/cacert.pem`;
+- env.GIT_SSL_CAINFO = sslCABundle;
++ // const distDir = resolveEmbeddedGitDir();
++ // const sslCABundle = `${distDir}/ssl/cacert.pem`;
++ // env.GIT_SSL_CAINFO = sslCABundle;
+ }
+ }
+ return { env, gitLocation };
diff --git a/enable-transparency.patch b/enable-transparency.patch
new file mode 100644
index 000000000000..2c00b6d6b69c
--- /dev/null
+++ b/enable-transparency.patch
@@ -0,0 +1,29 @@
+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"
+
+ if [ $EXPECT_OUTPUT ]; then
+- "$ATOM_PATH" --executed-from="$(pwd)" --pid=$$ "$@"
++ "$ATOM_PATH" --executed-from="$(pwd)" --pid=$$ --enable-transparent-visuals --disable-gpu "$@"
+ exit $?
+ else
+ (
+- nohup "$ATOM_PATH" --executed-from="$(pwd)" --pid=$$ "$@" > "$ATOM_HOME/nohup.out" 2>&1
++ nohup "$ATOM_PATH" --executed-from="$(pwd)" --pid=$$ --enable-transparent-visuals --disable-gpu "$@" > "$ATOM_HOME/nohup.out" 2>&1
+ 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
+@@ -31,6 +31,8 @@
+ this.closedPromise = new Promise(resolve => { this.resolveClosedPromise = resolve })
+
+ const options = {
++ frame: false,
++ transparent: true,
+ show: false,
+ title: 'Atom',
+ tabbingIdentifier: 'atom',
diff --git a/fix-atom-sh.patch b/fix-atom-sh.patch
new file mode 100644
index 000000000000..e044994e4c4a
--- /dev/null
+++ b/fix-atom-sh.patch
@@ -0,0 +1,127 @@
+--- a/atom.sh
++++ b/atom.sh
+@@ -1,26 +1,5 @@
+ #!/bin/bash
+
+-if [ "$(uname)" == 'Darwin' ]; then
+- OS='Mac'
+-elif [ "$(expr substr $(uname -s) 1 5)" == 'Linux' ]; then
+- OS='Linux'
+-else
+- echo "Your platform ($(uname -a)) is not supported."
+- exit 1
+-fi
+-
+-case $(basename $0) in
+- atom-beta)
+- CHANNEL=beta
+- ;;
+- atom-dev)
+- CHANNEL=dev
+- ;;
+- *)
+- CHANNEL=stable
+- ;;
+-esac
+-
+ export ATOM_DISABLE_SHELLING_OUT_FOR_ENVIRONMENT=true
+
+ while getopts ":wtfvh-:" opt; do
+@@ -59,85 +38,22 @@
+ exec 2> /dev/null
+ fi
+
+-if [ $OS == 'Mac' ]; then
+- if [ -L "$0" ]; then
+- SCRIPT="$(readlink "$0")"
+- else
+- SCRIPT="$0"
+- fi
+- ATOM_APP="$(dirname "$(dirname "$(dirname "$(dirname "$SCRIPT")")")")"
+- if [ "$ATOM_APP" == . ]; then
+- unset ATOM_APP
+- else
+- ATOM_PATH="$(dirname "$ATOM_APP")"
+- ATOM_APP_NAME="$(basename "$ATOM_APP")"
+- fi
+-
+- if [ "$CHANNEL" == 'beta' ]; then
+- ATOM_EXECUTABLE_NAME="Atom Beta"
+- else
+- ATOM_EXECUTABLE_NAME="Atom"
+- fi
+-
+- if [ -z "${ATOM_PATH}" ]; then
+- # If ATOM_PATH isn't set, check /Applications and then ~/Applications for Atom.app
+- if [ -x "/Applications/$ATOM_APP_NAME" ]; then
+- ATOM_PATH="/Applications"
+- elif [ -x "$HOME/Applications/$ATOM_APP_NAME" ]; then
+- ATOM_PATH="$HOME/Applications"
+- else
+- # We haven't found an Atom.app, use spotlight to search for Atom
+- ATOM_PATH="$(mdfind "kMDItemCFBundleIdentifier == 'com.github.atom'" | grep -v ShipIt | head -1 | xargs -0 dirname)"
+-
+- # Exit if Atom can't be found
+- if [ ! -x "$ATOM_PATH/$ATOM_APP_NAME" ]; then
+- 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}."
+- exit 1
+- fi
+- fi
+- fi
+-
+- if [ $EXPECT_OUTPUT ]; then
+- "$ATOM_PATH/$ATOM_APP_NAME/Contents/MacOS/$ATOM_EXECUTABLE_NAME" --executed-from="$(pwd)" --pid=$$ "$@"
+- exit $?
+- else
+- open -a "$ATOM_PATH/$ATOM_APP_NAME" -n --args --executed-from="$(pwd)" --pid=$$ --path-environment="$PATH" "$@"
+- fi
+-elif [ $OS == 'Linux' ]; then
+- SCRIPT=$(readlink -f "$0")
+- USR_DIRECTORY=$(readlink -f $(dirname $SCRIPT)/..)
+-
+- case $CHANNEL in
+- beta)
+- ATOM_PATH="$USR_DIRECTORY/share/atom-beta/atom"
+- ;;
+- dev)
+- ATOM_PATH="$USR_DIRECTORY/share/atom-dev/atom"
+- ;;
+- *)
+- ATOM_PATH="$USR_DIRECTORY/share/atom/atom"
+- ;;
+- esac
+-
+- ATOM_HOME="${ATOM_HOME:-$HOME/.atom}"
+- mkdir -p "$ATOM_HOME"
++ATOM_PATH="/usr/lib/atom/atom"
+
+- : ${TMPDIR:=/tmp}
++ATOM_HOME="${ATOM_HOME:-$HOME/.atom}"
++mkdir -p "$ATOM_HOME"
+
+- [ -x "$ATOM_PATH" ] || ATOM_PATH="$TMPDIR/atom-build/Atom/atom"
+-
+- 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 $?
+- 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
++ ) &
+ fi
+
+ # Exits this process when Atom is used as $EDITOR
diff --git a/fix-license-path.patch b/fix-license-path.patch
new file mode 100644
index 000000000000..f4c06bb28796
--- /dev/null
+++ b/fix-license-path.patch
@@ -0,0 +1,22 @@
+--- a/src/main-process/atom-application.js
++++ b/src/main-process/atom-application.js
+@@ -414,7 +414,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')
+
+ this.configFile.onDidChange(settings => {
+ for (let window of this.getAllWindows()) {
+--- a/src/workspace.js
++++ b/src/workspace.js
+@@ -1124,7 +1124,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')
+ }
+
+ // Synchronously open the given URI in the active pane. **Only use this method
diff --git a/fix-node8.patch b/fix-node8.patch
new file mode 100644
index 000000000000..dfed3ef2109d
--- /dev/null
+++ b/fix-node8.patch
@@ -0,0 +1,11 @@
+--- a/src/module-cache.coffee
++++ b/src/module-cache.coffee
+@@ -189,7 +189,7 @@ resolveModulePath = (relativePath, parentModule) ->
+ return unless candidates?
+
+ for version, resolvedPath of candidates
+- if Module._cache.hasOwnProperty(resolvedPath) or isCorePath(resolvedPath)
++ if Boolean(Module._cache[resolvedPath]) or isCorePath(resolvedPath)
+ return resolvedPath if satisfies(version, range)
+
+ return
diff --git a/fix-restart.patch b/fix-restart.patch
new file mode 100644
index 000000000000..d35e54d453f4
--- /dev/null
+++ b/fix-restart.patch
@@ -0,0 +1,11 @@
+--- a/src/main-process/atom-application.js
++++ b/src/main-process/atom-application.js
+@@ -1347,7 +1347,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}`)
diff --git a/symbols-view-use-system-ctags.patch b/symbols-view-use-system-ctags.patch
new file mode 100644
index 000000000000..cd9ff5e2dcd4
--- /dev/null
+++ b/symbols-view-use-system-ctags.patch
@@ -0,0 +1,11 @@
+--- a/lib/tag-generator.js
++++ b/lib/tag-generator.js
+@@ -79,7 +79,7 @@ export default class TagGenerator {
+ generate() {
+ let tags = {};
+ const packageRoot = this.getPackageRoot();
+- const command = path.join(packageRoot, 'vendor', `ctags-${process.platform}`);
++ const command = 'ctags';
+ const defaultCtagsFile = path.join(packageRoot, 'lib', 'ctags-config');
+ const args = [`--options=${defaultCtagsFile}`, '--fields=+KS'];
+
diff --git a/use-system-apm.patch b/use-system-apm.patch
new file mode 100644
index 000000000000..23cc90c9212f
--- /dev/null
+++ b/use-system-apm.patch
@@ -0,0 +1,32 @@
+--- a/script/lib/run-apm-install.js
++++ b/script/lib/run-apm-install.js
+@@ -8,11 +8,8 @@
+ const installEnv = Object.assign({}, process.env)
+ // Set resource path so that apm can load metadata related to Atom.
+ 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', 'install'],
+ {env: installEnv, cwd: packagePath, stdio: 'inherit'}
+ )
+--- a/src/package-manager.js
++++ b/src/package-manager.js
+@@ -166,13 +166,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)
+- if (!fs.isFileSync(this.apmPath)) {
+- 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'
+ }
+
+ // Public: Get the paths being used to look for packages.
diff --git a/use-system-electron.patch b/use-system-electron.patch
new file mode 100644
index 000000000000..0b82e21e76e8
--- /dev/null
+++ b/use-system-electron.patch
@@ -0,0 +1,212 @@
+--- a/package.json
++++ b/package.json
+@@ -12,7 +12,6 @@
+ "url": "https://github.com/atom/atom/issues"
+ },
+ "license": "MIT",
+- "electronVersion": "1.7.15",
+ "dependencies": {
+ "@atom/nsfw": "^1.0.18",
+ "@atom/watcher": "1.0.3",
+--- 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')
+@@ -26,7 +22,6 @@
+ .wrap(yargs.terminalWidth())
+ .argv
+
+-const checkChromedriverVersion = require('./lib/check-chromedriver-version')
+ const cleanOutputDirectory = require('./lib/clean-output-directory')
+ const cleanPackageLock = require('./lib/clean-package-lock')
+ const codeSignOnMac = require('./lib/code-sign-on-mac')
+@@ -60,7 +55,6 @@
+
+ if (!argv.existingBinaries) {
+ cleanPackageLock()
+- checkChromedriverVersion()
+ cleanOutputDirectory()
+ copyAssets()
+ transpilePackagesWithCustomTranspilerPaths()
+@@ -76,61 +70,4 @@
+ }
+
+ binariesPromise
+- .then(packageApplication)
+ .then(packagedAppPath => generateStartupSnapshot(packagedAppPath).then(() => packagedAppPath))
+- .then(packagedAppPath => {
+- switch (process.platform) {
+- case 'darwin': {
+- if (argv.codeSign) {
+- codeSignOnMac(packagedAppPath)
+- } else {
+- console.log('Skipping code-signing. Specify the --code-sign option to perform code-signing'.gray)
+- }
+- }
+- case 'win32': {
+- if (argv.codeSign) {
+- const executablesToSign = [ path.join(packagedAppPath, 'Atom.exe') ]
+- if (argv.createWindowsInstaller) {
+- executablesToSign.push(path.join(__dirname, 'node_modules', 'electron-winstaller', 'vendor', 'Update.exe'))
+- }
+- codeSignOnWindows(executablesToSign)
+- } else {
+- console.log('Skipping code-signing. Specify the --code-sign option to perform code-signing'.gray)
+- }
+- if (argv.createWindowsInstaller) {
+- return createWindowsInstaller(packagedAppPath)
+- .then(() => argv.codeSign && codeSignOnWindows([ path.join(CONFIG.buildOutputPath, 'AtomSetup.exe') ]))
+- .then(() => packagedAppPath)
+- } else {
+- console.log('Skipping creating installer. Specify the --create-windows-installer option to create a Squirrel-based Windows installer.'.gray)
+- }
+- }
+- case 'linux': {
+- if (argv.createDebianPackage) {
+- createDebianPackage(packagedAppPath)
+- } else {
+- console.log('Skipping creating debian package. Specify the --create-debian-package option to create it.'.gray)
+- }
+-
+- if (argv.createRpmPackage) {
+- createRpmPackage(packagedAppPath)
+- } else {
+- console.log('Skipping creating rpm package. Specify the --create-rpm-package option to create it.'.gray)
+- }
+- }
+- }
+-
+- return Promise.resolve(packagedAppPath)
+- }).then(packagedAppPath => {
+- if (argv.compressArtifacts) {
+- compressArtifacts(packagedAppPath)
+- } else {
+- console.log('Skipping artifacts compression. Specify the --compress-artifacts option to compress Atom binaries (and symbols on macOS)'.gray)
+- }
+-
+- if (argv.install != null) {
+- installApplication(packagedAppPath, argv.install)
+- } else {
+- console.log('Skipping installation. Specify the --install option to install Atom'.gray)
+- }
+- })
+--- a/script/lib/generate-startup-snapshot.js
++++ b/script/lib/generate-startup-snapshot.js
+@@ -79,7 +79,7 @@
+ } else if (process.platform === 'win32') {
+ nodeBundledInElectronPath = path.join(packagedAppPath, 'atom.exe')
+ } else {
+- nodeBundledInElectronPath = path.join(packagedAppPath, 'atom')
++ nodeBundledInElectronPath = 'electron'
+ }
+ childProcess.execFileSync(
+ nodeBundledInElectronPath,
+@@ -87,6 +87,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(
+@@ -104,5 +105,6 @@
+ console.log(`Moving generated startup blob into "${startupBlobDestinationPath}"`)
+ fs.unlinkSync(startupBlobDestinationPath)
+ fs.renameSync(generatedStartupBlobPath, startupBlobDestinationPath)
++*/
+ })
+ }
+--- a/script/package.json
++++ b/script/package.json
+@@ -7,9 +7,7 @@
+ "coffeelint": "1.15.7",
+ "colors": "1.1.2",
+ "donna": "1.0.16",
+- "electron-chromedriver": "~1.7",
+ "electron-link": "0.2.0",
+- "electron-mksnapshot": "~1.7",
+ "electron-packager": "7.3.0",
+ "electron-winstaller": "2.6.4",
+ "fs-admin": "^0.1.5",
+--- a/src/compile-cache.js
++++ b/src/compile-cache.js
+@@ -122,7 +122,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
+ }
+ }
+--- a/src/main-process/start.js
++++ b/src/main-process/start.js
+@@ -95,5 +95,5 @@ function handleStartupEventWithSquirrel () {
+ function setupCompileCache () {
+ const CompileCache = require('../compile-cache')
+ CompileCache.setAtomHomeDirectory(process.env.ATOM_HOME)
+- CompileCache.install(process.resourcesPath, require)
++ CompileCache.install('/usr/lib/atom', require)
+ }
+--- a/src/module-cache.coffee
++++ b/src/module-cache.coffee
+@@ -195,7 +195,7 @@ resolveModulePath = (relativePath, parentModule) ->
+ return
+
+ registerBuiltins = (devMode) ->
+- if devMode or not cache.resourcePath.startsWith("#{process.resourcesPath}#{path.sep}")
++ if devMode or not cache.resourcePath.startsWith("/usr/lib/atom")
+ fs = require 'fs-plus'
+ atomJsPath = path.join(cache.resourcePath, 'exports', 'atom.js')
+ cache.builtins.atom = atomJsPath if fs.isFileSync(atomJsPath)
+--- a/src/package-manager.js
++++ b/src/package-manager.js
+@@ -807,7 +807,7 @@ module.exports = class PackageManager {
+ }
+
+ isBundledPackagePath (packagePath) {
+- if (this.devMode && !this.resourcePath.startsWith(`${process.resourcesPath}${path.sep}`)) {
++ if (this.devMode && this.resourcePath !== '/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)
+
+ 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 () {}
+--- 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'
+
+ 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)
+
+ const ModuleCache = useSnapshot ? snapshotResult.customRequire('../src/module-cache.js') : require('../src/module-cache')
+ ModuleCache.register(getWindowLoadSettings())