Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Assume there is a library that is licensed under GPL. I want to use it is closed source project. I do following:

  1. Create small wrapper application around that GPL library that listens to socket, parse messages and call GPL library. Then returns results back.
  2. Release it's sources (to comply with GPL)
  3. Create client for this wrapper in my main application and don't release sources.

I know that this adds huge overhead compared to static/dynamic linking, but I am interested in theoretical way.

share|improve this question
4  
The wrapper you write would be licensed under the GPL. Therefore the program using the wrapper would still be subject to the terms of the GPL for linking, etc. –  TZHX Feb 21 '11 at 13:28
4  
why not contact the author first and see if you can license it under LGPL or similar instead. –  jk. Feb 21 '11 at 13:30
7  
@TZHX I believe he means the wrapper would be a separate application that acts as a server - his proprietary code would be in the client –  jk. Feb 21 '11 at 13:32
    
also who will the closed source app be distributed too? and which version of GPL is the license –  jk. Feb 21 '11 at 13:32
1  
@jwenting the question clearly says it's running out of process –  jk. Feb 22 '11 at 9:34
show 3 more comments

7 Answers

up vote 23 down vote accepted

Legally, I'd say it would be OK (but I am not a lawyer - consult a lawyer for legal advice).

Morally, it's pretty reprehensible. If you don't like the GPL, then the "proper" solution is not to use a GPL library.

Edit: To clarify, whatever the legal standing of the GPL with respect to whether dynamic linking is allowed or not, the LGPL was specifically created with the intent of allowing dynamic linking in the case of libraries. So it seems clear to me that by choosing the GPL over the LGPL, the author of the library was doing so explicitly to disallow dynamic linking. Using a technical means to work around a legal restriction that expresses the author's explicit intent for his code is what is reprehensible, in my opinion.

For the record, I'm not personally a fan of the GPL (I prefer a more permissive license such as MIT or BSD). However, I am a huge fan of respecting the work of other developers, and if they don't want you link their library with closed-source software, then that's prerogative.

share|improve this answer
6  
I don't think there is a moral problem here - the GPL seems to explicitly allow his use-case –  jk. Feb 21 '11 at 14:03
2  
@vartec are you sure that you understand GPL? Using lib in our code - both statically and dynamically linked is derivative. If you want to choose license for your code then don't mess with GPL, that's it. –  Andrey Feb 21 '11 at 14:21
3  
@vartec here is quote from official GPL FAQ: "Linking statically or dynamically with other modules is making a combined work based on. Thus, the terms and conditions of the GNU General Public License cover the whole combination." If Stallman has different vision of what Open Source is, it doesn't meant that he hates it. He is one the main ideologist of this movement. –  Andrey Feb 21 '11 at 14:54
6  
@vartec: I get the impression that you do not understand that, when you use SOMEONE ELSE'S code in YOUR application, YOU are required to comply with the terms that HE put on use of HIS code. Don't like it? Don't use someone else's GPL'ed code. That simple. –  John R. Strohm Feb 21 '11 at 14:59
2  
Here is my suggestion: derive the hell out of that GPL code you seem so dependent on and see how the court case turns out. GPL3 was created to plug just such a legal holes in GPL2, so maybe you will get away with it. I doubt people will throw parades in your honor because you got away with a legal maneuver and if you are effective enough, people will license their code with more terms of use just to spite you. In the end, that might improve the world by avoiding threads like this one. –  Godeke Feb 21 '11 at 15:44
show 35 more comments

IANAL but I believe you are ok, the relevant section of GPL3 is at the end of section 5:

A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.

This is probably going to depend on exactly what your 'client' does, mouviciel's answer is probably good guidance on how to do it safely

If you think your app is an extension of the library rather than something aggregated with it then you are probably right (you should be in a good place to know this) in which case your best bet is to contact the author and try to get a different license

this would seem to back my position that this is explicitly allowed by the GPL, assuming done properly.

share|improve this answer
    
I read it, but the problem is that GPL text is written in legal language, not in development. The trick with wrapper is to make commercial app "aggregate", not "derivative". But I think it falls under "nature extensions of the covered work". –  Andrey Feb 21 '11 at 14:01
    
