3

Let's say I import some header files (or Python modules) which are under GPLv3 into a source file that I would like to publish as Open Source (OS), and also signify that I have copyright on that specific file.

  1. Can I actually possess copyright on a file within which I import GPL'd code?

  2. If yes, do I also need to re-add the origin GPL header from the original code which I import? I'd guess it is already covered since the original code should have it in it, already.

  3. Is there a difference when I link object code against my source file regarding the former two questions?

  4. Does this actually count as "modifying the work", so I need to give appropriate notice that I modified the original work? In other words: Is there a difference between taking an original GPL'd source file directly and modifying it, in contrast to importing this file and writing my own code, but with the use of classes and methods from the imported file?

2
  • 2
    When you say import do you mean the use of the python import statement, or do you mean it in some other way?
    – MadHatter
    Commented Apr 23, 2023 at 14:54
  • 1
    In fact, both "include" (C++) and "import" (Python) and possibly also "import" (Java) would be of interest.
    – cwellm
    Commented Apr 25, 2023 at 15:50

1 Answer 1

1
  1. Can I actually possess copyright on a file within which I import GPL'd code?

Yes. The GPL does not deny you to own the copyrights on what you create, but the GPL does put limitations on under which terms you can distribute derived works.

The GPL license works on the basis of copyright law. Under copyright law, if you are not the author of the code, you have very limited rights. For example, you are not allowed to make copies, changes or to build upon the code of others. And that includes importing the module into your own code.

The author of the code can give others permission to do some or all of those things by means of a copyright license. Such a license can have all kinds of strings attached to it, like that you have to pay money or that you have to distribute your code under the same license.

The GPL license has as effective requirement that if you use a module that is under the GPL license in your application, then you must distribute your application also under the GPL license.

  1. If yes, do I also need to re-add the origin GPL header from the original code which I import? I'd guess it is already covered since the original code should have it in it, already.

You don´t need to add the copyright statement from the imported module to your code, but you do need to put a GPL license header in your files to indicate they are licensed under the GPL.

  1. Is there a difference when I link object code against my source file regarding the former two questions?

No.

  1. Does this actually count as "modifying the work", so I need to give appropriate notice that I modified the original work? In other words: Is there a difference between taking an original GPL'd source file directly and modifying it, in contrast to importing this file and writing my own code, but with the use of classes and methods from the imported file?

No, you are not modifying the module you import, but you are creating a derived work.

From a GPL viewpoint, there is no practical difference between copying a file into your project and modifying it and importing a file and writing your own code to use the imported routines.

From a code maintenance perspective, there is a big difference and importing is highly preferred.

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.