20

So I'm new to all this licensing jazz, and I've just started work on a project I'd like to one day publish as open source.

I've found a couple of projects so far that have code to accomplish stuff similar to what I'd like to do, and as such I'd like to use it because it is probably more mature/tested than what I'd end up writing at first.

Now here is my problem, some of the code is written under the MIT license and some is written under the EFL (Eiffel Forum License) and some under the Apache license.

I've looked through all 3 licenses, and they seem to be functionally quite similar, differing in small ways such as copyright attribution and something about patents.

Can I, legally, combine code written under these, or any 3 (similar) licenses? How? I'm not sure if this is correct, but as I understand it, if all 3 licenses are GPL compatible I could then license my project as GPL. However, in this case, I think copyleft is unnecessary and not something I'd be very interested in.

Does public domain code combined with licensed code work the same way?

If so, what license can/should I then put my own project code and modifications under?

And third, say I did one day want to go commercial and keep my software closed-source; I completely understand that if I previously released an OS version it would always remain so and people would be able to fork it and so on, but would this triple-mixing have any effect? (I assume it depends on the terms of each license here, I'm only asking if there is something I haven't considered)

3

2 Answers 2

10

The best option is to create a NOTICE (or perhaps NOTICE.txt or NOTICE.md) file in the root of your project code containing an introduction/summary, a list of copyright holders/project names and then all three license texts one after the other. And at the top of each source code file make sure you preserve the original copyright/license notice (optionally adding your name and the current year to it).

For binary distributions of the code, you must also have some way to access the license, for example in your "about" screen. The apache license refers to binary distributions as "object" code.

You are not required to distribute the source code at all with any of these licenses. If you only distribute binaries, not the source code, then only your binary needs to comply with the license terms.

If you're not happy about the license requirements, you can always email the project maintainer with your reasoning. They might give you permission to skip some of the requirements or even use a different license entirely – I've had good luck with this approach in the past.


As for what you're required to do (note these restrictions apply to source code and binary distributions of your app!):

MIT and EFL just require that copyright notices and the license text be "included" in you work. You can decide for yourself how to do this, as long as you make a good faith effort that people who want to know what copyright/license applies they can find out.

Apache has clear instructions:

  1. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:

    1. You must give any other recipients of the Work or Derivative Works a copy of this License; and
    2. You must cause any modified files to carry prominent notices stating that You changed the files; and
    3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
    4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.

      You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
3
  • apologies if this is answered by your answer but I guess I am still confused. I want to add code from apache 2.0 to my MIT license code. What are the exact files I need to modify? Do I modify the license? Or only add a notice.md file? Do I add a comment to the code I am modifying at the top? I am confused about what I need to do. Oct 19, 2021 at 19:24
  • @CharlieParker - The result CANNOT just have an MIT-license. The result must be clearly identified as bound by Apache license too. You'll have TWO LICENSE files, and a notice.md that refers to both of them. Each source file should have a line saying which license applies to it. If you find it necessary to combine from both sources within a single file, its best to list both at the top, with comments around lines of code that are from one or the other. MIT is permissive enough that it is often incorporated into Apache licensed projects; the other way around takes more work to do correctly. Nov 16, 2021 at 22:25
  • @CharlieParker - slight modification to what I just said. apache.org/foundation/license-faq.html#Distribute-changes says "You may distribute the result under a different license, but you need to acknowledge the use of the Foundation's software." So you can refer to your overall code as "MIT licensed", as long as you maintain the notice.md and license files as attribution. (And any Apache-licensed source files should mention Apache license). Previously I had seen opinions that the combination must be referred to by the slightly more restrictive license, which is Apache. Not so. Nov 16, 2021 at 23:11
7

The GPL has a clause that if any component of the project is licensed under the GPL, the entire project must be licensed under the GPL. This is where license compatibility comes in to the picture.

In your case, there are no clauses in the licenses of your components that forbid distributing the software under "mixed" licenses. You can release your product part MIT licensed, part EFL licensed, part Apache licensed, part licensed to your choice (your part) without any problem.

With public domain code you can do, barring moral rights, which have different implications in different jurisdictions, pretty much anything. Please note that there is not much public domain code available; it would be prudent to double check what you think is public domain actually is public domain (see also How can I place software in the public domain )

There are no additional problems with closing the source under mixed licenses, but do remember you can only close your IP, not anyone elses.

11
  • 1
    IMO is the best way to go about it putting all licenses in the root of the project, and put a license header in each file, per opensource.stackexchange.com/questions/202/…
    – Martijn
    Aug 25, 2015 at 12:51
  • 1
    @CupOfTea If you have multiple instances of code under different licenses in a single file you have what is colloquially known as an "unholy mess" ;) If it's based on an old version, and re-licensed to a new version, you could do a your own header, followed by "based on -link to original- by -original copyrightholer- under -original license-"
    – Martijn
    Aug 25, 2015 at 15:55
  • 1
    Heh, yeah. :p Thanks, indeed I'm probably going to end up adding copyright info at the top and saying something like "this file contains code licensed under MIT and EFL" and have LICENSE.MIT and .EFL files in the root. It honestly seems to me like the best way to manage this mess.
    – CupOfTea
    Aug 25, 2015 at 16:21
  • 1
    If you can link to the original MIT file and EFL file that would leave the least room for confusion.
    – Martijn
    Aug 25, 2015 at 16:23
  • 1
    The OP does need to pick a license for the combined work.
    – bmargulies
    Aug 25, 2015 at 22:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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