[arch-commits] Commit in atom/trunk (6 files)

Nicola Squartini tensor5 at archlinux.org
Fri Mar 23 06:54:47 UTC 2018


    Date: Friday, March 23, 2018 @ 06:54:46
  Author: tensor5
Revision: 311133

upgpkg: atom 1.25.0-1

Added:
  atom/trunk/atom.js
Modified:
  atom/trunk/PKGBUILD
  atom/trunk/fix-atom-sh.patch
  atom/trunk/fix-license-path.patch
  atom/trunk/fix-restart.patch
  atom/trunk/use-system-electron.patch

---------------------------+
 PKGBUILD                  |   20 +++++++-----
 atom.js                   |   33 ++++++++++++++++++++
 fix-atom-sh.patch         |   50 ++++++++++++++++++------------
 fix-license-path.patch    |   22 ++++++-------
 fix-restart.patch         |   20 ++++++------
 use-system-electron.patch |   72 +++++++++++++++++++++++++-------------------
 6 files changed, 138 insertions(+), 79 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2018-03-23 01:54:38 UTC (rev 311132)
+++ PKGBUILD	2018-03-23 06:54:46 UTC (rev 311133)
@@ -2,8 +2,8 @@
 # Maintainer: Nicola Squartini <tensor5 at gmail.com>
 
 pkgname=atom
-pkgver=1.24.0
-pkgrel=2
+pkgver=1.25.0
+pkgrel=1
 pkgdesc='A hackable text editor for the 21st Century'
 arch=('x86_64')
 url='https://github.com/atom/atom'
@@ -15,6 +15,7 @@
 replaces=('atom-editor')
 options=(!emptydirs)
 source=("${pkgname}-${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'
@@ -23,15 +24,16 @@
         'symbols-view-use-system-ctags.patch'
         'use-system-apm.patch'
         'use-system-electron.patch')
-sha256sums=('7494fba115b214e29d3977cc1a3b08b94d0e88cad65b0d506d40904e3f967bbc'
+sha256sums=('3608c1472879420d3e69f76402f74d9bef9270687bb679b4cde008d328768c5c'
+            'cdf87ab82cfcf69e8904684c59b08c35a68540ea16ab173fce06037ac341efcd'
             'bbc07c111fe808b49b62198e17e8da5d3192faf281d5d84ac7cd493ed92bb2ba'
-            '7f4f86387d226fcd452f0b97579dadc3eac217a77485228dbf4facf3391b6198'
-            'ef8cc9f8c6a3e0359a19b876653c4d6a0ef1224c2d4e06f3e5d535c772292f4f'
+            'd8d77adebd7bd4eaf024988c68c30dc6b968044f7a6381227d13b6d77fa2b442'
+            '67ecd71b08292218388205ee49e02d176a15bd0c3e74d30cb720b79c6946f4c9'
             'eb771d7c009be8d48c1387ed63f3e575dc12f3bd69455b4be4b78ab57cb49b86'
-            '34625e26f1089a068582bd43a9a3755b3f5186b90dcc097b519def8f701d9f3a'
+            'a6fa960741823a52b2f82684285e26eb84ce54825dc7ed008fdaca974b60957e'
             '3c68e6b3751313e1d386e721f8f819fb051351fb2cf8e753b1d773a0f475fef8'
             '4b91a1acd112838bd001f4e3c555de2a5fc7446c9eab6bc5dae0ca640306e81b'
-            '3e16f307de4f4bbe247d0e3aaba4abcd74b8d2668898613432dd0fee8f37ce95')
+            'ea255a397b798a650b34737bdfe390a393df028da061940c383063b317e70ecb')
 
 prepare() {
   cd "${srcdir}/${pkgname}-${pkgver}"
@@ -75,11 +77,13 @@
 
   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|electron --app=/usr/lib/atom|" \
+      -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"
 

Added: atom.js
===================================================================
--- atom.js	                        (rev 0)
+++ atom.js	2018-03-23 06:54:46 UTC (rev 311133)
@@ -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);

Modified: fix-atom-sh.patch
===================================================================
--- fix-atom-sh.patch	2018-03-23 01:54:38 UTC (rev 311132)
+++ fix-atom-sh.patch	2018-03-23 06:54:46 UTC (rev 311133)
@@ -1,6 +1,6 @@
 --- a/atom.sh
 +++ b/atom.sh
-@@ -1,20 +1,5 @@
+@@ -1,26 +1,5 @@
  #!/bin/bash
  
 -if [ "$(uname)" == 'Darwin' ]; then
