Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2014-08-01 04:54:30 +0400
committerisaacs <i@izs.me>2014-08-01 04:54:38 +0400
commitc0119f809506ed8733355505bd7c761ff834dcc5 (patch)
tree8d0a06a2d011963cd64460648f9637fbb4b65d36 /node_modules/node-gyp
parentea547e29f1245e516fc67641875841c10f04e1ee (diff)
parent5ae6ba7daeb3aad39d09095a8f08cf80f3f435a5 (diff)
merge v1.4
Diffstat (limited to 'node_modules/node-gyp')
-rw-r--r--node_modules/node-gyp/README.md3
-rw-r--r--node_modules/node-gyp/lib/install.js44
-rw-r--r--node_modules/node-gyp/package.json49
3 files changed, 42 insertions, 54 deletions
diff --git a/node_modules/node-gyp/README.md b/node_modules/node-gyp/README.md
index cba646e71..8d2d49512 100644
--- a/node_modules/node-gyp/README.md
+++ b/node_modules/node-gyp/README.md
@@ -3,7 +3,8 @@ node-gyp
### Node.js native addon build tool
`node-gyp` is a cross-platform command-line tool written in Node.js for compiling
-native addon modules for Node.js, which takes away the pain of dealing with the
+native addon modules for Node.js. It bundles the [gyp](https://code.google.com/p/gyp/)
+project used by the Chromium team and takes away the pain of dealing with the
various differences in build platforms. It is the replacement to the `node-waf`
program which is removed for node `v0.8`. If you have a native addon for node that
still has a `wscript` file, then you should definitely add a `binding.gyp` file
diff --git a/node_modules/node-gyp/lib/install.js b/node_modules/node-gyp/lib/install.js
index a9a18bcc7..6f72e6a93 100644
--- a/node_modules/node-gyp/lib/install.js
+++ b/node_modules/node-gyp/lib/install.js
@@ -72,6 +72,9 @@ function install (gyp, argv, callback) {
version = version.version
log.verbose('install', 'installing version: %s', version)
+ // distributions starting with 0.10.0 contain sha256 checksums
+ var checksumAlgo = semver.gte(version, '0.10.0') ? 'sha256' : 'sha1'
+
// the directory where the dev files will be installed
var devDir = path.resolve(gyp.devDir, version)
@@ -153,7 +156,7 @@ function install (gyp, argv, callback) {
}
function getContentSha(res, callback) {
- var shasum = crypto.createHash('sha1')
+ var shasum = crypto.createHash(checksumAlgo)
res.on('data', function (chunk) {
shasum.update(chunk)
}).on('end', function () {
@@ -243,11 +246,11 @@ function install (gyp, argv, callback) {
cb(new Error(res.statusCode + ' status code downloading tarball'))
return
}
- // content sha1
- getContentSha(res, function (_, sha1) {
+ // content checksum
+ getContentSha(res, function (_, checksum) {
var filename = path.basename(tarballUrl).trim()
- contentShasums[filename] = sha1
- log.verbose('content sha1', filename, sha1)
+ contentShasums[filename] = checksum
+ log.verbose('content checksum', filename, checksum)
})
// start unzipping and untaring
@@ -288,12 +291,12 @@ function install (gyp, argv, callback) {
async--
if (!async) {
- log.verbose('download contents shasums', JSON.stringify(contentShasums))
+ log.verbose('download contents checksum', JSON.stringify(contentShasums))
// check content shasums
for (var k in contentShasums) {
- log.verbose('validating download shasum for ' + k, '(%s == %s)', contentShasums[k], expectShasums[k])
+ log.verbose('validating download checksum for ' + k, '(%s == %s)', contentShasums[k], expectShasums[k])
if (contentShasums[k] !== expectShasums[k]) {
- cb(new Error(k + ' local sha1 ' + contentShasums[k] + ' not match remote ' + expectShasums[k]))
+ cb(new Error(k + ' local checksum ' + contentShasums[k] + ' not match remote ' + expectShasums[k]))
return
}
}
@@ -303,17 +306,18 @@ function install (gyp, argv, callback) {
}
function downloadShasums(done) {
- log.verbose('check download content sha1, need to download `SHASUMS.txt`...')
- var shasumsPath = path.resolve(devDir, 'SHASUMS.txt')
- , shasumsUrl = distUrl + '/v' + version + '/SHASUMS.txt'
+ var shasumsFile = (checksumAlgo === 'sha256') ? 'SHASUMS256.txt' : 'SHASUMS.txt'
+ log.verbose('check download content checksum, need to download `' + shasumsFile + '`...')
+ var shasumsPath = path.resolve(devDir, shasumsFile)
+ , shasumsUrl = distUrl + '/v' + version + '/' + shasumsFile
- log.verbose('`SHASUMS.txt` url', shasumsUrl)
+ log.verbose('checksum url', shasumsUrl)
var req = download(shasumsUrl)
if (!req) return
req.on('error', done)
req.on('response', function (res) {
if (res.statusCode !== 200) {
- done(new Error(res.statusCode + ' status code downloading SHASUMS.txt'))
+ done(new Error(res.statusCode + ' status code downloading checksum'))
return
}
@@ -332,7 +336,7 @@ function install (gyp, argv, callback) {
expectShasums[name] = items[0]
})
- log.verbose('`SHASUMS.txt` data', JSON.stringify(expectShasums))
+ log.verbose('checksum data', JSON.stringify(expectShasums))
done()
})
})
@@ -366,9 +370,9 @@ function install (gyp, argv, callback) {
return
}
- getContentSha(res, function (_, sha1) {
- contentShasums['node.lib'] = sha1
- log.verbose('content sha1', 'node.lib', sha1)
+ getContentSha(res, function (_, checksum) {
+ contentShasums['node.lib'] = checksum
+ log.verbose('content checksum', 'node.lib', checksum)
})
var ws = fs.createWriteStream(nodeLibPath32)
@@ -392,9 +396,9 @@ function install (gyp, argv, callback) {
return
}
- getContentSha(res, function (_, sha1) {
- contentShasums['x64/node.lib'] = sha1
- log.verbose('content sha1', 'x64/node.lib', sha1)
+ getContentSha(res, function (_, checksum) {
+ contentShasums['x64/node.lib'] = checksum
+ log.verbose('content checksum', 'x64/node.lib', checksum)
})
var ws = fs.createWriteStream(nodeLibPath64)
diff --git a/node_modules/node-gyp/package.json b/node_modules/node-gyp/package.json
index ea112a756..8ee986951 100644
--- a/node_modules/node-gyp/package.json
+++ b/node_modules/node-gyp/package.json
@@ -10,7 +10,7 @@
"bindings",
"gyp"
],
- "version": "0.13.1",
+ "version": "1.0.1",
"installVersion": 9,
"author": {
"name": "Nathan Rajlich",
@@ -27,49 +27,32 @@
},
"main": "./lib/node-gyp.js",
"dependencies": {
- "glob": "3",
- "graceful-fs": "2",
- "fstream": "0",
- "minimatch": "0",
- "mkdirp": "0",
- "nopt": "2",
+ "fstream": "^1.0.0",
+ "glob": "3 || 4",
+ "graceful-fs": "3",
+ "minimatch": "1",
+ "mkdirp": "^0.5.0",
+ "nopt": "2 || 3",
"npmlog": "0",
"osenv": "0",
"request": "2",
"rimraf": "2",
- "semver": "~2.2.1",
- "tar": "0",
+ "semver": "2.x || 3.x",
+ "tar": "^1.0.0",
"which": "1"
},
"engines": {
"node": ">= 0.8.0"
},
+ "readme": "node-gyp\n=========\n### Node.js native addon build tool\n\n`node-gyp` is a cross-platform command-line tool written in Node.js for compiling\nnative addon modules for Node.js. It bundles the [gyp](https://code.google.com/p/gyp/)\nproject used by the Chromium team and takes away the pain of dealing with the\nvarious differences in build platforms. It is the replacement to the `node-waf`\nprogram which is removed for node `v0.8`. If you have a native addon for node that\nstill has a `wscript` file, then you should definitely add a `binding.gyp` file\nto support the latest versions of node.\n\nMultiple target versions of node are supported (i.e. `0.8`, `0.9`, `0.10`, ..., `1.0`,\netc.), regardless of what version of node is actually installed on your system\n(`node-gyp` downloads the necessary development files for the target version).\n\n#### Features:\n\n * Easy to use, consistent interface\n * Same commands to build your module on every platform\n * Supports multiple target versions of Node\n\n\nInstallation\n------------\n\nYou can install with `npm`:\n\n``` bash\n$ npm install -g node-gyp\n```\n\nYou will also need to install:\n\n * On Unix:\n * `python` (`v2.7` recommended, `v3.x.x` is __*not*__ supported)\n * `make`\n * A proper C/C++ compiler toolchain, like GCC\n * On Windows:\n * [Python][windows-python] ([`v2.7.3`][windows-python-v2.7.3] recommended, `v3.x.x` is __*not*__ supported)\n * Windows XP/Vista/7:\n * Microsoft Visual Studio C++ 2010 ([Express][msvc2010] version works well)\n * For 64-bit builds of node and native modules you will _**also**_ need the [Windows 7 64-bit SDK][win7sdk]\n * If the install fails, try uninstalling any C++ 2010 x64&x86 Redistributable that you have installed first.\n * If you get errors that the 64-bit compilers are not installed you may also need the [compiler update for the Windows SDK 7.1]\n * Windows 7/8:\n * Microsoft Visual Studio C++ 2012 for Windows Desktop ([Express][msvc2012] version works well)\n\nIf you have multiple Python versions installed, you can identify which Python\nversion `node-gyp` uses by setting the '--python' variable:\n\n``` bash\n$ node-gyp --python /path/to/python2.7\n```\n\nIf `node-gyp` is called by way of `npm` *and* you have multiple versions of\nPython installed, then you can set `npm`'s 'python' config key to the appropriate\nvalue:\n\n``` bash\n$ npm config set python /path/to/executable/python2.7\n```\n\nNote that OS X is just a flavour of Unix and so needs `python`, `make`, and C/C++.\nAn easy way to obtain these is to install XCode from Apple,\nand then use it to install the command line tools (under Preferences -> Downloads).\n\nHow to Use\n----------\n\nTo compile your native addon, first go to its root directory:\n\n``` bash\n$ cd my_node_addon\n```\n\nThe next step is to generate the appropriate project build files for the current\nplatform. Use `configure` for that:\n\n``` bash\n$ node-gyp configure\n```\n\n__Note__: The `configure` step looks for the `binding.gyp` file in the current\ndirectory to processs. See below for instructions on creating the `binding.gyp` file.\n\nNow you will have either a `Makefile` (on Unix platforms) or a `vcxproj` file\n(on Windows) in the `build/` directory. Next invoke the `build` command:\n\n``` bash\n$ node-gyp build\n```\n\nNow you have your compiled `.node` bindings file! The compiled bindings end up\nin `build/Debug/` or `build/Release/`, depending on the build mode. At this point\nyou can require the `.node` file with Node and run your tests!\n\n__Note:__ To create a _Debug_ build of the bindings file, pass the `--debug` (or\n`-d`) switch when running the either `configure` or `build` command.\n\n\nThe \"binding.gyp\" file\n----------------------\n\nPreviously when node had `node-waf` you had to write a `wscript` file. The\nreplacement for that is the `binding.gyp` file, which describes the configuration\nto build your module in a JSON-like format. This file gets placed in the root of\nyour package, alongside the `package.json` file.\n\nA barebones `gyp` file appropriate for building a node addon looks like:\n\n``` python\n{\n \"targets\": [\n {\n \"target_name\": \"binding\",\n \"sources\": [ \"src/binding.cc\" ]\n }\n ]\n}\n```\n\nSome additional resources for writing `gyp` files:\n\n * [\"Hello World\" node addon example](https://github.com/joyent/node/tree/master/test/addons/hello-world)\n * [gyp user documentation](http://code.google.com/p/gyp/wiki/GypUserDocumentation)\n * [gyp input format reference](http://code.google.com/p/gyp/wiki/InputFormatReference)\n * [*\"binding.gyp\" files out in the wild* wiki page](https://github.com/TooTallNate/node-gyp/wiki/%22binding.gyp%22-files-out-in-the-wild)\n\n\nCommands\n--------\n\n`node-gyp` responds to the following commands:\n\n| **Command** | **Description**\n|:--------------|:---------------------------------------------------------------\n| `build` | Invokes `make`/`msbuild.exe` and builds the native addon\n| `clean` | Removes any the `build` dir if it exists\n| `configure` | Generates project build files for the current platform\n| `rebuild` | Runs \"clean\", \"configure\" and \"build\" all in a row\n| `install` | Installs node development header files for the given version\n| `list` | Lists the currently installed node development file versions\n| `remove` | Removes the node development header files for the given version\n\n\nLicense\n-------\n\n(The MIT License)\n\nCopyright (c) 2012 Nathan Rajlich &lt;nathan@tootallnate.net&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n[windows-python]: http://www.python.org/getit/windows\n[windows-python-v2.7.3]: http://www.python.org/download/releases/2.7.3#download\n[msvc2010]: http://go.microsoft.com/?linkid=9709949\n[msvc2012]: http://go.microsoft.com/?linkid=9816758\n[win7sdk]: http://www.microsoft.com/en-us/download/details.aspx?id=8279\n[compiler update for the Windows SDK 7.1]: http://www.microsoft.com/en-us/download/details.aspx?id=4422\n",
+ "readmeFilename": "README.md",
+ "gitHead": "b2abd70377c356483c98509b14a01d71f1eaa17f",
"bugs": {
"url": "https://github.com/TooTallNate/node-gyp/issues"
},
"homepage": "https://github.com/TooTallNate/node-gyp",
- "_id": "node-gyp@0.13.1",
- "_shasum": "5a484dd2dc13d5b894a8fe781a250c07eae7bffa",
- "_from": "node-gyp@latest",
- "_npmVersion": "1.4.9",
- "_npmUser": {
- "name": "tootallnate",
- "email": "nathan@tootallnate.net"
- },
- "maintainers": [
- {
- "name": "TooTallNate",
- "email": "nathan@tootallnate.net"
- },
- {
- "name": "tootallnate",
- "email": "nathan@tootallnate.net"
- }
- ],
- "dist": {
- "shasum": "5a484dd2dc13d5b894a8fe781a250c07eae7bffa",
- "tarball": "http://registry.npmjs.org/node-gyp/-/node-gyp-0.13.1.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-0.13.1.tgz"
+ "_id": "node-gyp@1.0.1",
+ "scripts": {},
+ "_shasum": "d5e364145ff10b259be9986855c83b5a76a2d975",
+ "_from": "node-gyp@latest"
}