well for help on legal language you will need a lawyer. If you think your app is an extension of the library rather than something aggregated with it then you are probably right (you should be in a good place to know this) in which case your best bet is to contact the author and try to get a different license –  jk. Feb 21 '11 at 14:07
1  
@Andrey: If the "nature" of your program is directly tied to the GPL code, the section quoted above would not apply. From your question it sounds like that is the case. A counter example could be a network intrusion analysis program which just happens to use GNU readline through the mechanism you propose. (Readline is an interesting test case because there's a BSD-licensed drop-in alternative.) –  Fred Nurk Feb 22 '11 at 22:32
    
The "aggregate" clause is to make it clear that being on the same CD-Rom or Linux distribution is not creating a derivative. –  Sean McMillan Aug 31 '11 at 17:03
add comment

See the I'd like to incorporate GPL-covered software in my proprietary system. Can I do this?

The question is, is your wrapper application any use on it's own? If you made a command line version of your program that was GPL you could release the GUI under a different license. For example you could make an IDE for gcc that was closed source or a visual diff tool based on diff.

However, if you wrapped up library has no use other than being used by your program, and you'd program has no use without this library, than it's a derived work and would need to be released under the GPL.

share|improve this answer
add comment

IMO, legally it's OK. (IANAL) To improve on the moral side of the issue, don't call it a "FooBar wrapper that makes FooBar legaly available to MyClosedApp", call it a server. Make it a nice little open source program that "allows to do FooBar over the net". Put it on SourceForge or dedicate a website to it, with project page and instructions and stuff. Then let "MyClosedApp" just use the "FooBar server".

share|improve this answer
add comment

As far as I understand, you can leave your software closed-source as long as it is able to do its work without GPL library. See the GPL library as a plugin whose absence does not make your software useless.

share|improve this answer
1  
that is definitely wrong. using it as plugin (aka dynamic linking) makes resulting application "derivative" and subject of GPL. –  Andrey Feb 21 '11 at 14:02
    
I'm not sure plugin is always synonymous with dynamically linked. And certainly in this case the OP is not proposing dynamically linking anything so I think mouviciel's advice stands –  jk. Feb 21 '11 at 14:24
    
@jk well, if you create only one plugin and it is based on GPL license this smells as violation. –  Andrey Feb 21 '11 at 14:25
    
maybe, maybe not, bear in mind they still provide the framework for anyone to create a replacement for the GPL library. and if the specific license allows that (GPL 2 and 3 would imho, AGPL wouldn't) they are fine –  jk. Feb 21 '11 at 14:43
4  
The AGPL wouldn't forbid this unless the socket was over a network. It's fairly specific. Also, it's not a test of usefulness, but of how closely the GPLed and proprietary software are. Static linking is definitely too close, sockets (except for the specific AGPL case) are definitely OK, dynamic linking may or may not be (I've heard legal-sounding arguments on each side, and there's no US case law yet). –  David Thornley Feb 21 '11 at 16:55
show 1 more comment
  1. try to find Open Source alternative, if there is none, go for the GPL one;
  2. check if it's GPLv3 with Affero clause if it is, there is nothing to be done;
  3. if it's GPLv2, you can do exactly as you suggest;

There is also somewhat controversial option. Under most legislatures dynamic linking should be boundary to "derived work". The logic behind this is, that while dynamically linking you're just including header files in your program. In many legislations header files are considered API definition and explicitly excluded from being copyrighted. On the other hand, with dynamic linking, actual linking with GPL library is done on end-user's system. But as I've said, there is lot of controversy with it, Stallman is strongly FUD-ing against this.

share|improve this answer
    
what is that difference between GPL v2 and v3 that makes my hack impossible? What I do it not dynamic linking, I decoupling them as much as possible. –  Andrey Feb 21 '11 at 14:23
    
One of the goals of GPLv3 was to prevent that method of 'circumvention'. –  vartec Feb 21 '11 at 14:25
    
+1 for AGPL ----- –  jk. Feb 21 '11 at 14:51
4  
First, the GPL variants are official, OSI-approved, Open Source licenses (much as the BSD license without advertising clause is a Stallman-approved Free Software license). Second, no GPL version (including Affero) restricts your ability to have GPLed and proprietary software communicate with standard inter-process communication methods, like sockets. –  David Thornley Feb 21 '11 at 16:51
1  
@vartec: DRM is not a "Field of Endeavor". See the "For example, it may not restrict the program from being used in a [commercial venture], or from being used for genetic research." OSI apparently believes the GPL3 is Open Source and meets all points of their definition, because they approved it. –  Thomas Edleson Feb 22 '11 at 14:53
show 2 more comments

Would it be legal for Adam Brown to write a program which used a GPL library and acted as a "server", if he released all the source code to everything associated with it, but the only client code he released was pretty feeble because that's all he'd written client-side? I see no basis whatsoever for thinking it wouldn't.

If Charles Dover found Adam Brown's "server" and decided to write a closed-source program to communicate with it, would the GPL constrain his actions in any way? Not that I can see, since his only usage of GPL'ed software would be as the binaries he received from Adam Brown. If he distributed Adam's binaries he'd have to include a link to the source as well, but nothing else in the GPL would affect any of Charles' code.

With regard to one person writing a GPL-licensed server, and then using the server for his own closed-source purposes, I wouldn't think there should be any legal problem if in writing the server he made a bona fide effort to make it useful to others who might wish to use the supplied GPL code in the same way. In particular, the publicly-released documentation of the interface should be sufficient to allow a competent programmer to either write code for a server which would be accepted by the client program just as the original would be, and to write client programs that would use the server in the same fashion as the author's application.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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