views:

143

answers:

3

Hello all.

I have a two part question regarding licenses and distribution of a library.

Background

I started working with a project (let's call it lib-xyz) that initially used a GPL library. The project is a collection of classes and algorithms that are meant to be used as a library. Regarding the usage of the GPL library, only a class ChildA that derives a BaseClass uses it. Moreover, BaseClass and all its derived classes are used only internally by the library.

Where I work, they are not particularly interested in sharing this library under the GPL, as required when using another GPL library. However, CeCILL licenses are widely accepted.

We came up with the following solution:

  1. I separated ChildA in a separate shared library. Let's say lib-child-a
  2. I created a ChildB that derives BaseClass, a class that implements the basic behaviors of ChildA but it does not use a GPL library at all. It is very basic, it does not provide all the options and tweaks possible with ChildA.
  3. I changed the library so that when a BaseClass is created, a factory method checks if the ChildA is available thru dlopen/dlsym calls. When available, a ChildA is instantiated. If not, it fallbacks to an instance of ChildB.

Question 1

Is it possible (I mean legal) to distribute lib-xyz under a non-GPL license and lib-child-a under GPL?

Question 2

If answer to question #1 is yes, should I distribute each library separately? Or could I do it in a single container (zip, tgz, deb, pkg, etc...) ?

Thanks you very much for your help

Update Since the comments of ninjalj, Will and JosephH have made good points, I'll clear up a bit my situation.

My case is similar to the case in the response of Will. But in my case, it is not the READLINE library. It is the GNU Scientific Library. I use it to solve some ordinary differential equations (ODE). These equations may be solved by some of the popular numerical integration methods, such as Euler, Runge-Kutta, Cash-Karp, among many others.

Back to my case, I use the GSL in order to solve these equations using a class ChildA. Since GSL provides many solvers, ChildA permits to select among a list of solvers. We intend to distribute this class as a GPL library. In the other hand, another class ChildB also implements one solver. The main library then checks dynamically if the library of ChildA is available. It uses it when available but fallbacks to the ChildB class if not.

What I basically want to know (probably answered by ninjalj comment of Will's answer) is if the following case for distribution is acceptable:

  • distribute the closed-source library with a non-open-source license. The library will use an open-source library if available or fallback to its default behavior.
  • distribute the classes that use GPL library (separately??), with a GPL license
+4  A: 

You should have a look at the GPL FAQ, specifically the questions regarding plug-ins, such as this one, and, as Paul J. Lucas said, you should consult a lawyer.

ninjalj
+1  A: 

As people have said, a lot depends on the details of your exact situation, so you've not given enough detail for anyone to give you a full answer. I am not sure exactly what license you plan to release your code under and whether you plan to charge for it or not, though that may not affect the answer much.

The link ninjalj posted to the GPL FAQ about plugins may help you - though obviously that is the opinion of the FSF, and may not be entirely relevant in your jurisdiction.

It sounds like you are trying to develop a closed-source library on top of a GPL one, so even with your suggested mechanism, it's quite likely you'll be breaking the spirit on the license. Breaking the spirit of the license is not illegal, but is likely to annoy people.

Have you considered trying to obtain a different license for the library? Some libraries are available both under the GPL and a commercial license (granted in exchange for a payment, usually).

It may also be worth asking the copyright holders their opinion, as they are the (only) ones who could turn around and sue you.

If the copyright holder is the FSF, you'll want to have a very good lawyer, as they are well known for pursueing even minor technical breaches of licenses, and can be very aggressive.

(Note that I am not a lawyer and this is not legal advice, but I have had to deal with licensing of GPL software as part of my job. I'm afraid what you have is not that common a situation - most commercial software engineers stay well away from any GPL source code when writing a closed source application. Even using LGPL code can be troublesome, especially on embedded platforms.)

Update

Given your update to the question confirming that it is a FSF library you're looking at, I think you need to proceed with extreme caution. I'm presuming you don't plan to release your source code.

The API appears to be quite large, so unless you can create a much simpler API or a very dissimilar API between your libraries there will always be the argument that your work is a derived work.

If you choose to distribute the GPL library, ensure you fully comply with absolutely every requirement (ie. making the source code for the GPL parts clearly visible, and clearly including the text of the GPL license, and ensure that you don't accidentally claim any impose extra restrictions on distribution of the GPL part). Your license to distribute may otherwise be terminated permanently by the FSF. It would seem advisable to distribute the GPL part in a completely separate archive, and not to bundle it with the non-GPL parts, as this strengthens the argument that your product is not reliant on the GPL part to perform acceptably / as intended.

The FSF are unlikely to look kindly on what you plan to do (and many would view it as violating the sprit of the license). A preferable option would be to look for equivalent non-GPL libraries, but assuming there are none then you may be able to avoid violating the GPL if you are very careful. As others have said, take legal advice, and make sure it is from a lawyer who understands software licensing.

JosephH
+2  A: 

Really, here's the rule of thumb. If your system will work without the GPL library, and you do not use the GPL library in any way for your binary, then you're not bound by the GPL.

If, however, the GPL library is required to use your system (whether you provide it or not), then it's a derivative work, and bound by the GPL.

Simply, if I take your application, and the GPL library you're talking about doesn't exist on my system, does you application still function and provide its primary service?

A simple use case as an example.

FSF has a popular READLINE library. It does things, for example, like letting you edit command lines (like cursoring back through history, etc.). Basically, if you've ever used BASH, you've used the FSF READLINE library.

Now, you can write your application to support, but not need, the READLINE library. If the library isn't there, then you offer a crude, simple command experience, with no editing, no history, etc. But the application operates the same, since it doesn't care how the command is entered.

If during startup, the application were to find the READLINE library, it would then use it, via dynamic linking. If not, then it wouldn't. You can see that the READLINE library offers a feature that the application leverages, but does not need in order to function. The application works "the same" with or without it.

So. Does your application work without the GPL library? If so, then you're not a derivative work. If not, then you are and are bound by the GPL.

Update:

I think it would be unwise if you distribute your program with a minimal library, but the "common, expected" use, and, in fact, perhaps, the value of the system, is with the GPL library. That's basically subterfuge, frankly. Because your program really isn't usable without that library.

An alternate method may be to write a "mini-calc server" where you send expressions to be evaluated against the calculation engine. That engine is forked and talked to via pipes or domain sockets, and you GPL that little engine. Don't know if that will work with your performance profile, but you might be surprised how fast it can actually be with a binary protocol. Doesn't have to be some wacky expression language like C, could be a simple stack based protocol. <float> <float> add <float> sin return top of stack. No parsing, simple interpretation, work with the data directly on the stack, so no memory copies (beyond reading the pipe or socket).

If that doesn't work, there's always shared memory. Populate memory with data, trigger the engine with a pipe or socket write, "read" so it can tell you its done, pull results from the shared memory block. No copying or parsing there at all, and you can use your native data structures (trees, lists, maps, structures, whatever).

Will Hartung
Your advice directly contradicts what is written on the readline website: http://tiswww.case.edu/php/chet/readline/rltop.html"... if you want to use Readline in a program that you release or distribute to anyone, the program must be free software and have a GPL-compatible license."Your argument still has some good points. The important point would come down to the API - readline has a very simple API, so by using the API you are perhaps not creating a combined work. As per the plugin link Dean gave, if the API was more complex, it would be a violation of the license.
JosephH
I'd guess you could use the readline API and a non-GPL replacement for readline, like libeditline. but I'm almost sure you cannot distribute your program with libreadline without distributing your program as GPL.
ninjalj
@Will: Your point is very interesting. Also, the comment of @ninjalj made me think a bit and I updated the question.
YuppieNetworking