nikhilm/node-taglib — pull request #46 by lennart (2013-10-13 09:13:30+00:00)
Title: [add] node-gyp compatible taglib/zlib build

Hi Nikhil,

I finally got node-gyp to build taglib and zlib out-of-the-box. You can still use

node-gyp configure --taglib=foo

to have it use your systemwide version of taglib. (foo is currently unused, it is available as the _taglib_ variable in gyp, so one could also use it as a prefix for your taglib installation)

I tried to keep the additionaly overhead as minimal as possible, so I just copied parts from [node-sqlite3](https://github.com/developmentseed/node-sqlite3), which uses a python script to untar the taglib/zlib sources before compilation.

We can keep track of upstream by replacing the tar.gzs and updating the version variable in .gyp files accordingly.

__taglib__ itself uses a `config.h` and `taglib_config.h` generated by __cmake__. I added dummy files to make compilation work and added default settings as direct defines in the `taglib.gyp`. One could think about adding compiler specifica (like the _BYTESWAP defines, or SNPRINTF) via gyp, but I didn't have the time.

One thing to note is the `rtti` flag. I had to manually override node-gyp's defaults adding a `-fno-rtti` to the compilation which broke taglib being built statically as it uses __dynamic_cast__ a lot.

I ran the supplied tests on OS X 10.8 and linux against node 0.10.20 and they work fine, though our test-suite isn't very exhaustive.

With this I can now focus on getting the windows build done, as it currently still fails without heavy modification of the source. More on that in the [corresponding Issue](https://github.com/nikhilm/node-taglib/issues/38)

Hope you like it and it serves a purpose!

Best regards,

Lennart