51

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?

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

  • 5
    You 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 Irfan Jun 23 '15 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 Post Jun 23 '15 at 17:46
  • @iamcreasy we definitely don't want a separate question on this site for every possible pair of licenses. – Sparr Jun 23 '15 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 Irfan Jun 23 '15 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 Demski Jul 2 '15 at 13:44
53

I always look at the schema drawn by David Wheeler: Essay: FLOSS licenses

enter image description here

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?) – Zizouz212 Jul 4 '15 at 18:33
  • 2
    Follow 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. – Bruno Lowagie Jul 5 '15 at 6:27
  • 1
    Why wouldn't you be able to use BSD-new code in an MIT licensed project? – haneefmubarak Jul 26 '15 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. – muhmuhten Jul 17 '16 at 5:24
  • 1
    Where would CC-BY-SA 3.0 (such as code found on Stack Overflow) fit in? All the way over to the right? – gerrit Jul 7 '17 at 17:29
9

"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.

4

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).

  • 2
    Note 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. – vonbrand Feb 11 '16 at 1:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.