diff options
author | Mike Crowe <mac@mcrowe.com> | 2021-05-13 15:25:03 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-05-14 07:57:28 +0100 |
commit | bac39de14e1fc52ed0388459a45d586c24a93eac (patch) | |
tree | 4e6ce5ae71a2aa7270b3cb956d3b9926ece52988 /meta | |
parent | 436662bc4de1980166386bb95eeb60d5b68f9417 (diff) | |
download | poky-bac39de14e1fc52ed0388459a45d586c24a93eac.tar.gz |
npm.bbclass: Allow nodedir to be overridden by NPM_NODEDIR
Node modules may need to be built against multiple Node
versions. Setting nodedir in the NPM configuration stops older ways of
doing this, such as setting npm_config_target and npm_config_disturl,
from working.
(From OE-Core rev: 14795ee305f3c11fcc31cc7ca815b8ff1020e29a)
Signed-off-by: Mike Crowe <mac@mcrowe.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/npm.bbclass | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/meta/classes/npm.bbclass b/meta/classes/npm.bbclass index 55a6985fb0..8f8712a024 100644 --- a/meta/classes/npm.bbclass +++ b/meta/classes/npm.bbclass | |||
@@ -247,8 +247,10 @@ python npm_do_compile() { | |||
247 | # Add node-gyp configuration | 247 | # Add node-gyp configuration |
248 | configs.append(("arch", d.getVar("NPM_ARCH"))) | 248 | configs.append(("arch", d.getVar("NPM_ARCH"))) |
249 | configs.append(("release", "true")) | 249 | configs.append(("release", "true")) |
250 | sysroot = d.getVar("RECIPE_SYSROOT_NATIVE") | 250 | nodedir = d.getVar("NPM_NODEDIR") |
251 | nodedir = os.path.join(sysroot, d.getVar("prefix_native").strip("/")) | 251 | if not nodedir: |
252 | sysroot = d.getVar("RECIPE_SYSROOT_NATIVE") | ||
253 | nodedir = os.path.join(sysroot, d.getVar("prefix_native").strip("/")) | ||
252 | configs.append(("nodedir", nodedir)) | 254 | configs.append(("nodedir", nodedir)) |
253 | configs.append(("python", d.getVar("PYTHON"))) | 255 | configs.append(("python", d.getVar("PYTHON"))) |
254 | 256 | ||