nikhilm / node-taglib

Simple taglib bindings to Javascript using node.js
http://nikhilm.github.com/node-taglib
MIT License
147 stars 25 forks source link

[add] node-gyp compatible taglib/zlib build #46

Open lennart opened 11 years ago

lennart commented 11 years ago

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, 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

Hope you like it and it serves a purpose!

Best regards,

Lennart

DullReferenceException commented 10 years ago

My goodness, this PR is 10 months old! I'm keen on using this, and we have a mixed operating system shop. Was this effort abandoned, or is it obsolete?

nikhilm commented 10 years ago

Ugh. I'll take a look at this soon. I've been on a long vacation.

jpalumickas commented 10 years ago

Any news about this pull request ?

nikhilm commented 10 years ago

@lennart Any chance you could update this? Apologies for getting back to this after an year.

lennart commented 10 years ago

@nikhilm I have to re-brush up my knowledge about gyp, it's been some time since I used this binding myself, as I abandonend the whole project using node-taglib.

I can take a look at the current state of master and try to figure out what needs to be changed in order to make this PR apply cleanly.

This could take me some time, sorry @jpalumickas & @DullReferenceException