summarylogtreecommitdiffstats
path: root/use-system-electron.patch
blob: fe48f3ff851870ca803a860b4487687c7b99524a (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
--- 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",
--- a/script/build
+++ b/script/build
@@ -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')
@@ -66,12 +66,12 @@
 const CONFIG = require('./config')
 
 // 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 @@
 
 if (!argv.generateApiDocs) {
   binariesPromise
-    .then(packageApplication)
     .then(packagedAppPath => generateStartupSnapshot(packagedAppPath).then(() => packagedAppPath))
-    .then(async 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)
-    }).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
@@ -286,17 +286,14 @@
         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(
@@ -338,5 +335,6 @@
         destinationPath
       );
     }
+    */
   });
 };
--- 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": "^0.4.3",
-    "electron-mksnapshot": "^9.0.2",
     "electron-packager": "^15.0.0",
     "eslint": "^5.16.0",
     "eslint-config-prettier": "^4.2.0",
--- 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
       };
     }
--- a/src/module-cache.js
+++ b/src/module-cache.js
@@ -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
@@ -949,7 +949,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 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
@@ -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')