@@ -12,16 +12,22 @@
 -  exit 1
 -fi
 -
--if [ "$(basename $0)" == 'atom-beta' ]; then
--  BETA_VERSION=true
--else
--  BETA_VERSION=
--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
-@@ -53,79 +38,22 @@
+@@ -59,85 +38,22 @@
    exec 2> /dev/null
  fi
  
@@ -39,7 +45,7 @@
 -    ATOM_APP_NAME="$(basename "$ATOM_APP")"
 -  fi
 -
--  if [ -n "$BETA_VERSION" ]; then
+-  if [ "$CHANNEL" == 'beta' ]; then
 -    ATOM_EXECUTABLE_NAME="Atom Beta"
 -  else
 -    ATOM_EXECUTABLE_NAME="Atom"
@@ -73,30 +79,36 @@
 -  SCRIPT=$(readlink -f "$0")
 -  USR_DIRECTORY=$(readlink -f $(dirname $SCRIPT)/..)
 -
--  if [ -n "$BETA_VERSION" ]; then
--    ATOM_PATH="$USR_DIRECTORY/share/atom-beta/atom"
--  else
--    ATOM_PATH="$USR_DIRECTORY/share/atom/atom"
--  fi
+-  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_PATH="electron --app=/usr/lib/atom"
- 
--  [ -x "$ATOM_PATH" ] || ATOM_PATH="$TMPDIR/atom-build/Atom/atom"
 +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=$$ "$@"
