3

I'm seeking some advice regarding the following situation.
I want to port portions of code from a C++ source file, more specifically two methods that implement an algorithm I'm interested in for my PL/SQL project.
The C++ code is released under MPL-2.0, while my project is MIT like similar stuff I've already published.

Albeit a very small one with respect to the size of each project, I understand this is derivative work.

  • What would be the correct approach here in terms of licensing?
  • Is including a NOTICE with relevant details about the original code and license sufficient?

1 Answer 1

4

Yes, the Mozilla Public License allows incorporating MPL portions into your non-MPL project. This would make your project become a "Larger Work" in the language of the MPL:

1.7. "Larger Work" means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software.

So, your main project is the "Larger Work" and those routines that you ported would be the "Covered Software". Note that the license specifies you must place them in a separate file or files. In that case, the MPL license would only apply to those specific files (the "Covered Software").

Is including a NOTICE with relevant details about the original code and license sufficient?

That would be nice to mention somewhere -- as a reader of the code, it may be helpful if I were to read a comment somewhere that says that some specific code in question "is based on project XYZ" or "ported from project XYZ" or something like that. But the license does not specifically require that it be mentioned like that specifically.

The specific requirements of the MPL are to make available (to say how they can get it) the license of the MPL (See Section 3.1):

You must inform recipients that the Source Code Form of the Covered Software is governed by the terms of this License, and how they can obtain a copy of this License.

And then to preserve any existing copyright notices (Section 3.4):

3.4. Notices

You may not remove or alter the substance of any license notices (including copyright notices, patent notices, disclaimers of warranty, or limitations of liability) contained within the Source Code Form of the Covered Software, except that You may alter any license notices to the extent required to remedy known factual inaccuracies.

That is, if the original code included copyright notices or license notices, then you must preserve those in your derivative version. Of course you may add your own copyright notice as well and doing so is normally considered a best practice, since your changes (your porting work) are also your own creative work and thus receive their own copyright.

6
  • Thanks. In my case, I can't really put the ported code into its own file because the two methods are private and closely integrated with the rest of the code. That would require publishing them into their own standalone database objects and that's not what I'm inclined to do, especially for only a hundred lines of code out of 4,500. The only other way I can think of is having the ported code as literal "includes", but it's not supported natively in PL/SQL, that would require some preprocessing, just not worth the effort IMO. Commented May 31 at 10:35
  • @MarcBleron Every programming language I've encountered supports including code located in separate files. In the worst case, you'll have to add custom build steps into a build process that merges separate files together. In your case, to solve this programming problem, you should ask on a forum or SE dedicated to this lanaguage.
    – Brandin
    Commented May 31 at 14:20
  • You're correct, this case calls for an additional build step. I didn't say that I didn't know how to do it - for instance OOTB using SQL*Plus START command (or its shorthand @@) to actually source the external code, or a custom shell script etc. - I'm just considering this approach a bit overkill in the grand scheme of things, and I may as well consider putting the new source in MPL altogether. Commented May 31 at 16:07
  • What if the port is for a library? Is it sufficient to add a license header to the top of those ported files? Or must the whole library become MPL-licensed for its users? What if the published library would be MIT-licensed, but it includes a transitive dependency with the ported MPL code— then can the main library be MIT and would this even be useful if the library's users would also need to accept the MPL transitive dependency (and would it be misleading to describe it as MIT if that transitive dependency was required)?
    – Keavon
    Commented Jun 2 at 10:06
  • @Keavon The MPL doesn't make any distinctions between libraries and other type of software. Basically, the MPL says that the MPL-parts must be in their own file(s) and that the source code of the MPL portions must be provided. The requirement is similar to LGPL but the wording of MPL is less verbose and less specific.
    – Brandin
    Commented Jun 3 at 4:46

Your Answer

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

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