> > cairo is a compiled library. An npm module like canvas that uses cairo > would link with it. >
Yes, probably. But there's dynamic linking which happens at run-time, and there's static linking at compile-time. I bet most modules do dynamic linking, which is why Cairo / ImageMagick are required to be installed on the system. Or they just wrap the executable binaries, but that can be done with pure Javascript. Installation of native Node modules with npm involves compiling them on the local architecture. If I could compile everything, without any binary dependencies, it's guaranteed that everything is compatible with the local architecture (assuming the compilation goes smoothly). The reason native modules are compiled, and not shipped as binaries, is (I presume) to allow them to be architecture-agnostic. Compiling locally guarantees compatibility, and frees the developer from managing different packages for different platforms and architectures. So, for shipping an npm package without run-time dependencies I guess I would have to get all the sources of the dependencies and compile them with my module. This would probably require a lot of messing around with node-gyp to make sure everything compiles properly on any platform. So, can't the cairo static library be used for this? > Not if I want to have one module which compiles on any platform. But for a node-webkit application, on the other hand, I would have to manage platform-dependent packages anyway. So there's another option - get compiled binaries of the dependencies for each platform I intend to run on, and create platform-dependent packages for my application which ship with those binaries. On Friday, June 13, 2014 9:24:23 AM UTC+8, ryandesign wrote: > > > On Jun 12, 2014, at 7:35 PM, Forrest Norvell wrote: > > > cairo is a binary, in terms of deployment. It has to be present in > compiled form on the target system before anything using it from Node is > installed, because the native components of those modules have to be able > to link against it. I totally understand wanting to avoid complicating > deployments with native dependencies. > > cairo is a compiled library. An npm module like canvas that uses cairo > would link with it. > > ImageMagick has both a library that can be linked with and the "convert" > and "montage" programs that can be used at runtime. Different npm modules > that use ImageMagick might use different approaches. Probably using the > programs would be the more common approach. > > The OP wrote: > > > Compile-time dependencies are (obviously) okay. > > So, can't the cairo static library be used for this? > > -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/b2e412b3-5500-4e7f-9a07-fffed5214d42%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
