By Alireza Alavi • 13 minutes read •
Disclaimer
This isn't legal advice. I'm not a lawyer.
Table of Contents
- Types of licenses
- Compatibility and re-licensing
- Combining code with different licenses
- Choosing a license
- Other good resources
- References
A license on your software determines your legal duties and boundaries on:
- what you can do with your software
- how you can distribute it
- how derivative work must be handled and licensed
- how it can be used within other projects
- what other projects you can use within your project
- etc.
You must take care when licensing your product, since it can affect:
- it's usage
- distribution
- meaning.(proprietary software, source available, FOSS)
This is a legal matter, you can't just read a 10min blog post on it and be all set.
Take your time, read through established guides (like those on fsf.org), and most importantly, read your final candidate licenses (I know it's boring to death but it's a must)
Types of licenses
Permissive Licenses (Lax)
Permissive licenses or as Richard Stallman and Free Software Foundation(FSF) likes to call them: pushover licenses.
we call them “pushover licenses” because they can't say “no” when one user tries to deny freedom to others.
They allow almost anything. You can use the code in any way you want and do what ever you want with it, and you will have no obligations.
Examples:
- MIT License
- Apache License 2.0
- BSD License
Intermediate (Weak copyleft)
Intermediate licenses are those which have substantive requirements on redistribution but are not copyleft licenses.1
- What this usually means is that you can use the product without modifications (Verbatim) for anything even In proprietary software. But if you make any changes to it you must release the "modified work" under the same license
- Examples:
- LGPL (GNU Lesser General Public License)
- EPL (Eclipse Public License)
- MPL (Mozilla Public License)
Copyleft
Copyleft is a general method for making a program (or other work) free (in the sense of freedom, not “zero price”), and requiring all modified and extended versions of the program to be free as well.2
- Any derivative of the Copylefted work or any work that directly uses the copylefted work must also be released and copylefted
- Definition and scope of "Uses" depends on the license, but for example, here is how GPL v3 defines them (refer to the GPLv3 license):
- "Linking"
- Using the program (eg.
import "foo")
- Using the program (eg.
- "Modifying"
- Is "Covered work"
- "Linking"
- Examples:
- GPL (GNU General Public License)
- AGPL (Afferro General Public License)
Compatibility and re-licensing
Permissive licenses (Lax)
In general, they are all compatible with each other and with other licenses, since they don't prohibit anything and allow everything (There are some exceptions1)
In a combination of programs under lax licenses, each part carries the license it came with. When the code is merged to the point that the parts can't be distinguished any more, that merged code should carry all the licenses of the merged parts. Since all the licenses are lax anyway, this causes no practical problem except that the list of licenses gets long.3
- You can usually re-license the derivatives of lax-licensed software to anything
Intermediate licenses (Weak copyleft)
Intermediate licenses tend to be incompatible with any copyleft licenses because their requirements don't permit the combined program to be under the copyleft license.1
- Examples
- LGPL (GNU Lesser General Public License)
The GNU Lesser General Public License, version 3, is really the GNU General Public License version 3 plus some added extra permissions. GPL version 3 (section 7) says you can always remove added permissions, and by doing so you get the same code under the ordinary GNU GPL version 3.
If a program permits use under GNU LGPL version 3 or later, you can relicense it to GPL version 3 or later1- it permits linking with non-free modules.
- It can be re licensed to GPL, so they are compatible
- LGPL (GNU Lesser General Public License)
Copyleft
- Requires all reuse to be in programs under the same license.
=> If you use a copyleft library or piece of code, you have to release your whole software under the same copyleft license
=> You cannot use software licensed with these in proprietary software
=> A Copyleft licensed software will live on forever as a Copyleft licensed software
In general, two different copyleft licenses are unavoidably incompatible unless they have explicit compatibility provisions. This is not due to a mistake in the details; it's inherent in the idea of copyleft.1
- “Modified and extended versions must be under the same license.”
=> If license A (on program P) says extended programs must be under license A, and license B (on program Q) says extended programs must be under license B,
=> the license of the combined program which includes code from P plus code from Q would have to be A, and it would have to be B. 1
=> they have an irreconcilable disagreement. - So even GPL v2 and GPL v3 are incompatible. This means that this is a common thing in the world of software, and we have ways to handle it. We can't expect every license to be compatible with each other.
There are two approaches for avoiding the incompatibility problem caused by different versions of copyleft licenses. 1
- FSF's approach is asking to release programs under the license "GNU GPL version N or any later version". This way derivatives and the software will not be stuck on only version N. They can be upgraded to later versions of the license
- The other approach is to make each version of the license explicitly allow upgrading to later versions.
- the GNU licenses give authors a choice about whether to permit upgrades to future license versions.
Programs such as Linux, which allow only one GNU GPL version and reject license upgrades, cause practical incompatibility.1
- Some copyleft licenses allow cross-copyleft combinations with an explicit relicensing clause giving permission to put the code under a different copyleft license.1
- Explicit relicensing permission is not the same thing as compatibility (though relicensing code can make it compatible with other code) and it is not symmetrical. For instance, the CeCILL license gives explicit permission to relicense code to GNU GPL, but the GNU GPL does not permit relicensing to the CeCILL.
Dual licensing
it means that the same program carries a choice of two or more different licenses.1
- For example, older versions of Perl were dual licensed under "Artistic License" and "GPL".
This meant that each user could choose to use and redistribute Perl under one license or the other, or under both in disjunction like the Perl release itself.
A disjunction is compatible with a set of other licenses if any one of the license choices in the disjunction is compatible with that set.1
Combining code with different licenses
When a set of licenses are compatible, that means you can legally combine or merge a number of programs each licensed under one of those licenses.3
- If the licenses don't allow re licensing to each other(most copyleft licenses don't allow that), the licensing of the combined program includes the licenses of all its parts (They have to be compatible).
- Pay attention to the definition of "Combining code", "Derivative", "Modified work" etc.
It means different things under different licenses.- for example
- in GPL:
A “Combined Work” is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the “Linked Version”.4
- in EPL v2:
“Modified Works” shall mean any work in Source Code or other form that results from an addition to, deletion from, or modification of the contents of the Program, including, for purposes of clarity any new file in Source Code form that contains any contents of the Program. Modified Works shall not include works that contain only declarations, interfaces, types, classes, structures, or files of the Program solely in each case in order to link to, bind by name, or subclass the Program or Modified Works thereof.5
- in GPL:
- for example
Choosing a license
This post from gnu.org is a really great guide, But here is a summary:
Permissive licenses
It is not worth the trouble to use copyleft for most small programs. We use 300 lines as our benchmark: when a software package's source code is shorter than that, the benefits provided by copyleft are usually too small to justify the inconvenience of making sure a copy of the license always accompanies the software.6
Libraries: if you are aiming to convince proprietary application developers to use your library that implements free format, you would need to make that easy by licensing the library under a weak license6
MIT License is a very common permissive license today. It's one of the most common licenses for open source projects.
I advise to not use permissive licenses for your projects unless you have good reasons. They take away the freedom from your users and make exploitation of volunteer work very easy, since big corporations and proprietary software can take their work and never contribute back, making users pay the price for things that otherwise could be free (both as in price and as in freedom). That's why all big corporations heavily push permissive licenses.
In summary, choose permissive license:
- For small programs (smaller than 300 line mostly)
- Libraries that are meant to be used within proprietary software mostly (implements free format, compatibility etc.)
- If you value freedom of software, don't just use the MIT or other lax licenses, unless you have a good reason to do so.
Among the weak (pushover) licenses, Apache 2.0 is best; so if you are going to use a weak license, whatever the reason, we recommend using that one.6
Intermediate licenses (Weak copyleft)
FSF recommends:7
The most common case is when a free library's features are readily available for proprietary software through other libraries (No unique capability or advantage). In that case, the library cannot give free software any particular advantage, so it is better to use the Lesser GPL(weak copyleft) for that library.
When a library provides significant unique capability, Releasing it under a copyleft license forces either proprietary software to go FOSS or not use it. Which gives advantage to FOSS.
I would also add, when you are developing software for a company to use in proprietary software, and out of goodwill or other reasons you decide to make it FOSS, you can use weak copyleft licenses, so your company can use the software in their proprietary products, but also the software stays FOSS and any change(derivative) to the code has to be released under the same license.
This keeps the software freedom moving forward, while allowing it to be used verbatim in other products.
Of course, you can license your product with copyright for yourself and your company, but that adds complications that I'm not sure about, and also it's kind of against the FOSS spirit I think.
With good weak copyleft licenses, you attract more businesses to use your product and you can create a better financial model of sponsors and such for your product than copyleft software. But if they want to modify it, they must open source their work and contribute back.
I think this is a great balance.
In summary, choose intermediate license:
- Program/library that doesn't have much unique capability or advantage over proprietary opponents
- Program/library that you want to be kept open source but also be easily usable within proprietary software
- The FSF recommends LGPL as weak-copyleft license of choice, since it is compatible with other GPL licenses. But there are other weak-copyleft licenses like EPL v2. Do your research and see what suits your needs.
Copyleft
Proprietary software developers have the advantage of money; free software developers need to make advantages for each other.
Using the ordinary GPL for a library gives free software developers an advantage over proprietary developers: a library that they can use, while proprietary developers cannot use it.7
When a library provides significant unique capability, Releasing it under a copyleft license forces either proprietary software to go FOSS or not use it. Which gives advantage to FOSS.
If we amass a collection of powerful GPL-covered libraries that have no parallel available to proprietary software, they will provide a range of useful modules to serve as building blocks in new free programs. This will be a significant advantage for further free software development, and some projects will decide to make software free in order to use these libraries.7
In summary, choose intermediate license:
- If your product is unique, valuable, has advantages over other products
- Being copyleft is a critical part of it's functionality
- The recommended copyleft license is "GPLV3 or later"
Advocating Copyleft
Imagine if Linux, Blender, GIMP, ffmpeg, GNU coreutils (cat, cp, tee etc.), gcc, wordpress, openJDK, GNU R (R lang), VLC, ClamAV, and so on, didn't use copyleft, which meant they would be overtaken by big corporations much more simply and nobody had to contribute their improvements back to the projects. Therefore I would argue we wouldn't have the larger portion of the software that is actually good and valuable, especially free open source software (How many actually good non-FOSS software do we really have?).
We have seen it, and it's been proven that corps like Microsoft, Meta, Google hate user freedom (Who are they basically owned by, again?) and try to take away freedom from users, destroy their general computing rights and rights to their own privacy and hardware.
One of the latest examples is Googles' efforts in recent years to lock down android as much as possible and slowly getting rid of the GPL parts of their code (Android is based on the Linux kernel). Basically making the AOSP useless .
One has to be really blind to the truth not to see how hostile these entities are and how much of a safe barrier FOSS has been for us to prevent their greed from devouring us whole.
So if you have a good idea, please consider choosing a copyleft, or at least weak copyleft license for it, for the sake of humanity and freedom.
Other good resources
- https://www.mend.io/blog/top-open-source-licenses-explained/
- https://www.mend.io/blog/why-open-source-license-management-matters/
- https://isitreallyfoss.com/
- https://www.tldrlegal.com/
Discuss this post on HackerNews