npm: add node-gyp build support
[contrib/mraa.git] / docs / npm.md
1 mraa NPM pkg                        {#npmpkg}
2 ============
3
4 What you are looking at is a tarball made after 'make npmpkg' has been run on
5 our build system. It contains a few prebuilt files in order to build easily
6 with node-gyp on most systems. Note that this is not the preffered way of
7 building libmraa and if you'd like to contribute, please learn how the build
8 system works and get your sources from git.
9
10 Any patches for mraajsJAVASCRIPT_wrap.cxx or version.c will be ignored as these
11 are automatically generated files. When you execute a build from node-gyp/npm
12 you do not generate the mraajsJAVASCRIPT_wrap.cxx file but rather use one that
13 we have generated for you.
14
15 Recreating tarball
16 ------------------
17
18 From a checkout of mraa you can do the following to 'generate' this tarball
19
20 ~~~~~~~~~~~~~{.sh}
21 mkdir build
22 cd build
23 cmake -DBUILDSWIGNODE=ON  ..
24 make npmpkg
25 cd ../
26 tar czv --exclude='build/*' --exclude='.git/*' -f /tmp/mraa.tar.gz .
27 ~~~~~~~~~~~~~