0

I'm putting together a "library of libraries" for the C++ programming language. Each library is a collection of one or more text files of source code, plus a text file containing the license.

Rather than require the users of my "library of libraries" to download and import each individual library into their project, I'd prefer to put all the different libraries together into single massive text file.

This is not a modification of the source code, since the license covers the code, not the text file itself (and in most cases modification is allowed, but I'd like to avoid it altogether just in case.) I'm thinking I can just insert the licenses directly into the source code as a comment (a 'comment' is a section ignored by the programming language where you can write anything.)

So what would start as:

Library 1
 - file1A.cpp  "1A code"
 - file1B.cpp  "1B code"
 - license1.txt  "1 license"
Library 2
 - file2A.cpp  "2A code"
 - file2B.cpp  "2B code"
 - license2.txt  "2 license"

Becomes

- library.cpp
   /* Notice: the following is subject to license1 */
   1A code
   1B code
   /* Notice: the following is subject to license2 */
   2A code
   2B code

All I've done is changed the delivery format, so this should be acceptable. Can you see any reason why it would not be?

1
  • 1
    Legal aspects apart, this schema is of dubious utility. You will have to handle library updates, and keeping track of it can be a major headache if the number of libraries is big. Why I would want to be forced to upgrade your mega library because of, say, security vulnerabilities caused by a library that Ib do not even actually use. Or deal with incompatible dependencies of something I do not use?
    – SJuan76
    Commented Apr 23, 2021 at 16:59

1 Answer 1

2

Very likely not, but it would depend on each license.

For example, GPL has requirements for the license of a complete work, if you received one part based on the GPL license. If the other licenses are not compatible with the GPL license, then you can't publish with the different licenses. Say A is licensed under GPL, B is licensed under the B-license, GPL requires that A+B is licensed under GPL, the B-license requires that B is licensed under the B-license, and you cannot publish B both under GPL and under the B-license because the terms are contradicting, then you can't legally publish A+B.

As an extreme, assume the B-license explicitely says "B cannot be published under the GPL license, and cannot be combined with another part that is published under the GPL license". Then obviously you can't do what you are planning.

However, you may get away with it if you don't actually create anything new based on the existing projects. A CD containing three separate individual open source licensed projects is most likely not a "derived work", just a container with three individual works. A zip file probably the same. A giant text file containing all the sources is arguably a derived work.

2
  • Right, then the answer would be: it wouldn't be okay if one of the licenses specifically extends itself onto anything it is bundled with, as GPL does. Assuming none of the licenses extend themselves outside of their original bounds, it should be fine?
    – Alasdair
    Commented Apr 23, 2021 at 10:27
  • Yes, if each license allows you to create a work combined of Library 1 and Library 2, then you're fine. You have to check the exact terms of each license to make sure.
    – gnasher729
    Commented Apr 24, 2021 at 11:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .