News:

Simutrans Tools
Know our tools that can help you to create add-ons, install and customize Simutrans.

Can I include a LGPL 2.1 licensed file inside simutrans?

Started by Markohs, February 20, 2013, 10:20:23 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Markohs

I'd like to use a library that I found they might be useful to my code inside simutrans, the code in question is:

http://code.google.com/p/hqx/

The thing is it's licensed in LGPL 2.1, will this be a problem to link inside simutrans? I'm asking because I don't really know much about laws, any help is welcome. Thank you. :)

More info about the lib: http://en.wikipedia.org/wiki/Hqx

Ters

Dynamically linking against LGPL (the first L is very important here!) isn't a legal problem, except that everyone distributing Simutrans with a binary version of that library must also distribute the source code for that library. Just telling people to get the source code from code.google.com or wherever isn't enough. (That has been a pain for me, but I think I understand the reason why.) A way around is to tell people to get the binary library from somewhere else themselves.

Copying it's code into the Simutrans code, and perhaps also statically linking, though that might be forbidden altogether, means that Simutrans must also be licensed as LGPL (and source must always be provided when distributing binaries). Every Simutrans developer past and present must agree to such a relicensing.

This is how I understand it.

Markohs

That's quite restrictive... I was thinking just adding a note making explicit simutrans used that code, and statically link its code. Why do people use such restrictive licenses and don't just use BSD... :(

Adding it as a dinamic library seems a bit overkill for just using the algorithm. Well, I'll make my tests and if it's worh it I'll maybe include it. But maybe just implementing a linar interpolation algorithm will be enough, even it won't look so good.

I was thinking using this to allow resizing of the screen while on loading screen, and to implement zoom levels in simutrans. Well, we'll see.

Thank you Ters.

Ters

As I understand it, the principle behind the GNU licenses is that the user should always have access to the source code for any software (s)he uses and be able to modify it for their own benefit. With static linking, users are unable to swap out the library with another version unless they also have the source code (or at least the object files, but those are rarely distributed) to the main application and other static libraries. LGPL therefore enforces dynamic linking. GPL allows static linking, but enforces GPL on the rest of the application also.

prissi

You can obviously program the same stuff without using their code. OR be inspired by the code used for the same purpose by OpenTTD.

Ters

Unless there's a software patent on the algorithm. I don't know if you can combine a patent and an open source license, but I wouldn't be surprised if it could, just dizzy.

Markohs

Yeah, but I don't like reimplementing it when it's already implemented and working somewere else just to avoid a license. Why re-programming the same idea again (with its testing and debug)? Ok, I'll see what can I do.

About the user being able to get the source code again of the library, just menctioned its source should be enough, imho, if the idea is not taking property of the software.

Ters

What do you mean by "menctioned its source"? It's not just the c that puzzles me.

Markohs

the c is a typo/error that comes from the spanish "mencionar", mention. :)

i mean just saying that part of the code is not authored by you and pointing where did you got the code from, should be enough.  After all free code should mean "use freely" code,  not "use it with all this limitations".

Ters

Quote from: Markohs on February 20, 2013, 07:58:26 PM
i mean just saying that part of the code is not authored by you and pointing where did you got the code from, should be enough.  After all free code should mean "use freely" code,  not "use it with all this limitations"

And what happens when that place you got the code from no longer exist? Or no longer has that version available for download (with the current versions being binary incompatible)? (L)GPL ensures that for every binary distribution available, bundled as part of something else or otherwise, there is also a corresponding source distribution. That way, the demise of any single distributor, especially the original, doesn't mean that the source code is no longer available. Only once every distributor of the software (on it's own or embedded in something else) has "died" and no end-users remain that has also downloaded the source, does the license fail in it's open source goal, and the software "degrades" to effectively closed source.

Markohs

#10
there will allways be a copy of the code, I challenge you to cite here any disapered free code. if anybody can copy it, there will be a copy anywhere.  and if it wasn't so, the disadvantages outweight the advantages imho. anarchy for the free code is the best option imho. :) after all if nobody cared to conserve a program,  it was not worth it.

