Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

more work on install.js. It now also builds native node module.

  • Loading branch information...
commit 7f7c994ab28f23c14201d28b40e83e34197a9820 1 parent 9e358a3
@samcday samcday authored
Showing with 27 additions and 9 deletions.
  1. +27 −9 install.js
View
36 install.js
@@ -6,39 +6,57 @@ var async = require("async"),
function passthru() {
var args = Array.prototype.slice.call(arguments);
var cb = args.splice(-1)[0];
+ var cmd = args.splice(0, 1)[0];
var opts = {};
if(typeof(args.slice(-1)[0]) === "object") {
opts = args.splice(-1)[0];
}
- console.log(args, opts);
- var child = spawn("/usr/bin/env", args, opts);
+ var child = spawn(cmd, args, opts);
child.stdout.pipe(process.stdout);
child.stderr.pipe(process.stderr);
child.on("exit", cb);
}
-console.log("[gitteh] Installing libgit2 dependency.");
+function shpassthru() {
+ var cmd =
+ passthru.apply(null, ["/bin/sh", "-c"].concat(Array.prototype.slice.call(arguments)));
+}
+
+function envpassthru() {
+ passthru.apply(null, ["/usr/bin/env"].concat(Array.prototype.slice.call(arguments)));
+}
var buildDir = path.join(__dirname, "deps/libgit2/build");
async.series([
function(cb) {
- passthru("git", "submodule", "init", cb);
+ console.log("[gitteh] Downloading libgit2 dependency.");
+ envpassthru("git", "submodule", "init", cb);
},
function(cb) {
- passthru("git", "submodule", "update", cb);
+ envpassthru("git", "submodule", "update", cb);
},
function(cb) {
- passthru("mkdir", "-p", buildDir, cb);
+ console.log("[gitteh] Building libgit2 dependency.");
+ envpassthru("mkdir", "-p", buildDir, cb);
},
function(cb) {
- passthru("cmake", "-DTHREADSAFE=1", "-DBUILD_CLAR=0", "..", {
+ envpassthru("cmake", "-DTHREADSAFE=1", "-DBUILD_CLAR=0", "..", {
cwd: buildDir
}, cb);
},
function(cb) {
- passthru("cmake", "--build", ".", {
+ envpassthru("cmake", "--build", ".", {
cwd: buildDir
}, cb);
+ },
+ function(cb) {
+ console.log("[gitteh] Building native module.");
+ shpassthru("node-gyp configure --debug", cb);
+ },
+ function(cb) {
+ shpassthru("node-gyp build", cb);
}
-]);
+], function(err) {
+ if(err) process.exit(err);
+});
Please sign in to comment.
Something went wrong with that request. Please try again.