]> code.ossystems Code Review - openembedded-core.git/commitdiff
npm.bbclass: use python3 for npm config
authorVyacheslav Yurkov <uvv.mail@gmail.com>
Thu, 28 Jan 2021 18:42:46 +0000 (19:42 +0100)
committerAnuj Mittal <anuj.mittal@intel.com>
Sat, 6 Feb 2021 06:53:56 +0000 (14:53 +0800)
python2-native executable is not available in sysroot anymore, which
causes compilation of some nodejs modules to fail. Switch to python3 as a
default python version.

Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit d21f50ecf8e8683a92b7d234fa8225c2c1470595)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
meta/classes/npm.bbclass

index d3dd1a9ab8ed95f2138c880263f38bafe4b286e7..79f55febccf2389ad5d5cacfb6b55c1f88db9c8f 100644 (file)
@@ -17,6 +17,8 @@
 #  NPM_INSTALL_DEV:
 #       Set to 1 to also install devDependencies.
 
+inherit python3native
+
 DEPENDS_prepend = "nodejs-native "
 RDEPENDS_${PN}_prepend = "nodejs "
 
@@ -248,9 +250,7 @@ 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))
+        configs.append(("python", d.getVar("PYTHON")))
 
         # Add node-pre-gyp configuration
         args.append(("target_arch", d.getVar("NPM_ARCH")))