14

I rewrote some parts of Mercurial (which is licensed under GNU GPL v2) in C#. Naturally, I looked a lot into original Python code and some parts are direct translations from Python to C#.

Is is possible have "my code" licensed under different terms or to even make a part of a closed-source commercial application? If not, can I re-license "my-code" under LGPL, open-source it and then use this open-sourced C# library in my closed-source commercial application?

Anton Gogolev
  • 1,447
  • 2
  • 15
  • 23
  • 4
    If you worked from the original code (rather than reimplementing from the protocols and documents) it may fall into the realm of "derivative work" in which case it may still fall under the original license. Talk to a lawyer. –  Jun 04 '12 at 17:26
  • @MichaelT Wouldn't using docs and reverse-engineering protocols be a "derivative work" as well? – Anton Gogolev Jun 05 '12 at 08:57
  • 4
    not necessarily. The derivative work takes the original and transforms it into another form. With more traditional media, a painting is copyrighted, a photograph of the painting is a derivative work. When done correctly, a [clean room](http://digital-law-online.info/lpdi1.0/treatise27.html) reverse engineering avoids this. See also [What are the copyright & licensing issues of porting code?](http://stackoverflow.com/questions/3256967/what-are-the-copyright-licensing-issues-of-porting-code) from SO. –  Jun 05 '12 at 13:20
  • INAL, but AFAIK only **automatic** code translation is covered by copyright. – vartec Oct 08 '12 at 09:36
  • 1
    @vartec Any proofs for that? – Anton Gogolev Oct 08 '12 at 09:46
  • Could you take a look at this question https://softwareengineering.stackexchange.com/questions/381329/who-is-the-copyright-holder-when-glp2-project-api-is-used ? – Pavel_K Nov 11 '18 at 16:47

3 Answers3

18

The text of the license specifically covers translations, so no, you wouldn't be able to relicense it.

The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language.

Mason Wheeler
  • 82,151
  • 24
  • 234
  • 309
  • 3
    IANAL but I would guess "Translated into another language" in this context isn't referring to a different programming language. Copyright law only protects the _exact expression_ of an idea--not the idea itself. – Onorio Catenacci Jun 04 '12 at 17:01
  • 3
    @Onorio: GPL isn't a copyright, it's a license. – Mason Wheeler Jun 04 '12 at 17:08
  • 5
    @OnorioCatenacci this is one of those cases where "language" becomes a bit sticky. The key phrase is "derivative work", which the OP has most certainly created. GPL expressly allows for the creation of derivative work (aka, it's "Free ..."), but the original licensing restrictions still apply to the derivative. GPL allows for some re-licensing (shameless plug, see my answer). This is more a question about licensing as opposed to copyright. –  Jun 04 '12 at 17:48
  • @MasonWheeler "means either the Program or any derivative work under copyright law"--again, not a lawyer but that does seem to say that copyright would be involved somehow. – Onorio Catenacci Jun 04 '12 at 19:33
  • 3
    @MasonWheeler "GPL isn't a copyright, it's a license." Would you care to explain that? All a license can do is grant you certain rights to a copyrighted work. If (big if) the copyright in the new work can not be claimed by the original works copyright holders then the license doesn't apply. – Jaydee Jun 05 '12 at 13:02
  • @Jaydee: The Berne convention specifies that "Translations, adaptations, ... and other alterations ... shall be protected as original works without prejudice to the copyright in the original work.". It's the _without prejudice_ which allows the original copyright holders to claim joint copyright on derivate works. – MSalters Feb 05 '13 at 13:59
  • 1
    I downvoted this because this is not the reason it's illegal. The license can say whatever it wants, but that doesn't make it true. In particular, note that the license *grants* you permission to translate the program into another language, but that does not imply that you don't have permission outside of the license. – user253751 Oct 27 '20 at 19:02
  • 1
    (one can imagine a license whose definition of "the program" includes "your first-born child" but that doesn't mean you have to distribute your child under the GPL) – user253751 Oct 27 '20 at 19:02
  • 1
    @OnorioCatenacci with respect to your comment that "Translated into another language" in this context doesn't refer to a programming language. The context of the quote is the GPL itself, where they are most assuredly talking about other programming languages! – Stephen C. Steel Oct 27 '20 at 20:14
  • Is this still valid for GNU GPL v3? I cannot find it here: https://www.gnu.org/licenses/gpl-3.0.html – ilCosmico Feb 26 '21 at 11:51
0

Based upon:
http://www.gnu.org/licenses/gpl-faq.html#AllCompatibility

You should be okay with the second scenario you portrayed.

The parts you copied remain under GPLv2, but your entire library can be released as LGPL v2.1 or later. You can then link your closed source code to that library under the terms of the LGPL.

As always, do some digging and make sure you understand what the restrictions are.

  • 9
    Definitely not. Think about it: The GPL would not make any sense if it was like that. You could just take any GPL v2 code, and switch it to LGPL. That would make the GPL superfluous. Take a look at the fineprint: "LGPLv2.1 gives you permission to relicense the code under any version of the GPL (not LGPL) since GPLv2. If you can switch the LGPLed code in this case to using an appropriate version of the GPL instead (as noted in the table), you can make this combination." That only means that it's legal to switch your LGPL library to GPL, but not vice-versa. Which makes sense again. – Quandary Sep 04 '12 at 12:51
0

If you created a brand new work (and you are prepared to defend this in court) that isn’t derived from the GPL licensed work then you can do whatever you like. If you created a derivative work, then you need to license it under the GPL.

It depends on how much you copied (and a mechanical rewrite would count as copying). Nothing copied, no license requirements.

gnasher729
  • 42,090
  • 4
  • 59
  • 119