Private
Public Access
2
0

npm: add node-gyp build support

This commit adds all the infrastructure necessary for doing node-gyp builds of
mraa. Note this will only build the mraa js bindings and will dirty your git
tree whilst doing it. It also assumes the user does not have SWIG installed on
their machines and so the swig wrapper is static. The target to use this
feature is 'npmpkg'.

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Brendan Le Foll
2014-11-24 15:18:53 +00:00
parent d4552fdc5e
commit a38c07f7b1
6 changed files with 104 additions and 3 deletions

27
docs/npm.md Normal file
View File

@@ -0,0 +1,27 @@
mraa NPM pkg {#npmpkg}
============
What you are looking at is a tarball made after 'make npmpkg' has been run on
our build system. It contains a few prebuilt files in order to build easily
with node-gyp on most systems. Note that this is not the preffered way of
building libmraa and if you'd like to contribute, please learn how the build
system works and get your sources from git.
Any patches for mraajsJAVASCRIPT_wrap.cxx or version.c will be ignored as these
are automatically generated files. When you execute a build from node-gyp/npm
you do not generate the mraajsJAVASCRIPT_wrap.cxx file but rather use one that
we have generated for you.
Recreating tarball
------------------
From a checkout of mraa you can do the following to 'generate' this tarball
~~~~~~~~~~~~~{.sh}
mkdir build
cd build
cmake -DBUILDSWIGNODE=ON ..
make npmpkg
cd ../
tar czv --exclude='build/*' --exclude='.git/*' -f /tmp/mraa.tar.gz .
~~~~~~~~~~~~~