summarylogtreecommitdiffstats
path: root/use-system-electron.patch
blob: 8419691f839009b13ea84a29ce3bfd8ea3aaa964 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
From b482cc7b1a4c97e39f2643dba92b5a7dfdde0bcd Mon Sep 17 00:00:00 2001
From: solaraquarion <shlomochoina@gmail.com>
Date: Sun, 28 Feb 2021 18:50:11 -0500
Subject: [PATCH 2/3] use system electron

---
 package.json                            |  1 -
 script/build                            | 64 ++-----------------------
 script/lib/generate-startup-snapshot.js |  8 ++--
 script/package.json                     |  2 -
 src/compile-cache.js                    |  2 +-
 src/module-cache.js                     |  2 +-
 src/package-manager.js                  |  2 +-
 src/task-bootstrap.js                   |  2 +-
 static/index.js                         |  4 +-
 9 files changed, 12 insertions(+), 75 deletions(-)

diff --git a/package.json b/package.json
index 79f105c99..4df7b2753 100644
--- a/package.json
+++ b/package.json
@@ -12,7 +12,6 @@
     "url": "https://github.com/atom/atom/issues"
   },
   "license": "MIT",
-  "electronVersion": "6.1.12",
   "dependencies": {
     "@atom/nsfw": "1.0.26",
     "@atom/source-map-support": "^0.3.4",
diff --git a/script/build b/script/build
index 7e2ae319c..9ae039c60 100755
--- a/script/build
+++ b/script/build
@@ -37,7 +37,7 @@ const argv = yargs
   .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')
@@ -62,7 +62,7 @@ process.on('unhandledRejection', function (e) {
   process.exit(1)
 })
 
-process.env.ELECTRON_VERSION = CONFIG.appMetadata.electronVersion
+//process.env.ELECTRON_VERSION = CONFIG.appMetadata.electronVersion
 
 async function transpile() {
   const { spawn, Thread, Worker } = require(`${CONFIG.scriptRunnerModulesPath}/threads`)
@@ -98,68 +98,10 @@ async function transpile() {
   await Thread.terminate(transpilePegJsPaths)
 }
 
-async function singAndCreateInstaller(packagedAppPath) {
-      switch (process.platform) {
-        case 'darwin': {
-          if (argv.codeSign) {
-            await codeSignOnMac(packagedAppPath)
-            await notarizeOnMac(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, CONFIG.executableName) ]
-            if (argv.createWindowsInstaller) {
-              executablesToSign.push(path.join(__dirname, 'node_modules', '@atom', 'electron-winstaller', 'vendor', 'Squirrel.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((installerPath) => {
-                argv.codeSign && codeSignOnWindows([installerPath])
-                return packagedAppPath
-              })
-          } else {
-            console.log('Skipping creating installer. Specify the --create-windows-installer option to create a Squirrel-based Windows installer.'.gray)
-          }
-          break
-        }
-        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)
-          }
-          break
-        }
-      }
-
-      return Promise.resolve(packagedAppPath)
-}
-
-
 async function build() {
 
   if (!argv.existingBinaries) {
-    checkChromedriverVersion()
+   // checkChromedriverVersion()
     await cleanOutputDirectory()
     await copyAssets()
     await transpile()
diff --git a/script/lib/generate-startup-snapshot.js b/script/lib/generate-startup-snapshot.js
index 41d2b7281..b05cbbd26 100644
--- a/script/lib/generate-startup-snapshot.js
+++ b/script/lib/generate-startup-snapshot.js
@@ -288,17 +288,14 @@ module.exports = function(packagedAppPath) {
         CONFIG.executableName
       );
     } else {
-      nodeBundledInElectronPath = path.join(
-        packagedAppPath,
-        CONFIG.executableName
-      );
+      nodeBundledInElectronPath = 'electron6';
     }
     childProcess.execFileSync(
       nodeBundledInElectronPath,
       [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(
@@ -340,5 +337,6 @@ module.exports = function(packagedAppPath) {
         destinationPath
       );
     }
+    */
   });
 };
diff --git a/script/package.json b/script/package.json
index d2aa282a9..013a9e46b 100644
--- a/script/package.json
+++ b/script/package.json
@@ -12,9 +12,7 @@
     "coffeelint": "1.15.7",
     "colors": "1.1.2",
     "donna": "1.0.16",
-    "electron-chromedriver": "^9.0.0",
     "electron-link": "npm:@aminya/electron-link@^0.6.3",
-    "electron-mksnapshot": "^9.0.2",
     "electron-packager": "^15.0.0",
     "eslint": "^5.16.0",
     "eslint-config-prettier": "^4.2.0",
diff --git a/src/compile-cache.js b/src/compile-cache.js
index 2e35760ff..1f1b296a4 100644
--- a/src/compile-cache.js
+++ b/src/compile-cache.js
@@ -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
       };
     }
diff --git a/src/module-cache.js b/src/module-cache.js
index a63b3bbb3..66eb4972e 100644
--- a/src/module-cache.js
+++ b/src/module-cache.js
@@ -270,7 +270,7 @@ function resolveModulePath(relativePath, parentModule) {
 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');
diff --git a/src/package-manager.js b/src/package-manager.js
index 4e1bd5a29..775916ad6 100644
--- a/src/package-manager.js
+++ b/src/package-manager.js
@@ -949,7 +949,7 @@ module.exports = class PackageManager {
   isBundledPackagePath(packagePath) {
     if (
       this.devMode &&
-      !this.resourcePath.startsWith(`${process.resourcesPath}${path.sep}`)
+      !this.resourcePath.startsWith('/usr/lib/atom/')
     ) {
       return false;
     }
diff --git a/src/task-bootstrap.js b/src/task-bootstrap.js
index 1edbce8fa..1ff6271ec 100644
--- 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() {};
diff --git a/static/index.js b/static/index.js
index 75be58393..546cab9bd 100644
--- a/static/index.js
+++ b/static/index.js
@@ -40,7 +40,7 @@
       const devMode =
         getWindowLoadSettings().devMode ||
         !getWindowLoadSettings().resourcePath.startsWith(
-          process.resourcesPath + path.sep
+          '/usr/lib/atom'
         );
       useSnapshot = !devMode && typeof snapshotResult !== 'undefined';
 
@@ -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')
-- 
2.30.1