2

I would like to use some code that was released under GPLv2 in my project.

I released my project with the GPLv3 license. Can I do this, or do I have to downgrade to GPLv2?

7
  • 1
    did you check prior questions here before asking? Eg, Is there a chart for helping me decide between open-source licenses? and How can I compare and contrast open source licenses? – gnat Dec 31 '14 at 13:55
  • 2
    @gnat those answers don't talk about the differences between GPLv2 and GPLv3. I want to know it they are compatible with each other, or at least to the extent where you can use one within the other. – Coder-256 Dec 31 '14 at 13:58
  • 1
    Where is the link to that mysterious ‘some code’? – Dmitry Alexandrov Dec 31 '14 at 13:59
  • 2
    Did you contact the authors of the "some code". They might consider relicensing it under GPLv2+ and then you are ok, since you can consider it as GPLv3... – Basile Starynkevitch Dec 31 '14 at 14:02
  • 4
    From the bottom of the first page you linked: "You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version." – apsillers Dec 31 '14 at 14:20
10

In your case, the particular software you are using is licensed under "GPLv2 or any later version," which can be included in GPLv3-licensed code. If the code you wanted to use were using GPLv2 only, then it would not be legally possible to include that code in your GPLv3-licensed distribution.

We can consult the inter-GPL-compatibility table from the FSF's GPL FAQ to see the two cases:

GPLv3 code cannot include GPLv2-only code, but may include GPLv2-or-later code

The top marked space disallows a GPLv3 project from including GPLv2-only code. In that case, you must either license your code as GPLv2, or the author of the GPLv2-only code must re-license as GPLv2-or-later.

The space immediately below that, however, allows a GPLv3 project to include code that is licensed under "GPLv2 or any later version". (This is because you may treat the GPLv2-or-later code as GPLv3 code, and then there's no problem at all.)


If you have some GPLv2-only code that you want to include in your GPLv3 project, you might look at the space to the left of the circled "NO" and think, "Wait! I can license my project as GPLv2-or-later and still include the GPLv2-only code! Then, I'll freely upgrade my project to GPLv3 -- problem solved." However, that space has a footnote:

[2] While you may release your project (either your original work and/or work that you received and modified) under GPLv2-or-later in this case, note that the other code you're using must remain under GPLv2 only. As long as your project depends on that code, you won't be able to upgrade the license of your project to GPLv3-or-later, and the work as a whole (any combination of both your project and the other code) can only be conveyed under the terms of GPLv2.

Thus, a project that includes GPLv2-only code may be licensed under GPLv2-or-later, but it can't actually upgrade as a whole to GPLv3, because it's held back by the GPLv2-only code. However, any parts of your GPLv2-or-later project that are not GPLv2-only may be freely upgraded when separated from the GPLv2-only code.

4
  • From the comments on the question it can be seen that the code being copies is already under "GPLv2 or later". – Bart van Ingen Schenau Dec 31 '14 at 14:43
  • I want to add the "GPLv2 or later" code to my project (I am not currently using it). Does that mean I need to downgrade to GPLv2? From the footnote, "As long as your project depends on that code, you won't be able to upgrade the license of your project to GPLv3-or-later, and the work as a whole (any combination of both your project and the other code) can only be conveyed under the terms of GPLv2." Does this still apply to my project? – Coder-256 Jan 2 '15 at 15:19
  • @Coder256 You may choose to receive the GPLv2-or-later code as GPLv3 code, so the GPLv2-or-later code is GPLv3 code, if you want it to be. You cannot treat the GPLv2-or-later code as GPLv2 and combine it with GPLv3 code, but you can treat it as GPLv3 code and combine it with other GPLv3 code. The footnote pertains only to GPLv2-only code, which we're not actually dealing with (since we found out your desired library is GPLv2-or-later). The footnote says GPLv2-only code cannot freely upgrade to GPLv3; therefore a "GPLv2-or-later" work that includes GPLv2-only code cannot upgrade to GPLv3. – apsillers Jan 2 '15 at 15:21
  • @Coder256 But to stress the point again: you don't have any GPLv2-only code in sight. I included this information only for completeness (and for any future readers who may be dealing with GPLv2-only code). – apsillers Jan 2 '15 at 15:26

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.