GPL and LGPL open source licensing restrictions [closed]
Asked Answered
S

6

120

I am having trouble understanding the usage permissions of open source. I read somewhere that GPL or LGPL enforces that software that uses GPL software must also be released open-source. I want to create an application that uses some open-source image recognition library. Can I sell this application or does it have to be open source?

Thanks!

Skyway answered 11/7, 2009 at 16:21 Comment(0)
S
90

LGPL allows you to use and distribute the open source software with your application without releasing the source code for your application.

GPL requires you to release the source code of your application if you choose to use and distribute the GPL licensed open source software with your application. In other words, your application must also be licensed under the GPL.

Sphygmic answered 11/7, 2009 at 16:25 Comment(3)
Note the LGPL states the used library must be replaceable. Thus static linking isn't possible.Bicorn
So a "DLL" (Dynamic Link Library) would be legal, correct?Sphygmic
Only if you also provide the source code for that DLL, as well as the required header files or documentation in order to be able to interface with the rest of the application, should anyone want to heavily modify, or re-write from scratch, that DLL.Ibrahim
I
59
  • GPL

    Other developers can borrow and modify the code and re-distribute it as part of their own project, only if their entire project is also licensed under the GPL.

    This prevents the code from being used in proprietary software.

  • LGPL

    Other developers can borrow and modify the code and re-distribute it as part of their own project, provided that the portion used under the LGPL, including any modifications, is re-licensed under the LGPL. Other portions of the project are permitted have other licenses.

    This allows the code to be used in otherwise proprietary software.

One thing to note is that the LGPL is a longer and more complicated license than the GPL itself, because it contains the full text of the GPL and then adds additional terms to it.

Many of the additional terms in the LGPL specify the conditions that need to be met in order to be able to distribute your code in a project with another license. For example, not only must the user be given the source code to the section under LGPL, but it must be possible for the user of the finished software to modify, re-compile or replace the portion of the software that is licensed under the LGPL and use this modified code with the same software. If you are publishing otherwise proprietary software containing some LGPL code, one way of satisfying this requirement is to place the LGPL code into a separate dynamically linked library, and to distribute with your software the necessary header files and documentation required to re-compile the LGPL portion in such a way that it can still be linked and used with the software as provided. It is not acceptable to take steps to prevent modification of the LGPL code such as obfuscating the code itself or the API or header files.

Note that the LGPL is compatible with the GPL: you can opt to "upgrade" the code to GPL and incorporate it in a wholly GPL licensed project as set out in my first bullet point if you wish. You can't however go the other way and re-license GPL licensed code as LGPL.

Ibrahim answered 23/11, 2012 at 15:34 Comment(6)
What if you delete all it the original source code except for one printf call, and rewrite everything else from absolute scratch, is it still under the licenseGuardrail
Well that's a general copyright question, and a hypothetical thought experiment at that - nobody is likely to sue over one line of code. Technically, it would still be protected by copyright so still subject to the license. But unlikely to matter for practical reasons.Ibrahim
interesting, the point is just to try to understand the category of the copyright, the extent, what does it mean to "copy" code? what if one looks at the original source, and by hand, manally re-types similar, but not exactly the same, code? What if someone uses a program to copy the original code, but change variable names and sequences etc., at what point exactly is the copyright removed?Guardrail
@bluejayke, I'm not a lawyer, but here is my take on your question. If you delete all the original source code except for one printf call, you would be doing it in files that should have the licensing in the file banner. That licensing banner is not legally removable under the license. Anything you replace that code with, even if you removed all code contents including the printf, it would be under the same license.Caddish
@bluejayke retyping the same code is a form of copying, one of many ways of copying where even though you haven't electronically copied it, you have methodically set out to create a copy via other means. If you look at code for inspiration and then implement some code which uses the same idea or concept, but no part of it is a copy, that isn't a copy. You may end up with some lines which are essentially the same, and the legal situation of those is dicey, which is why people not wanting to be accused of copying something may tread carefully when re-implementing something they see.Ibrahim
If you copy someone else's code and obfuscate it (change all variable names etc) that is a derived work, which involved copying, so copyright does restrict it. In fact, I believe obfuscation is specifically not allowed by the GPL (and hence LGPL too).Ibrahim
P
32

