kumquat-buildroot/package/nodejs
Martin Bark c72b8eaf21 package/nodejs: Fixes for node-pre-gyp
Many packages use node-pre-gyp as a way of deploying precompiled binary
dependencies with fall back to compilation for other targets.  Currently
installing node modules that use node-pre-gyp can fail to use the correct
binary for the target.  This patch fixes this issue by correctly
configuring node-pre-gyp.

Firstly, node-gyp uses the option --arch to determine its target
architecture (which is already set correctly), however, node-pre-gyp uses
--target-arch.  Without this set node.js packages that uses node-pre-gyp
will pick the wrong target architecture.

Secondly, the use of precompiled binary packages is not desirable due to
potential security and licensing issues.  To solve this we use the
--build-from-source option to force node-pre-gyp to always build the C++
code.

This patch passes npm_config_target_arch and npm_config_build_from_source
to npm which causes --target-arch and --build-from-source to be passed to
node-pre-gyp.

I have tested this using the node.js package serialport which now
successfully builds and runs.

Signed-off-by: Martin Bark <martin@barkynet.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-07-04 14:38:33 +02:00
..
0.10.39 package/nodejs: Update to allow selecting node.js version 2015-06-28 15:14:24 +02:00
0.12.5 package/nodejs: Add node.js v0.12.5 and set as the default version 2015-07-04 14:38:05 +02:00
Config.in package/nodejs: Add node.js v0.12.5 and set as the default version 2015-07-04 14:38:05 +02:00
nodejs.hash package/nodejs: Add node.js v0.12.5 and set as the default version 2015-07-04 14:38:05 +02:00
nodejs.mk package/nodejs: Fixes for node-pre-gyp 2015-07-04 14:38:33 +02:00