summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Crowe <mac@mcrowe.com>2021-05-13 15:25:03 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-05-14 07:57:21 +0100
commit14795ee305f3c11fcc31cc7ca815b8ff1020e29a (patch)
tree0f89288c82090811bd1243acd4c5e543973fc4ae
parentb6257f3b88e788af3ee748a8a6366aab819dce3f (diff)
downloadopenembedded-core-contrib-14795ee305f3c11fcc31cc7ca815b8ff1020e29a.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. Signed-off-by: Mike Crowe <mac@mcrowe.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/npm.bbclass6
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() {
# Add node-gyp configuration
configs.append(("arch", d.getVar("NPM_ARCH")))
configs.append(("release", "true"))
- sysroot = d.getVar("RECIPE_SYSROOT_NATIVE")
- nodedir = os.path.join(sysroot, d.getVar("prefix_native").strip("/"))
+ nodedir = d.getVar("NPM_NODEDIR")
+ if not nodedir:
+ sysroot = d.getVar("RECIPE_SYSROOT_NATIVE")
+ nodedir = os.path.join(sysroot, d.getVar("prefix_native").strip("/"))
configs.append(("nodedir", nodedir))
configs.append(("python", d.getVar("PYTHON")))