License query

A place for Ogre users to discuss non-Ogre subjects with friends from the community.
Post Reply
User avatar
lingfors
Hobgoblin
Posts: 525
Joined: Mon Apr 02, 2007 12:18 am
Location: Sweden
x 79

License query

Post by lingfors »

I'm thinking about open sourcing some of my projects, but I'm confused by the proliferation of open source licenses out there... So I was hoping someone here could help me find a suitable license.

What I want:
  • Users should not have to open source their entire projects if they use my code without modifying it.
  • If users do modify my code, they have to release the modifications. Users still shouldn't have to open source the rest of their code.
  • Users should be able to link both statically and dynamically against my code without breaking the license.
  • Users should be able to use my code in commercial projects.
If I understand things correctly, the first bullet point is not compatible with GPL and the second bullet point is not compatible with MIT. Not even the creator of LGPL recommends people to use LGPL...

So... What should I use?
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: License query

Post by jacmoe »

If you absolutely must use that horrible GPL license, you should probably use the GPL with the linking exception. :wink:

Keep in mind, however, that you can't force people to contribute back to your project.
Regardless of license.

Which is essentially why Ogre is now licensed under MIT.
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: License query

Post by jacmoe »

Here's the GNU Classpath license:
http://www.gnu.org/software/classpath/license.html
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
lingfors
Hobgoblin
Posts: 525
Joined: Mon Apr 02, 2007 12:18 am
Location: Sweden
x 79

Re: License query

Post by lingfors »

jacmoe wrote:If you absolutely must use that horrible GPL license, you should probably use the GPL with the linking exception. :wink:

Keep in mind, however, that you can't force people to contribute back to your project.
Regardless of license.

Which is essentially why Ogre is now licensed under MIT.
Well, the hole point is that I don't have to use GPL. The point is to find the license that is most suitable to my needs. ;)

And yes, I realize that people can just "steal" my code (as in taking my code, modifying it and using it in their own projects without contributing their modifications) regardless of the license I use. But hopefully, if I have a license that says that they should release the source if they modify my code, it will lead to more contributions than if I simply said "here's the code, do whatever you want with it". ;)
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: License query

Post by jacmoe »

I think you are wrong. :wink:

And I am not the only one:
http://www.stevestreeting.com/2009/09/1 ... -licenses/
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: License query

Post by jacmoe »

But - the GPL with the classpath exception should make you happy.
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
lingfors
Hobgoblin
Posts: 525
Joined: Mon Apr 02, 2007 12:18 am
Location: Sweden
x 79

Re: License query

Post by lingfors »

Hmm... Interesting read... Might be better to have a simple license that gives a lot of "freeloader" and a few contributors, rather than a restrictive license that gives less freeloaders but also less contributors. MIT license seems like the way to go, but I'll give it a little bit more thought. ;)
User avatar
lingfors
Hobgoblin
Posts: 525
Joined: Mon Apr 02, 2007 12:18 am
Location: Sweden
x 79

Re: License query

Post by lingfors »

I have another license query.

In my OgrePlanet project, I have a DataSource interface to allow users (currently only me) to use different kind of height data generation (procedural, heightmaps, etc). I have one such class that uses libnoise's "complex planetary surface" to generate the planet. However, the code from libnoise, which I've taken and modified to fit my own project, is licensed as GPL. What are the consequences, if I wanted to use the MIT license for my own project?
  1. No problem at all. Since my project is also open source, I can include it. However, if anyone else takes my project, incorporate it in their own project and releases it as closed source, they can't use the GPL'd source.
  2. Can't include it directly in my own project, but can release it separately under GPL.
  3. Can't release it at all without my entire project being GPL.
I'd like to emphasize that the code based on the GPL'd source is neatly contained in a single class, and taking it out wouldn't make much difference to the rest of the project (except that I'd have to create another way to create the terrain procedurally... Or leave it up to anyone downloading the source.)
User avatar
MrD
Goblin
Posts: 292
Joined: Wed Oct 21, 2009 3:16 pm
Location: England
x 1

Re: License query

Post by MrD »

It would be b or c, the GPL is a horribly viral license.

I'm not sure about this (I am not a lawyer), but if you made just that class into a DLL that was explicitly loaded at runtime but used a general interface, you might be able to get away with just having to GPL the source code for the DLL since your project in no way relies on the code inside the DLL.

Basically:
  • Create an interface for what you need to generate the heightmap in your main code
  • In the DLL, derive from and implement the interface and add some functions to return and destroy an instance of your derived class (these create and destroy functions should be C functions, in C++ you will need to put extern "C" around them to stop the compiler name mangling them)
  • In your main code, explicitly load the DLL and call the function that returns an instance of your derived class and store it as a pointer to your interface
  • Do what you need to do
  • When you are done, pass the instance you created into the destroy function of your DLL
  • Unload the DLL
  • Done