++  "$ATOM_PATH" --executed-from="$(pwd)" --pid=$$ "$@"
 +  exit $?
 +else
 +  (
-+  nohup $ATOM_PATH --executed-from="$(pwd)" --pid=$$ "$@" > "$ATOM_HOME/nohup.out" 2>&1
++  nohup "$ATOM_PATH" --executed-from="$(pwd)" --pid=$$ "$@" > "$ATOM_HOME/nohup.out" 2>&1
 +  if [ $? -ne 0 ]; then
 +    cat "$ATOM_HOME/nohup.out"
      exit $?

Modified: fix-license-path.patch
===================================================================
--- fix-license-path.patch	2018-03-23 01:54:38 UTC (rev 311132)
+++ fix-license-path.patch	2018-03-23 06:54:46 UTC (rev 311133)
@@ -1,17 +1,17 @@
---- a/src/main-process/atom-application.coffee
-+++ b/src/main-process/atom-application.coffee
-@@ -272,7 +272,7 @@
-     @openPathOnEvent('application:open-your-keymap', 'atom://.atom/keymap')
-     @openPathOnEvent('application:open-your-snippets', 'atom://.atom/snippets')
-     @openPathOnEvent('application:open-your-stylesheet', 'atom://.atom/stylesheet')
--    @openPathOnEvent('application:open-license', path.join(process.resourcesPath, 'LICENSE.md'))
-+    @openPathOnEvent('application:open-license', '/usr/share/licenses/atom/LICENSE.md')
+--- a/src/main-process/atom-application.js
++++ b/src/main-process/atom-application.js
+@@ -413,7 +413,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')
  
-     @disposable.add ipcHelpers.on app, 'before-quit', (event) =>
-       resolveBeforeQuitPromise = null
+     this.configFile.onDidChange(settings => {
+       for (let window of this.getAllWindows()) {
 --- a/src/workspace.js
 +++ b/src/workspace.js
-@@ -1104,7 +1104,7 @@
+@@ -1105,7 +1105,7 @@
  
    // Open Atom's license in the active pane.
    openLicense () {

Modified: fix-restart.patch
===================================================================
--- fix-restart.patch	2018-03-23 01:54:38 UTC (rev 311132)
+++ fix-restart.patch	2018-03-23 06:54:46 UTC (rev 311133)
@@ -1,11 +1,11 @@
---- a/src/main-process/atom-application.coffee
-+++ b/src/main-process/atom-application.coffee
-@@ -870,7 +870,7 @@
-       @restart()
+--- a/src/main-process/atom-application.js
++++ b/src/main-process/atom-application.js
+@@ -1339,7 +1339,7 @@
+   }
  
-   restart: ->
--    args = []
-+    args = ["--app=/usr/lib/atom"]
-     args.push("--safe") if @safeMode
-     args.push("--log-file=#{@logFile}") if @logFile?
-     args.push("--socket-path=#{@socketPath}") if @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.socketPath != null) args.push(`--socket-path=${this.socketPath}`)

Modified: use-system-electron.patch
===================================================================
--- use-system-electron.patch	2018-03-23 01:54:38 UTC (rev 311132)
+++ use-system-electron.patch	2018-03-23 06:54:46 UTC (rev 311133)
@@ -4,7 +4,7 @@
      "url": "https://github.com/atom/atom/issues"
    },
    "license": "MIT",
--  "electronVersion": "1.6.16",
+-  "electronVersion": "1.7.11",
    "dependencies": {
      "@atom/nsfw": "^1.0.18",
      "@atom/source-map-support": "^0.3.4",
@@ -21,44 +21,28 @@
  // Needed so we can require src/module-cache.coffee during generateModuleCache
  require('coffee-script/register')
  require('colors')
-@@ -26,7 +22,6 @@ const argv = yargs
+@@ -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')
- const codeSignOnWindows = require('./lib/code-sign-on-windows')
-@@ -36,10 +31,8 @@ const createDebianPackage = require('./lib/create-debian-package')
- const createRpmPackage = require('./lib/create-rpm-package')
- const createWindowsInstaller = require('./lib/create-windows-installer')
- const dumpSymbols = require('./lib/dump-symbols')
--const generateAPIDocs = require('./lib/generate-api-docs')
- const generateMetadata = require('./lib/generate-metadata')
- const generateModuleCache = require('./lib/generate-module-cache')
--const generateStartupSnapshot = require('./lib/generate-startup-snapshot')
- const installApplication = require('./lib/install-application')
- const packageApplication = require('./lib/package-application')
- const prebuildLessCache = require('./lib/prebuild-less-cache')
-@@ -58,7 +51,6 @@ const CONFIG = require('./config')
- let binariesPromise = Promise.resolve()
+@@ -60,7 +55,6 @@
  
  if (!argv.existingBinaries) {
+   cleanPackageLock()
 -  checkChromedriverVersion()
    cleanOutputDirectory()
    copyAssets()
    transpilePackagesWithCustomTranspilerPaths()
-@@ -69,66 +61,5 @@ if (!argv.existingBinaries) {
-   generateModuleCache()
-   prebuildLessCache()
-   generateMetadata()
--  generateAPIDocs()
-   binariesPromise = dumpSymbols()
+@@ -76,61 +70,4 @@
  }
--
--binariesPromise
+ 
+ binariesPromise
 -  .then(packageApplication)
--  .then(packagedAppPath => generateStartupSnapshot(packagedAppPath).then(() => packagedAppPath))
+   .then(packagedAppPath => generateStartupSnapshot(packagedAppPath).then(() => packagedAppPath))
 -  .then(packagedAppPath => {
 -    switch (process.platform) {
 -      case 'darwin': {
@@ -115,21 +99,47 @@
 -      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
+@@ -77,7 +77,7 @@
+     } else if (process.platform === 'win32') {
+       nodeBundledInElectronPath = path.join(packagedAppPath, 'atom.exe')
+     } else {
+-      nodeBundledInElectronPath = path.join(packagedAppPath, 'atom')
++      nodeBundledInElectronPath = 'electron'
+     }
+     childProcess.execFileSync(
+       nodeBundledInElectronPath,
+@@ -85,6 +85,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(
+@@ -102,5 +103,6 @@
+     console.log(`Moving generated startup blob into "${startupBlobDestinationPath}"`)
+     fs.unlinkSync(startupBlobDestinationPath)
+     fs.renameSync(generatedStartupBlobPath, startupBlobDestinationPath)
++*/
+   })
+ }
 --- a/script/package.json
 +++ b/script/package.json
-@@ -8,9 +8,6 @@
+@@ -8,9 +8,7 @@
      "colors": "1.1.2",
      "csslint": "1.0.2",
      "donna": "1.0.16",
--    "electron-chromedriver": "~1.6",
--    "electron-link": "0.1.2",
--    "electron-mksnapshot": "~1.6",
+-    "electron-chromedriver": "~1.7",
+     "electron-link": "0.1.2",
+-    "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
-@@ -121,7 +121,7 @@ exports.install = function (resourcesPath, nodeRequire) {
+@@ -122,7 +122,7 @@ exports.install = function (resourcesPath, nodeRequire) {
        return {
          column,
          line: row,
@@ -140,7 +150,7 @@
      }
 --- a/src/main-process/start.js
 +++ b/src/main-process/start.js
-@@ -85,5 +85,5 @@ function handleStartupEventWithSquirrel () {
+@@ -95,5 +95,5 @@ function handleStartupEventWithSquirrel () {
  function setupCompileCache () {
    const CompileCache = require('../compile-cache')
    CompileCache.setAtomHomeDirectory(process.env.ATOM_HOME)



More information about the arch-commits mailing list