mm2 / Little-CMS

A free, open source, CMM engine. It provides fast transforms between ICC profiles.
https://www.littlecms.com
MIT License
549 stars 174 forks source link

Ship separate pkgconf files for plugins #391

Closed kmilos closed 1 year ago

kmilos commented 1 year ago

As things stand, both lcms2_fast_float and lcms2_threaded end up in extra_libraries for generation of core lcms2.pc.

As a consequence, projects not wanting to link to these for licensing reasons cannot decouple them. Separate plugin .pc files (that then require lcms2) are needed.

mm2 commented 1 year ago

I have tried configure and configure --with-fast-float --with-threaded It does the right thing. Exports the libraries that you specify in the lcms2.pc pkgconfig. Or this happens on the meson build? I begin to think adapting meson was not a good idea at all.

kmilos commented 1 year ago

Exports the libraries that you specify in the lcms2.pc pkgconfig.

It is the same w/ Meson (and yes, it was a good idea 😉).

I'm saying that's not the way to go regardless of the build system - they should have standalone .pc files.

The core lcms2.pc should not link to them implicitly. Projects wishing to use GPL plugins should use lcms2_fast_float.pc and lcms2_threaded.pc explicitly.

I.e. just because someone built and shipped the plugins doesn't mean everyone now has to link them, thus forcing GPL on them.

mm2 commented 1 year ago

Sorry, I don't get the point. If you install system wide libraries that means those libraries are intended for that system. That includes licensing.

If you wish to develop a commercial product and therefore avoid linking with GPL'd parts, then you should not use system libraries that are out of your control. In general you should never use system libraries for any development you wish to distribute. In any case, if you don't call the initialization function, which is the only function plugins exposes, your final binary is not going to contain any of the plug-in code, either static or as shared object.

Making independent pc files makes the product unnecessarily complex. My desire is to promote open source and GPL licensing, and providing separate pc files would penalty open source projects and benefit proprietary ones. My goal is exactly the opposite.

So, my recommendation for anyone trying to avoid GPL3 parts is to install a local copy. It is not a big deal and that will also prevent to break the project if the system library us updated by someone else and the new version is incompatible or buggy.

mm2 commented 1 year ago

See #392