Permalink
Browse files

Requiring node-gyp to work, got rid of install.js and using standard …

…exit style, #32
  • Loading branch information...
1 parent 9b1125d commit 57599882d8435eb3cac139bdc51b4c226745c711 @christkv christkv committed Feb 21, 2013
Showing with 1 addition and 57 deletions.
  1. +0 −56 install.js
  2. +1 −1 package.json
View
@@ -1,56 +0,0 @@
-var spawn = require('child_process').spawn,
- exec = require('child_process').exec;
-
-process.stdout.write("================================================================================\n");
-process.stdout.write("= =\n");
-process.stdout.write("= Attempting to build bson c++ extension =\n");
-process.stdout.write("= Windows: no build will be attempted as binaries are prepackaged =\n");
-process.stdout.write("= Unix: on failure the package will still install without the C++ extension =\n");
-process.stdout.write("= =\n");
-process.stdout.write("================================================================================\n");
-
-// Check if we want to build the native code
-var build_native = process.env['npm_package_config_mongodb_native'] != null ? process.env['npm_package_config_mongodb_native'] : 'false';
-if(process.env['npm_config_mongodb_debug']) {
- console.log("== process.env['npm_package_config_mongodb_native'] :: " + process.env['npm_package_config_mongodb_native']);
- console.log("== build_native :: " + build_native);
-}
-
-build_native = process.env['npm_config_mongodb_native'] != null ? process.env['npm_config_mongodb_native'] : build_native;
-if(process.env['npm_config_mongodb_debug']) {
- console.log("== process.env['npm_config_mongodb_native'] :: " + process.env['npm_config_mongodb_native']);
- console.log("== build_native :: " + build_native);
-}
-
-build_native = build_native == 'true' ? true : false;
-if(process.env['npm_config_mongodb_debug']) {
- console.log("== build_native :: " + build_native);
-}
-
-// If we are building the native bson extension ensure we use gmake if available
-if(process.platform != "win32" && process.platform != "win64") {
- // Check if we need to use gmake
- exec('which gmake', function(err, stdout, stderr) {
- // Set up spawn command
- var make = null;
- // No gmake build using make
- if(err != null) {
- make = spawn('make', ['node_gyp'], {cwd:process.env['PWD']});
- } else {
- make = spawn('gmake', ['node_gyp'], {cwd:process.env['PWD']});
- }
-
- // Execute spawn
- make.stdout.on('data', function(data) {
- process.stdout.write(data);
- })
-
- make.stderr.on('data', function(data) {
- process.stdout.write(data);
- })
-
- make.on('exit', function(code) {
- process.stdout.write('child process exited with code ' + code + "\n");
- })
- });
-}
View
@@ -17,7 +17,7 @@
, "config": { "native" : false }
, "main": "./lib/bson/index"
, "directories" : { "lib" : "./lib/bson" }
-, "engines" : { "node" : ">=0.6.0" }
+, "engines" : { "node" : ">=0.6.19" }
, "scripts": {
"install" : "(node-gyp rebuild 2> builderror.log) || (exit 0)",
"test" : "nodeunit ./test/node && TEST_NATIVE=TRUE nodeunit ./test/node"

0 comments on commit 5759988

Please sign in to comment.