If a C program links to a gpl library, then the C source code is not required to be gpl. If you compile that C source and link it with the gpl library, then the resulting executable is a combined work under copyright law, since the executable contains both the gpl library and a transformed version of the C source. It is this executable, the "combined work", that is subject to both licences: the gpl licence of the library, and the copyright licence of the C source code (maybe it is Apache 2).<div><span style="font-size:15px"><br></span></div><div><span style="font-size:15px">The gpl requires that if you distribute this executable to someone else, then all of the source code used to create the executable must be made available to the recipient, even if some of those source files are not GPLed. BUT, the GPL does not change or void the licence of those other source files. AND, the GPL does not generally prohibit you from mixing GPL and non-GPL source files in a combined work.</span></div><div><span style="font-size:15px"><br></span></div><div><span style="font-size:15px">THEREFORE, you don't have to change your licence.<br></span><br>On Thursday, 12 April 2018, Paul Nijjar <<a href="mailto:paul_nijjar@yahoo.ca">paul_nijjar@yahoo.ca</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Licenses are so weird.<br>
<br>
In the C/C++ context, I thought that linking to a GPLed library means<br>
your code has to be GPL as well. That is (I thought) why the LGPL<br>
exists -- so that a program that is not GPLed can link to a library<br>
that is without having to be GPL itself.<br>
<br>
When I use a GPLed module in Python it is different?<br>
<br>
I agree that I am not distributing the source of the library. The<br>
requirements.txt file specifies the dependency so that my end user can<br>
pull in the requirements. But I am struggling to understand why<br>
<br>
from pyshorteners import Shortener<br>
<br>
is not analogous to linking to a C library. Like, if I wrote a program<br>
that has<br>
<br>
#include <pyshorteners.h><br>
<br>
in my C code but do not distribute the code for pyshorteners.c and<br>
expect end users to download it and compile the program themselves,<br>
then my C program would not need to be GPL even if pyshorteners.c was?<br>
<br>
It is not even clear to me why I couldn't distribute the source to<br>
pyshorteners.c along with my source. Isn't that how distributions<br>
ship collections of both GPL and non-GPL code?<br>
<br>
- Paul<br>
<br>
<br>
On Thu, Apr 12, 2018 at 03:50:24PM -0400, doug moen wrote:<br>
> You don't have to change the copyright licence on your files if they<br>
> reference other files that are GPL3. You own the copyright on your own<br>
> files, you can attach any licence you want, and the GPL doesn't have the<br>
> legal power to force you to do otherwise. So keep the Apache 2 licence in<br>
> place. But you should note the dependency on a GPL'ed library somewhere,<br>
> perhaps in the README file.<br>
><br>
> The GPL on pyshorteners only affects you if you distribute a combined work<br>
> that incorporates both GPL'ed files and your files in a single work; then<br>
> the entire combined work must be distributed on the terms of the GPL, even<br>
> though individual files within that combined work may be distributed<br>
> separately using the Apache 2 licence.<br>
><br>
> If somebody later wants to change your code to remove the pyshorteners<br>
> dependency, they can do so, and then they will only be subject to Apache 2.<br>
><br>
</blockquote></div>