5

I could not find a good answer to this except here. Maybe it's trivial, or maybe it's just uncommon.

I want to develop an open source application, and I am keen to use a GPL license, but I need to embed a third-party closed-source library. The wrapper to the library I write would be open sourced, but the binaries of the libraries would be closed.

I am implying here that I have the right to use the closed-source library and that the owner of that library is aware of my intention to publish my code as open source. Think of an SDK as an example.

My question is: can I distribute my source code with a GPL license? And, importantly, can I distribute the complete binary bundle, including both my code and the third party, with a GPL license (maybe specifying that it does not apply to that third party lib)?

My understanding is that the GPL is "viral" for what sits "on top" of the code with that license, that is: any derivative work, but not for what stays "below", that is: any used library or lower layers functionalities.

If this is allowed, is it allowed by all versions of the GPL? If it is not allowed, which license would you recommend that is the closest, in spirit, to the GPL, but that would allow me to include third-party, closed source dependencies?

Mureinik
  • 5,112
  • 3
  • 31
  • 42
dariosalvi
  • 81
  • 5
  • 1
    Have you looked at this: https://www.gnu.org/licenses/gpl-faq.html#FSWithNFLibs ? Does it answer your question? – Martin_in_AUT Feb 07 '23 at 08:53
  • 3
  • @Martin_in_AUT in this case, the problem appears to be reversed: the OP wants to create a program containing his/her own code under GPL, combined with a third-party library under a proprietary licence. – MadHatter Feb 07 '23 at 11:55
  • 1
    @Martin_in_AUT apsillers just came along and pointed out that a GPL exception for linking to this library would work perfectly well, thus invalidating my answer, which I've deleted in anticipation of him writing that up. But that's exactly why the questions aren't the same - a GPL exception isn't available to the author of the linked question, while here, it will do perfectly. – MadHatter Feb 07 '23 at 15:29
  • This question maps onto the Q&As GPL V3 with OpenSSL Exception and GPL3 project with EPL library insofar as they all concern a GPL project linked with a GPL-incompatible library, solved by a GPL exception. This might be similar enough to close as duplicate of those questions. (cc @MadHatter) (N.B. I've pointed to Q&As that I've personally answered, because those were easiest for me to find; there may other Q&As that are better still.) – apsillers Feb 07 '23 at 16:23
  • I agree. Dario, could you read those questions and let us know if they tell you what you needed to know, and if not, what remains unanswered? – MadHatter Feb 07 '23 at 16:28
  • thank you both Martin_in_AUT an MadHatter. I think that the FAQ answers it, well it partially does because it doesn't explicitly say "yes you can", but it seem to imply that (while also begging people not to do it). I don't think that the other question on SO would be very relevant. – dariosalvi Feb 08 '23 at 10:16
  • thanks @apsillers your examples are perfect. Unfortunately the title did not hint at a solution for my case, but I can see that they are basically in the same situation. – dariosalvi Feb 08 '23 at 11:30

2 Answers2

7

My understanding is that the GPL is "viral" for what sits "on top" of the code with that license, that is: any derivative work, but not for what stays "below", that is: any used library or lower layers functionalities.

Your understanding is not correct. The GPL is "viral" in all directions. Towards the top, the bottom but also towards the sides. If you use some GPL code in your project, then all code in your project needs to be under a GPL-compatible license.

But there are a couple of "escape hatches":

  • Libraries that are an intrinsic part of the OS you are targeting, like the C library, are exempt from the requirement to be open source. This makes it possible to write GPL software for Windows, for example.
  • If all the GPL-licensed code is your own, then you have the possibility to write an exception to the GPL license stating that people are allowed to link closed-source library X with your code without violating the GPL license.
Bart van Ingen Schenau
  • 29,549
  • 3
  • 46
  • 83
  • 1
    thanks for the answer. As pointed out in the comments above, it looks like from the GPL FAQ (https://www.gnu.org/licenses/gpl-faq.html#FSWithNFLibs) that I can embed a proprietary library if the code that stays on top is mine, which is what you mention in your "escape hatch". Provided I understand this correctly? – dariosalvi Feb 08 '23 at 10:20
  • @dariosalvi, you understand that correctly. – Bart van Ingen Schenau Feb 09 '23 at 08:49
2

As suggested in the comments, there are other two examples here that are basically asking the same question: GPL3 project with EPL library and GPL V3 with OpenSSL Exception

The answer is basically that I could extend the GPL license with an exception for those GPL-incompatible libraries I want to import. A guideline is even offered for that: https://www.gnu.org/licenses/gpl-faq.en.html#GPLIncompatibleLibs

The main drawback is that my code would not be GPL any longer and could not include GPL code, unless I get a permission from the authors.

dariosalvi
  • 81
  • 5
  • 1
    What makes you think your code would no longer be GPL? GPL-plus-s7-exception is still GPL. You are right that you'd need to get a Contributor Licence Agreement in place, though, so that you could continue to extend the s7 exception when you're no longer the sole rightsholder. – MadHatter Feb 08 '23 at 13:44
  • 3
    It's important to note that GPL-with-exception can always fall back to the regular GPL, so while you are correct that your project cannot include others' GPL work that you find (without a separate agreement), I'd note that others can include your GPL-with-exception work in their GPL works by dropping the exception(s) if they wish. In other words, GPL-with-exceptions is one-way compatible into GPL. (cc @MadHatter) – apsillers Feb 08 '23 at 16:56