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?

8
  • 1
    Have you looked at this: gnu.org/licenses/gpl-faq.html#FSWithNFLibs ? Does it answer your question? Commented Feb 7, 2023 at 8:53
  • 3
    Does this answer your question? Can I create a GPL wrapper that runs my closed source application combined with a GPL part Commented Feb 7, 2023 at 9:17
  • @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
    Commented Feb 7, 2023 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
    Commented Feb 7, 2023 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
    Commented Feb 7, 2023 at 16:23

2 Answers 2

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.
2
  • 1
    thanks for the answer. As pointed out in the comments above, it looks like from the GPL FAQ (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
    Commented Feb 8, 2023 at 10:20
  • @dariosalvi, you understand that correctly. Commented Feb 9, 2023 at 8: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.

2
  • 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
    Commented Feb 8, 2023 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
    Commented Feb 8, 2023 at 16:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.