docs: add debugging doc
[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 It's important to not leave a .git directory as npm will then consider the
20 tarball contains a full git tree. Also you need a top level dir which matches
21 the npm pkg name so we create one with a symlink and add the 'h' flag to tar to
22 follow simlinks.
23
24 ~~~~~~~~~~~~~{.sh}
25 mkdir build
26 cd build
27 cmake -DBUILDSWIGNODE=ON  ..
28 make npmpkg
29 ln -s ../ mraa
30 tar hczv --exclude='build*' --exclude='.gitignore' --exclude='.git' --exclude='build*/*' --exclude='.git/*' -f mraa.tar.gz mraa
31 ~~~~~~~~~~~~~