]> code.ossystems Code Review - openembedded-core.git/commitdiff
classes/npm: force to rebuild the prebuild addons
authorJean-Marie LEMETAYER <jean-marie.lemetayer@savoirfairelinux.com>
Fri, 24 Jan 2020 17:07:35 +0000 (18:07 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 27 Jan 2020 16:38:54 +0000 (16:38 +0000)
This commit forces to rebuild the prebuild addons which are using
node-gyp-build.

  https://www.npmjs.com/package/node-gyp-build

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 b7c9c40811cfb59bc1fe20fbcd562760aaa8b879..068032a1e57b2bd973c2d75e7b6537999735b6b0 100644 (file)
@@ -216,6 +216,7 @@ python npm_do_compile() {
     dev = bb.utils.to_boolean(d.getVar("NPM_INSTALL_DEV"), False)
 
     with tempfile.TemporaryDirectory() as tmpdir:
+        args = []
         configs = []
 
         if dev:
@@ -240,9 +241,13 @@ python npm_do_compile() {
         pythondir = os.path.join(bindir, "python-native", "python")
         configs.append(("python", pythondir))
 
+        # Add node-pre-gyp configuration
+        args.append(("target_arch", d.getVar("NPM_ARCH")))
+        args.append(("build-from-source", "true"))
+
         # Pack and install the main package
         tarball = npm_pack(env, d.getVar("NPM_PACKAGE"), tmpdir)
-        env.run("npm install %s" % shlex.quote(tarball), configs=configs)
+        env.run("npm install %s" % shlex.quote(tarball), args=args, configs=configs)
 }
 
 npm_do_install() {