Skip to content

Commit bebd459

Browse files
committed
Ensures that the correct http_parser is used
There is a new http_parser version 2.3.0 that is required for Node 0.11. This PR will fall back to support 0.10.
1 parent b7ad1c4 commit bebd459

4 files changed

Lines changed: 13 additions & 29 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/node_modules/
22
/vendor/libgit2/
33
/vendor/libssh2/
4+
/vendor/http_parser/
45
/build/
56
/coverage/
67
/test/repos/

install.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ var request = require("request");
88
var tar = require("tar");
99
var which = require("which");
1010
var rimraf = require("rimraf");
11+
var NODE_VERSION = Number(process.version.match(/^v(\d+\.\d+)/)[1]);
1112

1213
// This will take in an object and find any matching keys in the environment
1314
// to use as overrides.
@@ -58,6 +59,10 @@ var paths = envOverride({
5859
// Load the package.json.
5960
var pkg = require(paths.pkg);
6061

62+
if (NODE_VERSION === 0.1) {
63+
pkg.http_parser = pkg.http_parser["0.10"];
64+
}
65+
6166
// Ensure all dependencies are available.
6267
var dependencies = Q.allSettled([
6368
// This will prioritize `python2` over `python`, because we always want to
@@ -196,12 +201,6 @@ var dependencies = Q.allSettled([
196201
// Write out a sha file for testing in the future.
197202
return Q.ninvoke(fs, "writeFile", paths.http_parser +
198203
pkg.http_parser.version, "");
199-
}).then(function() {
200-
// Only run the configuration script in a BSD-like environment.
201-
if (process.platform !== "win32") {
202-
return Q.nfcall(exec, "cd " + paths.http_parser + " ; " +
203-
paths.http_parser + "configure");
204-
}
205204
});
206205
})
207206

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@
1212
},
1313
"http_parser": {
1414
"url": "https://github.com/joyent/http-parser/archive/v2.3.tar.gz",
15-
"version": "2.3.0"
15+
"version": "2.3.0",
16+
17+
"0.10": {
18+
"url": "https://github.com/joyent/http-parser/archive/v2.0.tar.gz",
19+
"version": "2.0.0"
20+
}
1621
},
1722
"homepage": "https://github.com/tbranyen/nodegit",
1823
"keywords": [

vendor/libgit2.gyp

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
],
2323
"dependencies": [
2424
"zlib",
25-
"http_parser",
25+
"<(module_root_dir)/vendor/http_parser/http_parser.gyp:http_parser",
2626
"libssh2",
2727
"openssl"
2828
],
@@ -400,27 +400,6 @@
400400
],
401401
},
402402
},
403-
{
404-
"target_name": "http_parser",
405-
"type": "static_library",
406-
"sources": [
407-
"http-parser/http_parser.c",
408-
"http-parser/http_parser.h",
409-
],
410-
"direct_dependent_settings": {
411-
"include_dirs": [
412-
"http-parser",
413-
],
414-
},
415-
"conditions": [
416-
["OS=='win'", {
417-
"msvs_disabled_warnings": [
418-
# Conversion from 'ssize_t' to 'int32_t', possible loss of data.
419-
4244,
420-
],
421-
}],
422-
],
423-
},
424403
{
425404
"target_name": "libssh2",
426405
"type": "static_library",

0 commit comments

Comments
 (0)