Skip to content

Commit f50d419

Browse files
cjihrigpiscisaureus
authored andcommitted
deps: make node-gyp work with io.js
Every npm version bump requires a few patches to be floated on node-gyp for io.js compatibility. These patches are found in 03d1992, 5de334c, and da730c7. This commit squashes them into a single commit. PR-URL: nodejs/node#990 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
1 parent 1670d26 commit f50d419

3 files changed

Lines changed: 25 additions & 25 deletions

File tree

addon.gypi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
'-luuid.lib',
4646
'-lodbc32.lib',
4747
'-lDelayImp.lib',
48-
'-l"<(node_root_dir)/$(ConfigurationName)/node.lib"'
48+
'-l"<(node_root_dir)/$(ConfigurationName)/iojs.lib"'
4949
],
5050
# warning C4251: 'node::ObjectWrap::handle_' : class 'v8::Persistent<T>'
5151
# needs to have dll-interface to be used by clients of class 'node::ObjectWrap'

lib/build.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,23 +173,23 @@ function build (gyp, argv, callback) {
173173
}
174174

175175
/**
176-
* Copies the node.lib file for the current target architecture into the
176+
* Copies the iojs.lib file for the current target architecture into the
177177
* current proper dev dir location.
178178
*/
179179

180180
function copyNodeLib () {
181181
if (!win || !copyDevLib) return doBuild()
182182

183183
var buildDir = path.resolve(nodeDir, buildType)
184-
, archNodeLibPath = path.resolve(nodeDir, arch, 'node.lib')
185-
, buildNodeLibPath = path.resolve(buildDir, 'node.lib')
184+
, archNodeLibPath = path.resolve(nodeDir, arch, 'iojs.lib')
185+
, buildNodeLibPath = path.resolve(buildDir, 'iojs.lib')
186186

187187
mkdirp(buildDir, function (err, isNew) {
188188
if (err) return callback(err)
189189
log.verbose('"' + buildType + '" dir needed to be created?', isNew)
190190
var rs = fs.createReadStream(archNodeLibPath)
191191
, ws = fs.createWriteStream(buildNodeLibPath)
192-
log.verbose('copying "node.lib" for ' + arch, buildNodeLibPath)
192+
log.verbose('copying "iojs.lib" for ' + arch, buildNodeLibPath)
193193
rs.pipe(ws)
194194
rs.on('error', callback)
195195
ws.on('error', callback)

lib/install.js

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function install (gyp, argv, callback) {
3939
}
4040
}
4141

42-
var distUrl = gyp.opts['dist-url'] || gyp.opts.disturl || 'http://nodejs.org/dist'
42+
var distUrl = gyp.opts['dist-url'] || gyp.opts.disturl || 'https://iojs.org/dist'
4343

4444

4545
// Determine which node dev files version we are installing
@@ -185,7 +185,7 @@ function install (gyp, argv, callback) {
185185

186186
// now download the node tarball
187187
var tarPath = gyp.opts['tarball']
188-
var tarballUrl = tarPath ? tarPath : distUrl + '/v' + version + '/node-v' + version + '.tar.gz'
188+
var tarballUrl = tarPath ? tarPath : distUrl + '/v' + version + '/iojs-v' + version + '.tar.gz'
189189
, badDownload = false
190190
, extractCount = 0
191191
, gunzip = zlib.createGunzip()
@@ -267,7 +267,7 @@ function install (gyp, argv, callback) {
267267
var async = 0
268268

269269
if (win) {
270-
// need to download node.lib
270+
// need to download iojs.lib
271271
async++
272272
downloadNodeLib(deref)
273273
}
@@ -343,36 +343,36 @@ function install (gyp, argv, callback) {
343343
}
344344

345345
function downloadNodeLib (done) {
346-
log.verbose('on Windows; need to download `node.lib`...')
346+
log.verbose('on Windows; need to download `iojs.lib`...')
347347
var dir32 = path.resolve(devDir, 'ia32')
348348
, dir64 = path.resolve(devDir, 'x64')
349-
, nodeLibPath32 = path.resolve(dir32, 'node.lib')
350-
, nodeLibPath64 = path.resolve(dir64, 'node.lib')
351-
, nodeLibUrl32 = distUrl + '/v' + version + '/node.lib'
352-
, nodeLibUrl64 = distUrl + '/v' + version + '/x64/node.lib'
349+
, nodeLibPath32 = path.resolve(dir32, 'iojs.lib')
350+
, nodeLibPath64 = path.resolve(dir64, 'iojs.lib')
351+
, nodeLibUrl32 = distUrl + '/v' + version + '/win-x86/iojs.lib'
352+
, nodeLibUrl64 = distUrl + '/v' + version + '/win-x64/iojs.lib'
353353

354-
log.verbose('32-bit node.lib dir', dir32)
355-
log.verbose('64-bit node.lib dir', dir64)
356-
log.verbose('`node.lib` 32-bit url', nodeLibUrl32)
357-
log.verbose('`node.lib` 64-bit url', nodeLibUrl64)
354+
log.verbose('32-bit iojs.lib dir', dir32)
355+
log.verbose('64-bit iojs.lib dir', dir64)
356+
log.verbose('`iojs.lib` 32-bit url', nodeLibUrl32)
357+
log.verbose('`iojs.lib` 64-bit url', nodeLibUrl64)
358358

359359
var async = 2
360360
mkdir(dir32, function (err) {
361361
if (err) return done(err)
362-
log.verbose('streaming 32-bit node.lib to:', nodeLibPath32)
362+
log.verbose('streaming 32-bit iojs.lib to:', nodeLibPath32)
363363

364364
var req = download(nodeLibUrl32)
365365
if (!req) return
366366
req.on('error', done)
367367
req.on('response', function (res) {
368368
if (res.statusCode !== 200) {
369-
done(new Error(res.statusCode + ' status code downloading 32-bit node.lib'))
369+
done(new Error(res.statusCode + ' status code downloading 32-bit iojs.lib'))
370370
return
371371
}
372372

373373
getContentSha(res, function (_, checksum) {
374-
contentShasums['node.lib'] = checksum
375-
log.verbose('content checksum', 'node.lib', checksum)
374+
contentShasums['win-x86/iojs.lib'] = checksum
375+
log.verbose('content checksum', 'win-x86/iojs.lib', checksum)
376376
})
377377

378378
var ws = fs.createWriteStream(nodeLibPath32)
@@ -385,20 +385,20 @@ function install (gyp, argv, callback) {
385385
})
386386
mkdir(dir64, function (err) {
387387
if (err) return done(err)
388-
log.verbose('streaming 64-bit node.lib to:', nodeLibPath64)
388+
log.verbose('streaming 64-bit iojs.lib to:', nodeLibPath64)
389389

390390
var req = download(nodeLibUrl64)
391391
if (!req) return
392392
req.on('error', done)
393393
req.on('response', function (res) {
394394
if (res.statusCode !== 200) {
395-
done(new Error(res.statusCode + ' status code downloading 64-bit node.lib'))
395+
done(new Error(res.statusCode + ' status code downloading 64-bit iojs.lib'))
396396
return
397397
}
398398

399399
getContentSha(res, function (_, checksum) {
400-
contentShasums['x64/node.lib'] = checksum
401-
log.verbose('content checksum', 'x64/node.lib', checksum)
400+
contentShasums['win-x64/iojs.lib'] = checksum
401+
log.verbose('content checksum', 'win-x64/iojs.lib', checksum)
402402
})
403403

404404
var ws = fs.createWriteStream(nodeLibPath64)

0 commit comments

Comments
 (0)