Skip to contentSkip to conversation

npm.bbclass: use python3 for npm config

PATCH New Vyacheslav Yurkov 1 participant 1 message Jan 28, 2021

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 npm.bbclass: use python3 for npm config

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.

---
 meta/classes/npm.bbclass | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
meta/classes/npm.bbclass +3 -3
index d3dd1a9ab8..79f55febcc 100644
@@ -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")))
Signature · 1 line
2.28.0