I’m starting to work on a C library, and I am having trouble choosing a license, so I need some help.

Keeping in mind that:

  • I want as many people as possible to be able to use my lib, without them worrying about license compatibility, both for libre and proprietary programs;
  • My lib is designed to be statically linked, so its license must allow static linking without compromises;

But, also:

  • I want for whoever uses my lib to credit me: I think mentioning my library’s name, optionally with an URL to my repo and the license text copypasted, in the final software’s documentation / credit page / whatever would be enough;
  • I want for people that make changes to my library, and then use the modified version in their program, be it free or proprietary, to publish the modified source code of my library, under my license (but they can keep the rest of their program under whatever license they want).

What license should I choose? I really have no idea.
I think that if I only cared about the first 3 points, I could choose MIT, but considering the last one?

RoboHack
link
fedilink
23 giorni

Personally I think a BSD license (or similarly an MIT license), is best at meeting your “primary” goals. Note the traditional BSD license does require attribution.

However your last goal is somewhat contradictory with your first goals, so choosing a matching existing license to combine this last goal is difficult.

Personally I’ve decided to use the Creative Commons Attribution-ShareAlike 4.0 International License for my software (even though it is not strictly recommended for software). I attach my own specific terms, as seen here:

https://github.com/robohack/dotfiles/blob/master/copyright

@Tiuku@sopuli.xyz
link
fedilink
34 giorni

Sounds like LGLP might be it.

@octt
creator
link
fedilink
6
edit-2
4 giorni

LGPL has restrictions on static linking, actually. It’s one of the reasons why SDL 2.0 had to recently drop it in favour of the zlib license. So, not really a good choice in my case, it goes against point 2 of mine.

The zlib license, however, doesn’t respect point 3 and 4.

I heard of a LGPL with static linking exception (no additional restrictions on static linking), but it’s not vastly used, so I don’t know much about that. Maybe you do?

@Tiuku@sopuli.xyz
link
fedilink
2
edit-2
4 giorni

Ahh didn’t know about that. What restrictions are there exactly?

Maybe you do?

Sorry :/

@octt
creator
link
fedilink
84 giorni

If you use an LGPL library in a proprietary program or with incompatible open licenses:

  • If you dynamically link, you can keep your parts of the program under your license;
  • If you statically link, you have to make sure that an user can actually modify the parts of the LGPL library in your program. For proprietary programs, this means that the developers would have to distribute their unlinked .o files, which quickly becomes a mess (and, on some platforms, notably embedded ones, it becomes a real mess).
@Txopi@lemmy.ml
link
fedilink
43 giorni

Very good and accurate explanation! More info at GNU’s FAQ.

Adda
link
fedilink
43 giorni

Today I learned. Interesting. I did not know about this at all. Never mind, then.

Adda
link
fedilink
3
edit-2
3 giorni

This is the first licence that came to my mind as well. I think it should be what we are looking for here. Not ideal for static linking, though (see other replies to this comment).

@Txopi@lemmy.ml
link
fedilink
03 giorni

LGPL is the license that fits more to your requirements but as some responses already pointed out, only dynamic linking would be allowed, not static linking too as you want. Perhaps you could create a new (non free) license based on LGPL license, but I don’t recommend you to do that.

In your case, you can weight up the dual licensing. If you publish the code under LGPLv3 license AND copyright license, like MySQL does, people will understand that it’s a free software project; they can choose the LGPL version for dynamic linking and the other version when they need to link statically.

To avoid further problems and keep a unique software project, you would ask software contributors (if any) to assign the copyright of the modification to you, so you can keep both version of the software (the LGPLed and the copyrighted one) always exactly the same.

For a big project this is risky, because someone could say no and create a fork of the LGPLed version of your project with his/her modifications, but if it’s a little project and you explain that the copyrighted version is just to allow static linking for those developers they need it, I don’t think you will have problems.

NOTE: in the copyright license you will need to explain that the software can’t be modified (at least that exact version), that can be used, copied and distributed freely without previous permission, that dynamic and static linking is explicitly allowed, that you require authorship recognition this way, and that for all the usages not requiring static linking you recommend the LGPL licensed version of the library. This is just a proposal.

@nachtigall@feddit.de
link
fedilink
0
edit-2
4 giorni

deleted by creator

All about open source! Feel free to ask questions, and share news, and interesting stuff!

Useful Links

Rules

  • Posts must be relevant to the open source ideology
  • No NSFW content
  • No hate speech, bigotry, etc

Related Communities

Community icon from opensource.org, but we are not affiliated with them.

  • 0 users online
  • 3 users / day
  • 31 users / week
  • 109 users / month
  • 252 users / 6 months
  • 10 subscribers
  • 181 Posts
  • 660 Comments
  • Modlog