Skip to content

Commit 35f7b25

Browse files
committed
fix annoying nodejs vs node issue which still persists in Ubuntu
1 parent 59dee5b commit 35f7b25

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

binding.gyp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,21 +48,22 @@
4848
}],
4949
["OS=='linux'", {
5050
"variables": {
51-
"OZW_INC" : "<!(node -p \"require('./lib/ozwpaths.js').includedir\")",
52-
"OZW_LIB_PATH" : "<!(node -p \"require('./lib/ozwpaths.js').libdir\")",
53-
"OZW_ETC" : "<!(node -p \"require('./lib/ozwpaths.js').sysconfdir\")",
54-
"OZW_DOC" : "<!(node -p \"require('./lib/ozwpaths.js').docdir\")"
51+
"NODE" : "<!(which nodejs || which node)",
52+
"OZW_INC" : "<!(<(NODE) -p \"require('./lib/ozwpaths.js').includedir || '/usr/*/include'\")",
53+
"OZW_LIB_PATH" : "<!(<(NODE) -p \"require('./lib/ozwpaths.js').libdir\")",
54+
"OZW_ETC" : "<!(<(NODE) -p \"require('./lib/ozwpaths.js').sysconfdir\")",
55+
"OZW_DOC" : "<!(<(NODE) -p \"require('./lib/ozwpaths.js').docdir\")"
5556
},
5657
"defines": [
57-
"OPENZWAVE_ETC=<!@(node -p -e \"'<(OZW_ETC)'.length ? '<(OZW_ETC)' : '/usr/local/etc/openzwave'\")",
58-
"OPENZWAVE_DOC=<!@(node -p -e \"'<(OZW_DOC)'.length ? '<(OZW_DOC)' : '/usr/local/share/doc/openzwave'\")",
58+
"OPENZWAVE_ETC=<!@(<(NODE) -p -e \"'<(OZW_ETC)'.length ? '<(OZW_ETC)' : '/usr/local/etc/openzwave'\")",
59+
"OPENZWAVE_DOC=<!@(<(NODE) -p -e \"'<(OZW_DOC)'.length ? '<(OZW_DOC)' : '/usr/local/share/doc/openzwave'\")",
5960
"OPENZWAVE_SECURITY=<!@(find <(OZW_INC) -name ZWSecurity.h | wc -l)"
6061
],
6162
"link_settings": {
6263
"libraries": ["-lopenzwave"]
6364
},
6465
"include_dirs": [
65-
"<!(node -p -e \"require('path').dirname(require.resolve('nan'))\")",
66+
"<!(<(NODE) -p -e \"require('path').dirname(require.resolve('nan'))\")",
6667
"<(OZW_INC)",
6768
"<(OZW_INC)/value_classes"
6869
],

0 commit comments

Comments
 (0)