mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
deps: float node-gyp v3.0.0
* support process.release
* support all io.js versions
* support node v4+ including new download locations
* enable delay-load hook by default by default
* download header-only tarballs instead of full source
See https://github.com/nodejs/node-gyp/pull/711 for full details
PR-URL: https://github.com/nodejs/node/pull/2700
Reviewed-By: Forrest L Norvell <forrest@npmjs.com>
This commit is contained in:
1 parent
c17ed0679e
commit
6bd11b4700
4 files changed
+18
-19
No files matched your search
+1
-1
@@ -1,3 +1,3 @@
|
||||
gyp/test
|
||||
node_modules
|
||||
test/.node-gyp
|
||||
test/.node-gyp
|
||||
+11
-11
@@ -38,7 +38,8 @@ function processRelease (argv, gyp, defaultVersion, defaultRelease) {
|
||||
isIojs = name === 'iojs'
|
||||
} else {
|
||||
// old node or alternative --target=
|
||||
isIojs = semver.satisfies(version, '>=1.0.0 <4.0.0')
|
||||
// semver.satisfies() doesn't like prerelease tags so test major directly
|
||||
isIojs = versionSemver.major >= 1 & versionSemver.major < 4
|
||||
name = isIojs ? 'iojs' : 'node'
|
||||
}
|
||||
|
||||
@@ -60,8 +61,8 @@ function processRelease (argv, gyp, defaultVersion, defaultRelease) {
|
||||
// new style, based on process.release so we have a lot of the data we need
|
||||
if (defaultRelease && defaultRelease.headersUrl && !overrideDistUrl) {
|
||||
baseUrl = url.resolve(defaultRelease.headersUrl, './')
|
||||
libUrl32 = resolveLibUrl(name, defaultRelease.libUrl || baseUrl || distBaseUrl, 'x86', version)
|
||||
libUrl64 = resolveLibUrl(name, defaultRelease.libUrl || baseUrl || distBaseUrl, 'x64', version)
|
||||
libUrl32 = resolveLibUrl(name, defaultRelease.libUrl || baseUrl || distBaseUrl, 'x86', versionSemver.major)
|
||||
libUrl64 = resolveLibUrl(name, defaultRelease.libUrl || baseUrl || distBaseUrl, 'x64', versionSemver.major)
|
||||
|
||||
return {
|
||||
version: version,
|
||||
@@ -83,12 +84,12 @@ function processRelease (argv, gyp, defaultVersion, defaultRelease) {
|
||||
// current process.release
|
||||
|
||||
baseUrl = distBaseUrl
|
||||
libUrl32 = resolveLibUrl(name, baseUrl, 'x86', version)
|
||||
libUrl64 = resolveLibUrl(name, baseUrl, 'x64', version)
|
||||
libUrl32 = resolveLibUrl(name, baseUrl, 'x86', versionSemver.major)
|
||||
libUrl64 = resolveLibUrl(name, baseUrl, 'x64', versionSemver.major)
|
||||
// making the bold assumption that anything with a version number >3.0.0 will
|
||||
// have a *-headers.tar.gz file in its dist location, even some frankenstein
|
||||
// custom version
|
||||
tarballUrl = url.resolve(baseUrl, name + '-v' + version + (semver.satisfies(version, '>=3') ? '-headers' : '') + '.tar.gz')
|
||||
tarballUrl = url.resolve(baseUrl, name + '-v' + version + (versionSemver.major >= 3 ? '-headers' : '') + '.tar.gz')
|
||||
|
||||
return {
|
||||
version: version,
|
||||
@@ -109,21 +110,20 @@ function normalizePath (p) {
|
||||
return path.normalize(p).replace(/\\/g, '/')
|
||||
}
|
||||
|
||||
function resolveLibUrl (name, defaultUrl, arch, version) {
|
||||
function resolveLibUrl (name, defaultUrl, arch, versionMajor) {
|
||||
var base = url.resolve(defaultUrl, './')
|
||||
, isV3 = semver.satisfies(version, '^3')
|
||||
, hasLibUrl = bitsre.test(defaultUrl) || (isV3 && bitsreV3.test(defaultUrl))
|
||||
, hasLibUrl = bitsre.test(defaultUrl) || (versionMajor === 3 && bitsreV3.test(defaultUrl))
|
||||
|
||||
if (!hasLibUrl) {
|
||||
// let's assume it's a baseUrl then
|
||||
if (semver.gte(version, '1.0.0'))
|
||||
if (versionMajor >= 1)
|
||||
return url.resolve(base, 'win-' + arch +'/' + name + '.lib')
|
||||
// prior to io.js@1.0.0 32-bit node.lib lives in /, 64-bit lives in /x64/
|
||||
return url.resolve(base, (arch === 'x64' ? 'x64/' : '') + name + '.lib')
|
||||
}
|
||||
|
||||
// else we have a proper url to a .lib, just make sure it's the right arch
|
||||
return defaultUrl.replace(isV3 ? bitsreV3 : bitsre, '/win-' + arch + '/')
|
||||
return defaultUrl.replace(versionMajor === 3 ? bitsreV3 : bitsre, '/win-' + arch + '/')
|
||||
}
|
||||
|
||||
module.exports = processRelease
|
||||
+5
-6
@@ -11,7 +11,7 @@
|
||||
"bindings",
|
||||
"gyp"
|
||||
],
|
||||
"version": "2.0.2",
|
||||
"version": "3.0.0",
|
||||
"installVersion": 9,
|
||||
"author": {
|
||||
"name": "Nathan Rajlich",
|
||||
@@ -52,15 +52,14 @@
|
||||
"scripts": {
|
||||
"test": "tape test/test-*"
|
||||
},
|
||||
"gitHead": "5aaec1144ca4482b3d99e2818cf6cafe34f266f5",
|
||||
"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](https://gcc.gnu.org)\n * On Mac OS X:\n * `python` (`v2.7` recommended, `v3.x.x` is __*not*__ supported) (already installed on Mac OS X)\n * [Xcode](https://developer.apple.com/xcode/downloads/)\n * You also need to install the `Command Line Tools` via Xcode. You can find this under the menu `Xcode -> Preferences -> Downloads`\n * This step will install `gcc` and the related toolchain containing `make`\n * On Windows:\n * [Python][windows-python] ([`v2.7.3`][windows-python-v2.7.3] recommended, `v3.x.x` is __*not*__ supported)\n * Make sure that you have a PYTHON environment variable, and it is set to drive:\\path\\to\\python.exe not to a folder\n * Windows XP/Vista/7:\n * Microsoft Visual Studio C++ 2013 ([Express][msvc2013] version works well)\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++ 2013 for Windows Desktop ([Express][msvc2013] version works well)\n * All Windows Versions\n * For 64-bit builds of node and native modules you will _**also**_ need the [Windows 7 64-bit SDK][win7sdk]\n * You may need to run one of the following commands if your build complains about WindowsSDKDir not being set, and you are sure you have already installed the SDK:\n\n```\ncall \"C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1\\bin\\Setenv.cmd\" /Release /x86\ncall \"C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1\\bin\\Setenv.cmd\" /Release /x64\n```\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 process. 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 either the `configure`, `build` or `rebuild` 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\nyLine truncated
|
||||
"readmeFilename": "README.md",
|
||||
"gitHead": "31a2acbb975d8f8e42d9a50c4fcc30fd02f9810c",
|
||||
"bugs": {
|
||||
"url": "https://github.com/nodejs/node-gyp/issues"
|
||||
},
|
||||
"homepage": "https://github.com/nodejs/node-gyp",
|
||||
"_id": "node-gyp@2.0.2",
|
||||
"_shasum": "7ab3feebc675f6162b5a68c2df339b9ca33bf5cb",
|
||||
"_from": "nodejs/node-gyp#process.release",
|
||||
"_resolved": "git://github.com/nodejs/node-gyp.git#5aaec1144ca4482b3d99e2818cf6cafe34f266f5"
|
||||
"_id": "node-gyp@3.0.0",
|
||||
"_shasum": "8bb0d4d21edb00f956d81db031f582cd7d07bdfd",
|
||||
"_from": "node-gyp@latest"
|
||||
}
|
||||
Vendored
+1
-1
@@ -62,7 +62,7 @@
|
||||
"lru-cache": "~2.6.5",
|
||||
"minimatch": "~2.0.10",
|
||||
"mkdirp": "~0.5.1",
|
||||
"node-gyp": "nodejs/node-gyp#process.release",
|
||||
"node-gyp": "~3.0.0",
|
||||
"nopt": "~3.0.3",
|
||||
"normalize-git-url": "~3.0.1",
|
||||
"normalize-package-data": "~2.3.2",
|
||||
|
||||
Reference in new issue
Block a user