From: Stefan Herbrechtsmeier Date: Fri, 8 Oct 2021 07:48:24 +0000 (+0200) Subject: npm: Add support for EXTRA_OENPM arguments X-Git-Tag: uninative-3.5~1291 X-Git-Url: https://code.ossystems.io/gitweb?a=commitdiff_plain;h=9b22b50b77a5979934193e9affbe47a05d763777;p=openembedded-core.git npm: Add support for EXTRA_OENPM arguments Add support for EXTRA_OENPM arguments to set node-gyp variables for example. This allows use of shared librariess, avoid download of external sources or build from source. Signed-off-by: Stefan Herbrechtsmeier Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie --- diff --git a/meta/classes/npm.bbclass b/meta/classes/npm.bbclass index 91a2321116..477b40d921 100644 --- a/meta/classes/npm.bbclass +++ b/meta/classes/npm.bbclass @@ -22,6 +22,8 @@ inherit python3native DEPENDS:prepend = "nodejs-native " RDEPENDS:${PN}:append:class-target = " nodejs" +EXTRA_OENPM = "" + NPM_INSTALL_DEV ?= "0" def npm_target_arch_map(target_arch): @@ -260,7 +262,8 @@ python npm_do_compile() { # Pack and install the main package tarball = npm_pack(env, d.getVar("NPM_PACKAGE"), tmpdir) - env.run("npm install %s" % shlex.quote(tarball), args=args, configs=configs) + cmd = "npm install %s %s" % (shlex.quote(tarball), d.getVar("EXTRA_OENPM")) + env.run(cmd, args=args, configs=configs) } npm_do_install() {