Given two open source projects, each with different licenses, are there metrics or resources I can use to determine if it is legitimate to copy code from one of the projects to the other?
-
5You question needs to be more specific. What two licenses are you trying to compare? The straight forward answer is to read the respective license agreements yourself or ask a lawyer.– Quazi IrfanJun 23, 2015 at 17:40
-
7@iamcreasy That's not necessarily true. GNU maintains a list of licenses along with notes about compatability - others do, too. While it's important to stress if you're not sure, check with someone who is, enough is 'out there', authoritatively, for one to reach an informed decision in many cases.– Tim PostJun 23, 2015 at 17:46
-
@iamcreasy we definitely don't want a separate question on this site for every possible pair of licenses.– SparrJun 23, 2015 at 18:01
-
@Sparr What I meant by my comment is - OP didn't say what he has read so far, and where the conflict is in his reading.– Quazi IrfanJun 23, 2015 at 18:09
-
Other good sources to compare different licenses are: choosealicense.com, Wikipedia and the How to choose a license Guide from FSF– Hans DemskiJul 2, 2015 at 13:44
3 Answers
I always look at the schema drawn by David Wheeler: Essay: FLOSS licenses
The arrows show which license you can use in the context of another license.
For instance: you can use software distributed as ASL 2.0 inside an LGPLv3 project and (a fortiori) inside a GPLv3 or AGPLv3 project. You can't use LGPLv3 software inside an ASL 2.0 project.
Just follow the arrows as a rule of thumb and double-check when in doubt.
-
Quick question, would I be able to skip boxes? (e.g. Go from Apache 2.0 straight to GLP v3?) Jul 4, 2015 at 18:33
-
2Follow the arrows. If there's a path that leads from Apache 2.0 to GPLv3 (and there is), then you can use an Apache 2.0 library inside GPLv3 software. Jul 5, 2015 at 6:27
-
1Why wouldn't you be able to use BSD-new code in an MIT licensed project? Jul 26, 2015 at 22:01
-
1@haneefmubarak Based on the date, BSD-new refers to the 3-clause BSD license (contrast BSD-old with the advertising clause), which retains the nonendorsement clause. Jul 17, 2016 at 5:24
-
1Where would CC-BY-SA 3.0 (such as code found on Stack Overflow) fit in? All the way over to the right?– gerritJul 7, 2017 at 17:29
"Compatible" in this case means that you can satisfy the terms of both licenses. So the only general approach is to read the licences, understand your obligations under all of them, and then determine if you can satisfy all of them.
For some common licenses, other people have already done that work. For example, the Free Software Foundation maintains a page called “Various Licenses and Comments about Them” where they say if they believe a license is GPL-compatible.
To be absolutely sure of what you're doing, it would be necessary to read through the legalese of the licenses to check what is and isn't allowed.
However, many licenses have human-readable pages, which should be sufficient for this: read through them, determine what the restrictions are on using code. You should check that:
- You're allowed to reuse code snippets from the project you plan to copy from;
- The project you're adding to allows you to use code from other licensed projects.
The second point there won't be a problem most of the time, but it is possible.
Of course, if both projects are yours there's no problem at all: you don't have to follow the terms of either license because you own the copyright. Licenses are simply there to give some rights to others (otherwise, technically, nobody would be able to do anything with your software).
-
2Note that the "read through the legalese and check" can only be done by someone versed in the language, i.e., a lawyer working in the copyright area. It is a complex, murky area of law. Even much more if the differences in copyright laws among countries comes into play.– vonbrandFeb 11, 2016 at 1:38