]> code.ossystems Code Review - openembedded-core.git/commitdiff
classes/npm: use the local node headers
authorJean-Marie LEMETAYER <jean-marie.lemetayer@savoirfairelinux.com>
Fri, 24 Jan 2020 17:07:33 +0000 (18:07 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 27 Jan 2020 16:38:54 +0000 (16:38 +0000)
When building addons, the node headers are needed to be able to compile
properly. Usually they are downloaded by npm but network access in the
do_compile task are unauthorized. Hopefully the local node headers are
available in the native sysroot so lets use them.

Signed-off-by: Jean-Marie LEMETAYER <jean-marie.lemetayer@savoirfairelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/npm.bbclass

index cf2c12047ed291c59fa8ecb29c6429ce510f8b99..88d8de91e91a2b84884b999a86a2538e952014ed 100644 (file)
@@ -233,6 +233,9 @@ 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("/"))
+        configs.append(("nodedir", nodedir))
 
         # Pack and install the main package
         tarball = npm_pack(env, d.getVar("NPM_PACKAGE"), tmpdir)