I want to use LGPL for my project, can I use some source code which is apache licensed ?
If I only use the apache licensed component as library in my project, how should I make the clarification in my project ? Do I need to put some information about apache license at the beginning of source code which uses the library?
As the Apache license is deemed compatible with the (L)GPL v3, you can use Apache licensed code in your LGPL project.
If you use the Apache licensed code only in the form of a library, the conventional way is
- keep the Apache licensed library in a separate directory/sub-tree of the project
- mention in your documentation (readme) that you use such-and-such library and under which license it is being distributed.
In your source code, you don’t need to mention that a function/class comes from a separate library. The fact that it has a different license should be obvious from the copyright statements in the respective source files.
4
GPLv3 and LGPLv3 licenses are be compatible with the Apache v2 license, meaning you can incorporate Apache v2-licensed code into an LGPLv3 library. (Note that the reverse is not true, see https://www.apache.org/licenses/GPL-compatibility.html).
As for the way in which you used the Apache v2 licensed code, the Apache v2 does not apply too many restrictions. If you were to copy a handful of functions (or even lines from a function) into your LGPLv3-licensed code, you’d need to do the following:
- Ensure the applicable copyright, patent, trademark, and attribution notices are reproduced in your source (e.g. placed prominently in a comment block near the top of your header file).
- Note which code that license applies to. If you’ve copied functions, you could e.g. place a notice that identifies the functions by name. If you copied a block of code from within a function, you might delimit it with comments.
- Include a copy of the Apache License v2 in your code. Typically, I put these in a “Third-party licenses” folder in my documentation folder.
- If the code comes with a NOTICE file, reproduce this in its entirety.
Note that the other requirements of the Apache License are adequately covered by the LGPLv3 license itself.