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.

I'm developing a commercial application that largely depends on the functionality of a library that will be developed with it. I'd like to open-source this library, because it offers functionality that is not found elsewhere and can be useful in other applications.

However, I will also use it in my own commercial application. I don't want to publish the source of the main application, but it is definitely not a derived work (think of calculator app using GPL licensed library to calculate sine). And if someone else commercially uses the library, I want to require them to publish any changes made.

Is the GPL license suitable for this or is LGPL perhaps what I need?

share|improve this question

2 Answers 2

up vote 8 down vote accepted

Since you are the author, you can give yourself the library under different terms from what you give the library to others (and you can give it under different terms to various others). As long as you are the only author or get all contributors agree to the special terms for you (you'd need good lawyer to write the agreement so that it's valid across the world though), you can give the library out under any terms you want.

This is what Trolltech has been doing for long years with Qt. It was GPL or commercial, so GPL applications like KDE could use it free, but if you wanted to write commercial application, you had to pay for it.

So if you want to get some advantage of the library, you can use that model too. Otherwise you have to use LGPL; A calculator using GPL library to calculate sine definitely and unambiguously is a derived work of the library and must be shipped under GPL.

Also don't forget that LGPL only excludes dynamically linked objects. If you don't like that, either use Mozilla Public License or GPL with library use exception like libgcc has, or one of the yet more permissive ones, i.e. MIT/X, new BSD or (as mentioned in comments) Apache License or Eclipse Public License (the later two are lately popular because they cover patent grants).

Derived work note: Everything that links to a GPL library has to be covered by it. Even things that don't directly depend on it. E.g. if you have GPL library "g" and another library "h" and link them both to application "i", you have to provide source not just for application "i", but also for library "h" that does not depend on "g"! That's because the linked binary is a derived work of the library "g" (for the binary it's obvious) and GPL requires that if you give that derived work to somebody, you have to give everything it contains under GPL except vaguely defined "system libraries". So it includes library "h" that itself knows nothing about "g"!

MPL note: Looking at Mozilla Public License I am not really sure what it covers. I think it does not cover larger software that includes the derived work, but I am not sure.

share|improve this answer
    
+1, though I would like to point out that GPL does not rule out a commercial application –  K.Steff Nov 19 '12 at 13:12
    
+1, nice explanation. I'm curious about your example, though: What if I don't have the source of h? –  Heinzi Nov 19 '12 at 13:20
    
@Heinzi: Than you can't use it together with "g" in the same application. Sometimes even if you do have the sources you are in trouble. The OpenSSL library with it's custom license is causing a lot of problems for open-source applications! –  Jan Hudec Nov 19 '12 at 13:28
2  
I'll add that Apache and Eclipse licenses are considered to be well suited for what the OP is after. –  Martijn Verburg Nov 20 '12 at 8:10
1  
@Jaap: You can't "assign" copyright in many legal systems, so this can easily get you in trouble with non-US contributors. Having contributors grant you extra rights is more reliable. If you search for the old Qt license, it did just that – said that Trolltech is granted some extra rights. –  Jan Hudec Nov 20 '12 at 9:10

I'm not a lawyer, but

  • AFAIK, the definition of derived work is more extensive than you think and your program will be a derived work of your library

  • as long as you are the copyright holder, nothing prevent you to publish derived work in closed source. It's when you accept contribution of others than things become complex as you aren't the only copyright holders and the others may have objection. There are solutions -- you may for instance accept contribution only if they come along with a copyright assignation to yourself, that's what the FSF does -- but you need a layer to put them in place. As a kind of possible complication, some intellectual property rights aren't transferable in some countries.

share|improve this answer
    
I believe the copyright assignments as FSF does them are quite tricky to write so that they actually apply across the world, but a simpler agreement that the original author has extra rights to the work should be sufficient and easier to write in proper legalese. –  Jan Hudec Nov 19 '12 at 12:49
    
@JanHudec, easier, if you are a lawyer; and my guess is that they'll sent you to a colleague of them if they are not specialized in IP. –  AProgrammer Nov 19 '12 at 16:43
    
No, I am not a lawyer. But not being in US I know there are trouble with some similar agreements (I believe FSF has good lawyers and their agreement is correct, but others might not be) that would be invalid under local law. –  Jan Hudec Nov 19 '12 at 20:31

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.