IANAL, but the concepts are fairly straightforward.

First, you and your lawyer must read the GPL and LGPL licenses. Second, you should read the GPL FAQ. As far as I understand, you can think of using GPL/LGPL libraries in this way:

  • If you link dynamically or statically with a GPL or LGPL library, you have created a derivative work.
  • If you use a library that is GPL, and you link with that library, your software must be released with a compatible license.
  • If you use a library that is LGPL, and you dynamically link with that library, your software does not have to be released with a compatible license, but you must still comply with the LGPL.
  • If you use a library that is LGPL, and you statically link with that library, your software must be released with a compatible license.
  • The GPL/LGPL licenses mean "free" as in "free speech", not "free beer". You can create a derivative work and sell it for large amounts of money, but you must comply with the GPL/LGPL.
Puny answered 11/7, 2009 at 16:35 Comment(3)
"First, you and your lawyer must read the GPL and LGPL licenses." -- kill me nowPimp
"straightforward". So straightforward in fact that you need to engage a lawyer just to see if you can use a bit of code. This is why developers should never use GPL licenses.Lakieshalakin
On the static vs dynamic linking thing, I think the real distinction is that dynamic linking satisfies the need to let users recompile the source. If you provide a way to do that when statically linking you could still do that. For example, by providing enough source code from the rest of the project. If the license you're using for the non-LGPL part is closed source, however, you're unlikely to want to do that which is why there's the belief that it must be dynamically linked.Ibrahim
N
10

If you cut and paste or link against GPL'd code into your application, your application must be licensed under GPL and you are then required to release the code.

However, you can still sell your application and afaik, the only oblication is that you release the sourcecode to your customers.

If the library you link against is Lesser Gnu Public License aka LGPL then you dont need to release your own application's code but you are still required to release all modifications if you modified the lgpl'd code.

Natasha answered 11/7, 2009 at 16:35 Comment(5)
"release the sourcecode to your customers" - really? only to them? I thought the src has to made publically available?Zendavesta
Im not native english speaker nor lawyer. gnu.org/licenses/gpl-faq.html#WhatDoesWrittenOfferValid states that one most provide the source to anyone who has access to the binary. It does not say that anyone can request the source, but anyone who has been provided with the binary, either directly from you or by your direct customers.Natasha
states it directly, only to customers... "But if you release the modified version to the public in some way, the GPL requires you to make the modified source code available to the program's users, under the GPL."Zendavesta
"the only oblication is that you release the sourcecode to your customers." - no, while that is a major requirement of the GPL, there are many others.Ibrahim
"I thought the src has to made publically available?" - No, you only need to provide source code upon request to someone who gets your software (from you). But, since the source is open licensed, that customer can legally then release the source publicly. So it's always effectively public in the sense that your customers are free to release or share it, put it on Github or whatever. There's little point trying to stop the sources getting to the public.Ibrahim
H
7

GPL does not forbid you to sell software. However you must make available the sources to the software.

The question of usage is a little more complicated. GNU/Linux is released under the GPL. Nothing forbids you to write software that runs under Linux regardless of the licence of your software. However, you cannot distribute Linux together with your software. That is often a problem with libraries which need to be part of a program. That is what the LGPL licence is for. You can compile a c program you write with gcc (hence using LGPL licenced runtime routine libraries from gcc) and still release you software without the restrictions of the GPL.

I think that is the general gist of it. However, this it not in any way legal advice. For legal advice you must retain a certified attorney who can give you legal advice fitting your particular circumstances.

Hope this helps.

Hylophagous answered 11/7, 2009 at 16:33 Comment(0)
O
4

The GPL vs. LGPL distinction determines whether you do/do not have to release the source for your application to anyone having a copy of the binary. Either way you can still sell the application.

Ozan answered 11/7, 2009 at 16:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.