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 <m...@mcrowe.com>
---
 meta/classes/npm.bbclass | 6 ++++--
 1 file 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")))
 
-- 
2.30.2

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#151704): 
https://lists.openembedded.org/g/openembedded-core/message/151704
Mute This Topic: https://lists.openembedded.org/mt/82800205/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to