logoalt Hacker News

dzhiurgisyesterday at 9:06 PM6 repliesview on HN

What happens when you want to mix two libraries with different licences?


Replies

koolbayesterday at 9:09 PM

If you own one of them, mix in LGPL code, and publish it, the result is entirely LGPL.

If you don’t own it and cannot legally relicense part as LGPL, you’re not allowed to publish it.

Just because you can merge someone else’s code does not mean you’re legally allowed to do so.

kelnosyesterday at 9:17 PM

You determine if the licenses are compatible first. If they are, you're fine, as long as you fulfill the terms of both licenses.

If they aren't compatible, then you can't use them together, so you have to find something else, or build the functionality yourself.

Hendriktoyesterday at 9:11 PM

Some licenses, like LGPL, have provisions for this, some just forbid it.

In the specific ffmpeg case, you are allowed to dynamically link against it from a project with an incompatible license.

wmfyesterday at 10:06 PM

You should keep them in different directories and have the appropriate license for each directory. You can have a top-level LICENSE file explaining the situation.

LeFantomeyesterday at 11:56 PM

This depends on the licenses.

Copyleft licenses are designed to prevent you mixing code as the licenses are generally incompatible with mixing.

More permissive license will generally allow you to mix licenses. This is why you can ship permissive code in a proprietary code base.

As for linking, “weak copyleft” license allow you to link but not to “mix” code. This is essentially the point of the LGPL.

patmorgan23yesterday at 10:48 PM

You dynamicly link against it