Merge pull request #1762 from atom/linux-build

Make Atom build on Linux
This commit is contained in:
Cheng Zhao
2014-03-19 01:40:11 +00:00
14 changed files with 341 additions and 32 deletions

View File

@@ -148,6 +148,12 @@ class Atom extends Model
{devMode, resourcePath} = @getLoadSettings()
configDirPath = @getConfigDirPath()
# Add 'src/exports' to module search path.
exportsPath = path.resolve(resourcePath, 'exports')
require('module').globalPaths.push(exportsPath)
# Still set NODE_PATH since tasks may need it.
process.env.NODE_PATH = exportsPath
@config = new Config({configDirPath, resourcePath})
@keymap = new Keymap({configDirPath, resourcePath})
@packages = new PackageManager({devMode, configDirPath, resourcePath})

View File

@@ -196,7 +196,7 @@ class AtomApplication
@openPathOnEvent('application:open-your-stylesheet', 'atom://.atom/stylesheet')
app.on 'window-all-closed', ->
app.quit() if process.platform is 'win32'
app.quit() if process.platform in ['win32', 'linux']
app.on 'will-quit', =>
@killAllProcesses()

View File

@@ -21,12 +21,7 @@ class AtomWindow
{@resourcePath, pathToOpen, initialLine, @isSpec, @exitWhenDone} = settings
global.atomApplication.addWindow(this)
@setupNodePath(@resourcePath)
@browserWindow = new BrowserWindow show: false, title: 'Atom', icon: @constructor.iconPath
@browserWindow.restart = _.wrap _.bind(@browserWindow.restart, @browserWindow), (restart) =>
@setupNodePath(@resourcePath)
restart()
@handleEvents()
loadSettings = _.extend({}, settings)
@@ -49,9 +44,6 @@ class AtomWindow
@openPath(pathToOpen, initialLine)
setupNodePath: (resourcePath) ->
process.env['NODE_PATH'] = path.resolve(resourcePath, 'exports')
getUrl: (loadSettingsObj) ->
# Ignore the windowState when passing loadSettings via URL, since it could
# be quite large.