diff options
Diffstat (limited to 'use-system-electron.patch')
-rw-r--r-- | use-system-electron.patch | 207 |
1 files changed, 112 insertions, 95 deletions
diff --git a/use-system-electron.patch b/use-system-electron.patch index a37f6bab44eb..2cbc8b94e495 100644 --- a/use-system-electron.patch +++ b/use-system-electron.patch @@ -4,41 +4,38 @@ "url": "https://github.com/atom/atom/issues" }, "license": "MIT", -- "electronVersion": "2.0.16", +- "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 - .then(packageApplication) @@ -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 -@@ -9,9 +9,7 @@ +@@ -10,9 +10,7 @@ "coffeelint": "1.15.7", "colors": "1.1.2", "donna": "1.0.16", -- "electron-chromedriver": "~2.0", - "electron-link": "0.2.2", -- "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) - - 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 () {} +@@ -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 -@@ -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())
\ No newline at end of file +@@ -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') |