TurfIt

Simutrans already uses a LGPL 2.1 library - SDL. (although I don't believe it's in compliance. IANAL. TINAL. etc. etc.)

Ters

Quote from: Markohs on February 20, 2013, 08:36:13 PM
there will allways be a copy of the code, I challenge you to cite here any disapered free code. if anybody can copy it, there will be a copy anywhere.  and if it wasn't so, the disadvantages outweight the advantages imho. anarchy for the free code is the best option imho. :) after all if nobody cared to conserve a program,  it was not worth it.

The GNU people believe otherwise. Besides, the fact that someone in Japan that I don't know about has a copy of the code on a floppy disk in a closet at his parents place isn't of much use to me if I want the source code for something to fix a bug that's bothering me.

I'm frustrated with the demands in the GNU license, but I think I understand the reason for them. But the license is hard to read, something I don't understand the reason for. I also suspect that the GNU people live in a world where no one downloads binaries, but compile stuff themselves from the source code.

Quote from: TurfIt on February 20, 2013, 08:47:20 PM
Simutrans already uses a LGPL 2.1 library - SDL. (although I don't believe it's in compliance. IANAL. TINAL. etc. etc.)
SDL has switched to zlib license for version 2.0, so hopefully, they don't care much about that.

Markohs

#13
Quote from: Ters on February 20, 2013, 09:00:49 PM
The GNU people believe otherwise. Besides, the fact that someone in Japan that I don't know about has a copy of the code on a floppy disk in a closet at his parents place isn't of much use to me if I want the source code for something to fix a bug that's bothering me.

If someone really depends and still uses code only still present in the world in a closet in Japan I guess he really should consider switching to another library that's for sure doing a better job on it somewere. I can understand what you say, but I still consider anarchy is a better system to keep free sofware alive. There is plenity of code licensed under the BSD license alive on the internet, and that license gives you absolute freedom to use and distribute it.

You should also consider that it's very probable you using that code decide to include it to you own project, giving it a second life, and making it possible to persist more time in history, you've copied and prolly published it again on the internet.

But I guess this is a delicate subject, and everybody has his personal oppinion. :)

I don't really care anybody using any piece of code I've contributed to simutrans anywere, given that they mention me. And for me, they can still not mention me, I don't really care, it's code I've published on the internet anyway.

I don't think algorithms should be a subject of patents too, they are just ideas anyway.

VS

I don't know where everyone always goes to get their misinformation :-/ LGPL is different from GPL precisely in that you do not have to change license of everything else.

As I see it, our current license already satisfies all the requirements that LGPL sets on the combined work - we offer both program and code (read section 6, first paragraph in particular). Toss in the new file and its license.txt, add to credits rolling on start screen and you've done more than enough...

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

rainer

Ooh... Uh...

There are way too much wrong assumption and statements (on the legal and
philosophic side) in that thread. Commenting all of them is beyond my time
and motivation (and space here...).

(Sidenote: VS, thanks for your good reply)

Markohs, I will happily bring you in contact to a license lawyer who normally
don't write an invoice when just handling a simple question from the Free
Software world. Ideally, he will produce an answer ready to be published
here. Just send me a PM with your email address and I will take care.

Just as a single note, as you are voting for "anarchy" regarding license
issues, I would like to quote the lawyer I am thinking of: "In an ideal world,
the BSD license would be the ideal one." Sadely, we are still struggling for
an ideal world. Until then, we still need licenses (and lawyers and courts
and and and...).

Hope that helps a little bit.

Markohs

So as long as I include the LGPL source code of that library inside simutrans, not removing any comment, and give proper attribution in simutrans license text I can use the library freely?

sdog

whole point of LGPL is that anyone who wants to use the program can modify the LGPLed library and compile the whole program again. As long as the source code linking to the library is provided, doesn't even have to be free, this ought to be enough.

Historically this was absolutely necessary for using UNIX, replacing UNIX libraries with GNU libraries. Since the source code was openly available, but the software was proprietary.

Providing the sourcecode of the library can't be an obstacle either, we got repositories for simutrans code, adding the sourcecode of the library is hardly an effort.

