Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GPL license. Code reuse [closed]

Tags:

gpl

I am writing an application under GPL licence. I have found some useful code in another projects under GPL. I wonder if I can use it.

  1. I would like to take a Foo class from A project and add it into my own project. Next, I would like to make changes inside Foo class (rename class name and functions name, change code formatting, remove some function, change some algorithms, add my own functions etc).

    Does it allowed? How to mark that this class was part of A project? Like this?

All original material Copyright (C) 2009-2010 author

Original file from A: A/foo/foo.h
Copyright (C) 1997-2001 author.
 
This program is free software; 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.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
See the GNU General Public License for more details.
 
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

Or http://www.softwarefreedom.org/resources/2007/gpl-non-gpl-collaboration.html#x1-40002.2?
  1. Next, I would like to add a function from B project to my version of Foo class. How to mark that the function was from B project?

Thanks,

like image 437
gaspode Avatar asked Feb 08 '10 07:02

gaspode


People also ask

Can I use GPL in closed source?

You are free to use GPL on the server side without having to open source your code. AGPL: AGPL takes the above and applies it to the backend. So if you use any code licensed under AGPL anywhere in your application, you need to release the source code for your entire application.

Can I use GPL-licensed code in my MIT licensed project?

Yes. The MIT License is GPL compatible.

Can you modify GPL code?

Change the code: Users can change or rework the code, but if they distribute these changes/modifications in binary form, they're also required to release these updates in source code form under the GPL v3 license.

Is General Public License open source?

GPL is the acronym for GNU's General Public License, and it's one of the most popular open source licenses. Richard Stallman created the GPL to protect the GNU software from being made proprietary.


2 Answers

Obviously, you may do that. The files you are using already contain a copyright notice; you may not remove that. Instead, put another line next beneath it:

Copyright (C) 2007-2009 Original Author   // unchanged
Copyright (C) 2010 gaspode
like image 197
Erich Kitzmueller Avatar answered Sep 18 '22 15:09

Erich Kitzmueller


Clearly, you can do that. You have to publish your code under GPL of course. Put credentials for the original code in comments.

like image 44
user231967 Avatar answered Sep 20 '22 15:09

user231967