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?

Coder-256
  • 129

1 Answers1

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.

apsillers
  • 5,143
  • 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 02 '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 02 '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 02 '15 at 15:26