Comparing version 0.6.3 to 0.6.4
@@ -16,7 +16,6 @@ | ||
, mkdirp = require('mkdirp') | ||
, exec = require('child_process').exec | ||
, spawn = require('child_process').spawn | ||
, cp = require('child_process') | ||
, exec = cp.exec | ||
, spawn = cp.spawn | ||
, win = process.platform == 'win32' | ||
, hasVCExpress = false | ||
, hasWin71SDK = false | ||
@@ -29,2 +28,4 @@ exports.usage = 'Generates ' + (win ? 'MSVC project files' : 'a Makefile') + ' for the current module' | ||
, buildDir = path.resolve('build') | ||
, hasVCExpress = false | ||
, hasWin71SDK = false | ||
, configPath | ||
@@ -43,6 +44,7 @@ , nodeDir | ||
}) | ||
} else | ||
} else { | ||
checkPython() | ||
} | ||
// Make sure that Python is in the $PATH | ||
// Check if Python is in the $PATH | ||
function checkPython () { | ||
@@ -52,2 +54,3 @@ log.verbose('check python', 'checking for Python executable "%s" in the PATH', python) | ||
if (err) { | ||
log.verbose('`which` failed for `%s`', python, err) | ||
if (win) { | ||
@@ -58,6 +61,6 @@ guessPython() | ||
} | ||
return | ||
} else { | ||
log.verbose('`which` succeeded for `%s`', python, execPath) | ||
checkPythonVersion() | ||
} | ||
log.verbose('`which` succeeded for `' + python + '`', execPath) | ||
checkPythonVersion() | ||
}) | ||
@@ -67,3 +70,3 @@ } | ||
// Called on Windows when "python" isn't available in the current $PATH. | ||
// We're gonna glob C:\python2* | ||
// We're gonna check if "%SystemDrive%\python27\python.exe" exists. | ||
function guessPython () { | ||
@@ -282,18 +285,15 @@ log.verbose('could not find "' + python + '". guessing location') | ||
log.verbose(configFilename, 'writing out config file: %s', configPath) | ||
fs.writeFile(configPath, [prefix, json, ''].join('\n'), runGypAddon) | ||
fs.writeFile(configPath, [prefix, json, ''].join('\n'), runGyp) | ||
} | ||
function runGypAddon (err) { | ||
function runGyp (err) { | ||
if (err) return callback(err) | ||
// location of the `gyp_addon` python script for the target nodedir | ||
var gyp_addon = path.resolve(nodeDir, 'tools', 'gyp_addon') | ||
if (!~argv.indexOf('-f') && !~argv.indexOf('--format')) { | ||
if (win) { | ||
log.verbose('gyp_addon', 'gyp format was not specified; forcing "msvs"') | ||
log.verbose('gyp', 'gyp format was not specified; forcing "msvs"') | ||
// force the 'make' target for non-Windows | ||
argv.push('-f', 'msvs') | ||
} else { | ||
log.verbose('gyp_addon', 'gyp format was not specified; forcing "make"') | ||
log.verbose('gyp', 'gyp format was not specified; forcing "make"') | ||
// force the 'make' target for non-Windows | ||
@@ -319,9 +319,33 @@ argv.push('-f', 'make') | ||
// include the "config.gypi" file that was generated | ||
argv.unshift('-I' + configPath) | ||
argv.push('-I', configPath) | ||
// this logic ported from the old `gyp_addon` python file | ||
var gyp_script = path.resolve(nodeDir, 'tools', 'gyp', 'gyp') | ||
var addon_gypi = path.resolve(__dirname, '..', 'addon.gypi') | ||
var common_gypi = path.resolve(nodeDir, 'common.gypi') | ||
var output_dir = 'build' | ||
if (win) { | ||
// Windows expects an absolute path | ||
output_dir = buildDir | ||
} | ||
argv.push('-I', addon_gypi) | ||
argv.push('-I', common_gypi) | ||
argv.push('-Dlibrary=shared_library') | ||
argv.push('-Dvisibility=default') | ||
argv.push('-Dnode_root_dir=' + nodeDir) | ||
argv.push('-Dmodule_root_dir=' + process.cwd()) | ||
argv.push('--depth=.'); | ||
// tell gyp to write the Makefile/Solution files into output_dir | ||
argv.push('--generator-output', output_dir) | ||
// tell make to write its output into the same dir | ||
argv.push('-Goutput_dir=.') | ||
// enforce use of the "binding.gyp" file | ||
argv.unshift('binding.gyp') | ||
// execute `gyp_addon` from the current target nodedir | ||
argv.unshift(gyp_addon) | ||
// execute `gyp` from the current target nodedir | ||
argv.unshift(gyp_script) | ||
@@ -333,3 +357,3 @@ var cp = gyp.spawn(python, argv) | ||
/** | ||
* Called when the `gyp_addon` child process exits. | ||
* Called when the `gyp` child process exits. | ||
*/ | ||
@@ -339,3 +363,3 @@ | ||
if (code !== 0) { | ||
callback(new Error('`gyp_addon` failed with exit code: ' + code)) | ||
callback(new Error('`gyp` failed with exit code: ' + code)) | ||
} else { | ||
@@ -342,0 +366,0 @@ // we're done |
@@ -119,2 +119,3 @@ | ||
var req = null | ||
var requestOpts = { | ||
@@ -130,9 +131,21 @@ uri: url | ||
if (proxyUrl) { | ||
log.verbose('proxy', proxyUrl) | ||
requestOpts.proxy = proxyUrl | ||
if (/^https?:\/\//i.test(proxyUrl)) { | ||
log.verbose('download', 'using proxy url: "%s"', proxyUrl) | ||
requestOpts.proxy = proxyUrl | ||
} else { | ||
log.warn('download', 'ignoring invalid "proxy" config setting: "%s"', proxyUrl) | ||
} | ||
} | ||
var req = request(requestOpts) | ||
req.on('response', function (res) { | ||
log.http(res.statusCode, url) | ||
}) | ||
try { | ||
// The "request" constructor can throw sometimes apparently :( | ||
// See: https://github.com/TooTallNate/node-gyp/issues/114 | ||
req = request(requestOpts) | ||
} catch (e) { | ||
cb(e) | ||
} | ||
if (req) { | ||
req.on('response', function (res) { | ||
log.http(res.statusCode, url) | ||
}) | ||
} | ||
return req | ||
@@ -206,2 +219,3 @@ } | ||
var req = download(tarballUrl) | ||
if (!req) return | ||
@@ -313,2 +327,3 @@ // something went wrong downloading the tarball? | ||
var req = download(nodeLibUrl32) | ||
if (!req) return | ||
req.on('error', done) | ||
@@ -334,2 +349,3 @@ req.on('response', function (res) { | ||
var req = download(nodeLibUrl64) | ||
if (!req) return | ||
req.on('error', done) | ||
@@ -365,4 +381,3 @@ req.on('response', function (res) { | ||
|| (!isLegacy && | ||
(minimatch(file, '*.gypi', { matchBase: true }) | ||
|| minimatch(file, 'tools/gyp_addon') | ||
(minimatch(file, 'common.gypi', { matchBase: true }) | ||
|| (minimatch(file, 'tools/gyp/**') && !minimatch(file, 'tools/gyp/test/**')) | ||
@@ -369,0 +384,0 @@ ) |
{ "name": "node-gyp" | ||
, "description": "Node.js native addon build tool" | ||
, "keywords": [ "native", "addon", "module", "c", "c++", "bindings", "gyp" ] | ||
, "version": "0.6.3" | ||
, "version": "0.6.4" | ||
, "installVersion": 9 | ||
@@ -6,0 +6,0 @@ , "author": "Nathan Rajlich <nathan@tootallnate.net> (http://tootallnate.net)" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1259
2
921147
72