]> code.ossystems Code Review - openembedded-core.git/commitdiff
classes/npm: use the native python
authorJean-Marie LEMETAYER <jean-marie.lemetayer@savoirfairelinux.com>
Fri, 24 Jan 2020 17:07:34 +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-gyp build tool is looking for python. It
is available in the native directory but not directly in the PATH.

This commit configures npm to use the native python executable.

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 88d8de91e91a2b84884b999a86a2538e952014ed..b7c9c40811cfb59bc1fe20fbcd562760aaa8b879 100644 (file)
@@ -236,6 +236,9 @@ python npm_do_compile() {
         sysroot = d.getVar("RECIPE_SYSROOT_NATIVE")
         nodedir = os.path.join(sysroot, d.getVar("prefix_native").strip("/"))
         configs.append(("nodedir", nodedir))
+        bindir = os.path.join(sysroot, d.getVar("bindir_native").strip("/"))
+        pythondir = os.path.join(bindir, "python-native", "python")
+        configs.append(("python", pythondir))
 
         # Pack and install the main package
         tarball = npm_pack(env, d.getVar("NPM_PACKAGE"), tmpdir)