If an LGPL nim library is used in closed-source nim project, the LGPL requirements needs to be fulfilled.
https://copyleft.org/guide/comprehensive-gpl-guidech11.html#x14-10800010.8
10.8 Distributing Works Based On the Library
Essentially, “works based on the library” must be distributed under the same conditions as works under full GPL. In fact, we note that LGPLv2.1 §2 is nearly identical in its terms and requirements to GPLv2 §2.
There are, however, subtle differences and additions. For example not only is CCS required (as would be with normal versions of GPL), but also the CCS provided must enable a developer to regenerate the modified version of the entire combined work, using with a modified version of the LGPL’d work (as a replacement for the version a distributor provided). For example, LGPL’d code is statically linked to a non-copyleft executable, the required source code must also include sufficient material to split the distributed executable and relink with a modified version of the library.
Afaik this means that:
By default nim compiler statically links imported nim code in same executable/dll, but cache folder contains separate object files.
My questions are:
Thanks
I am not a lawyer - but here is how I see it:
Case A - yes you can do that. Make sure to make the full source code and all modifications of the dll / so file available.
Case B - you should better not link LGPL code statically. You can do so, as it doesn't violate the LGPL as long as someone can still modify the LGPL code and relink it. But you may have issues if relinking may not be possible for some reason. In such a rare case, you may still have to deliver the whole source code.
Always add the LGPL license text on deploy! Tell that you are using LGPL and which lib you are using.
I'm only replying to your questions, I'm not really sure about using LGPL libraries in proprietary Nim programs:
case A: is it possible to dynamically link a nim library/module in a nim project?
Yes, but then you have to exportc the needed procedures from the module and compile it separately as a library. Then you need to importc it in your main program. You will also need to take care of such details as GC.
Can I assert that the .o files name that contains the LGPL'd library name in it name contains all the LGPL code so that users can rebuild just that .o and relink manually with the proprietary object file(s)?
I would say no, but it depends. Some Nim features directly inline or duplicate code on the C level (inline procs, templates, inline iterators, constants; probably missed some). Some Nim features generate Nim code, like macros (and I really don't know what would be the license of the code generated from a macro that's LGPL licensed).
Unfortunately MPL does not protect against tivoization, patents and does not grant trademark usage rights. See https://en.wikipedia.org/wiki/Free-software_license#Comparison
It could be useful to have a "standard" LGPLv3-with-static-linking-exception license in the project initialization step in Nimble.