Have to quote TurfIt with IANAL, and it applies to me too.


Out of curiosity: you are statically linking because of performance reasons?

Markohs


Ok, got it, so as long as I include the licensed files in the repository and add to the license reference, ti won't be a problem.

Quote from: sdog on February 20, 2013, 11:59:36 PM
Out of curiosity: you are statically linking because of performance reasons?

I want to link statically for two reasons, first performance, because if it will be used to scale simutrans images it needs to be as fastest as possible (this will include prolly modify the routines interface a bit), but mainly to not add one external dependency that can be easily avoided in this case.

But it's just a idea, comments are welcome ofc.

Ters

Quote from: VS on February 20, 2013, 10:34:43 PM
I don't know where everyone always goes to get their misinformation :-/ LGPL is different from GPL precisely in that you do not have to change license of everything else.

As I see it, our current license already satisfies all the requirements that LGPL sets on the combined work - we offer both program and code (read section 6, first paragraph in particular). Toss in the new file and its license.txt, add to credits rolling on start screen and you've done more than enough...

When did anyone write that we have to change the license to link against LGPL? (Except me wonderings about static linking, which I'll return to.) The thing is just that if we distribute LGPL software in binary form (as part of a Simutrans distribution) we also have to distribute the source code of that LGPL software. This is per section 4 in LGPL 2.1. Reading the preamble, it seems that dynamic linking is not specifically required, but the user must be able to swap out the library with other versions. This means that at least an unlinked version of Simutrans must be made available to the users. As long as the source code for Simutrans is available, static linking should then not be a problem.

Although Google Code links to LGPLv3, I haven't found any statements that hqx allows upgrading the license. A difference in v3 seems to be that the source code distribution requirement is lifted when linking dynamically (4d1 vs 4d0).

Unfortunately, I can't find any specifics about distributing LGPL binaries in the GNU license FAQ, but as far as I know the only difference between GPL and LGPL is that the latter doesn't require GPL on the software it is combined with. The library itself remains under GNU license even after linked to something else I believe.

The FAQ says this about distributing source code:
Quote
The general rule is, if you distribute binaries, you must distribute the complete corresponding source code too.  The exception for the case where you received a written offer for source code is quite limited.
It also forbids just distributing a diff if you've done modifications.

VS

I also found that ironically, v3 is "better" than v2.1 :) Of course I am not a lawyer either, but the language is rather plain... and I refuse to be lawyered out of simple matters like that :p

As to diffs - why bother? Is there any strong reason against simply putting the source into our svn, as it already is with squirrel?

Quote from: Ters on February 21, 2013, 05:48:15 AM
When did anyone write that we have to change the license to link against LGPL? (Except me wonderings about static linking, which I'll return to.)
Quote from: Ters on February 20, 2013, 04:19:49 PM
Copying it's code into the Simutrans code, and perhaps also statically linking, though that might be forbidden altogether, means that Simutrans must also be licensed as LGPL (and source must always be provided when distributing binaries). Every Simutrans developer past and present must agree to such a relicensing.
If it was wondering, it was rather matter-of-fact-like ;)

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

Ters

Copying the source code into ours could probably require relicensing, as it could be seen as a combined product beyond just linking, and is either way overkill. As sdog points out, Simutrans has distribution facilities in place, so putting up another zip file isn't really much of a problem.

sdog

I actually meant the SVN. Putting two files into the same directory is not combining products, or sourcecode. If you want to be safe you can just make a subdirectory clearly named as an external source, put the LGPL license agreement into it and you are fine.

Ters

It's a bit ambiguous. In general, I don't like dragging external stuff into ones own source tree, both because the source code becomes a mess of different licenses and because it becomes a bit harder to keep the external stuff up to date. But I see the advantage for people who just want to check out and build, especially with languages like C/C++ where there isn't any established way of automatically fetching dependencies from some repository and making them available to the compiler. I've done so twice: with Lua, which I also modified slightly to use exceptions rather than setjmp, and with some example code that wasn't really distributed as a product anywhere.