Blame SOURCES/node-gyp-node-dirs.patch

ce751b
diff --git a/lib/configure.js b/lib/configure.js
ce751b
index 2ff476d..7a69e1c 100644
ce751b
--- a/lib/configure.js
ce751b
+++ b/lib/configure.js
ce751b
@@ -62,7 +62,9 @@ function configure (gyp, argv, callback) {
ce751b
         log.verbose('get node dir', 'compiling against --target node version: %s', release.version)
ce751b
       } else {
ce751b
         // if no --target was specified then use the current host node version
ce751b
+        // if no --target was specified then use RPM installed headers
ce751b
         log.verbose('get node dir', 'no --target version specified, falling back to host node version: %s', release.version)
ce751b
+        log.verbose('get node dir', 'no --target version specified, falling back to RPM installed headers')
ce751b
       }
ce751b
 
ce751b
       if (!release.semver) {
ce751b
@@ -75,7 +77,7 @@ function configure (gyp, argv, callback) {
ce751b
       gyp.commands.install([ release.version ], function (err, version) {
ce751b
         if (err) return callback(err)
ce751b
         log.verbose('get node dir', 'target node version installed:', release.versionDir)
ce751b
-        nodeDir = path.resolve(gyp.devDir, release.versionDir)
ce751b
+        nodeDir = '/opt/rh/rh-nodejs6/root/usr/share/node'
ce751b
         createBuildDir()
ce751b
       })
ce751b
     }
ce751b
@@ -247,9 +249,10 @@ function configure (gyp, argv, callback) {
ce751b
     }
ce751b
 
ce751b
     // this logic ported from the old `gyp_addon` python file
ce751b
-    var gyp_script = path.resolve(__dirname, '..', 'gyp', 'gyp_main.py')
ce751b
-    var addon_gypi = path.resolve(__dirname, '..', 'addon.gypi')
ce751b
-    var common_gypi = path.resolve(nodeDir, 'include/node/common.gypi')
ce751b
+    var gyp_script = '/opt/rh/rh-nodejs6/root/usr/bin/gyp'
ce751b
+    var addon_gypi_file = gyp.opts.target || gyp.opts.nodeDir ? 'addon.gypi' : 'addon-rpm.gypi'
ce751b
+    var addon_gypi = path.resolve(__dirname, '..', addon_gypi_file)
ce751b
+    var common_gypi = path.resolve(nodeDir, '/opt/rh/rh-nodejs6/root/usr/include/node/common.gypi')
ce751b
     fs.stat(common_gypi, function (err, stat) {
ce751b
       if (err)
ce751b
         common_gypi = path.resolve(nodeDir, 'common.gypi')
ce751b
@@ -273,7 +276,7 @@ function configure (gyp, argv, callback) {
ce751b
       argv.push('-Dnode_lib_file=' + release.name + '.lib')
ce751b
       argv.push('-Dmodule_root_dir=' + process.cwd())
ce751b
       argv.push('--depth=.')
ce751b
-      argv.push('--no-parallel')
ce751b
+      //argv.push('--no-parallel')
ce751b
 
ce751b
       // tell gyp to write the Makefile/Solution files into output_dir
ce751b
       argv.push('--generator-output', output_dir)