However, I have no idea if that circumvents the GPL from infecting your main project or not, and also my use of DLLs assumes that you are using Windows. You can use the internet for more information on how to create plugins using DLLs (which is basically what I just described above).
Insimnax Framework - A game framework for OGRE
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: License query

Post by jacmoe »

That is exactly what the Classpath GPL license allows you to do.
TBB is licensed under a GPL with an exception.
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
MrD
Goblin
Posts: 292
Joined: Wed Oct 21, 2009 3:16 pm
Location: England
x 1

Re: License query

Post by MrD »

Wait, so under the normal GPL, even using a GPL plugin infects your whole application?

Wow, how do companies that let you write your own plugins for things, like Autodesk for instance, go on with things like that?
Autodesk Person 1: "Oh, someone wrote a Max exporter that used some GPL code"
Autodesk Person 2: "Oh great! Now we need to GPL Max!"
Insimnax Framework - A game framework for OGRE
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: License query

Post by jacmoe »

Yes.
There's a lot of GNU'ers who believe that GPL should infect, even with dynamic linking.

But,this is a grey area:
http://en.wikipedia.org/wiki/GNU_Genera ... ic_linking

This is one of the reasons why I'd stay clear of that license..

But, the GPL with the Classpath exception explicitly allows you to static link, dynamic link and even put the files in a directory in your project and include it directly.
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 538

Re: License query

Post by Kojack »

Wow, how do companies that let you write your own plugins for things, like Autodesk for instance, go on with things like that?
Autodesk Person 1: "Oh, someone wrote a Max exporter that used some GPL code"
Autodesk Person 2: "Oh great! Now we need to GPL Max!"
Because Autodesk never agreed to the GPL. If I wrote a GPL plugin for Max, I'd be the one in violation the GPL because it requires the license to propagate but I don't have the authority to change the license of Max, so I should have never written it in the first place.
User avatar
MrD
Goblin
Posts: 292
Joined: Wed Oct 21, 2009 3:16 pm
Location: England
x 1

Re: License query

Post by MrD »

That's really messed up. One more reason to hate the GPL (and all viral licenses I guess). This is actually my main issue with the GPL, it aims to promote freedom, but in fact removes your personal freedom as soon as you see it.
Insimnax Framework - A game framework for OGRE
ppClarity
Gremlin
Posts: 194
Joined: Sat Sep 02, 2006 12:27 am
x 2

Re: License query

Post by ppClarity »

Kojack wrote:Because Autodesk never agreed to the GPL. If I wrote a GPL plugin for Max, I'd be the one in violation the GPL because it requires the license to propagate but I don't have the authority to change the license of Max, so I should have never written it in the first place.
ObIANAL... And since I'm not familiar with Max plugin development, I'll assume it's C++ code.

If to generate a binary plugin you need to link with libraries which carry a license that's incompatible with the GPL, then you've got a problem. But otherwise, no, not really. What wanders into grey territory is when you try to ship Max with the plugins preinstalled. Probably enough to make it into a courtroom if both sides were adamant, but shipping the plugin on separate media with it's own installer should be enough of a "cure".

But yeah, GPL is a horrid license for library code, even the GNU Foundation was forced to recognize that. That's why there's the LGPL. IMO, anything later than 2.0 is no longer Free Software, and has become Agendaware and should be avoided regardless.
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 538

Re: License query

Post by Kojack »

From the GPL faq:
Can I apply the GPL when writing a plug-in for a non-free program?

If the program uses fork and exec to invoke plug-ins, then the plug-ins are separate programs, so the license for the main program makes no requirements for them. So you can use the GPL for a plug-in, and there are no special requirements.

If the program dynamically links plug-ins, and they make function calls to each other and share data structures, we believe they form a single program, which must be treated as an extension of both the main program and the plug-ins. This means that combination of the GPL-covered plug-in with the non-free main program would violate the GPL. However, you can resolve that legal problem by adding an exception to your plug-in's license, giving permission to link it with the non-free main program.
Of course that last bit only applies if it's your code. You can't really add exceptions to the GPL if your plugin uses other GPL code.
ppClarity
Gremlin
Posts: 194
Joined: Sat Sep 02, 2006 12:27 am
x 2

Re: License query

Post by ppClarity »

This means that combination of the GPL-covered plug-in with the non-free main program would violate the GPL.
:shock: so the FSF wants to eliminate "fair use" too? Well that's just grand.

As an end user I can take two pieces of code with diametrically opposed licenses and put them together for my personal use and nobody can say boo.
User avatar
MrD
Goblin
Posts: 292
Joined: Wed Oct 21, 2009 3:16 pm
Location: England
x 1

Re: License query

Post by MrD »

Well that's just silly. They'll let you load a GPL plugin providing you don't actually then have the audacity to use it in any way... grand.
Insimnax Framework - A game framework for OGRE
Post Reply