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@lemmy.ca
    link
    fedilink
    arrow-up
    3
    arrow-down
    1
    ·
    2 years ago

    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

    • octtOP
      link
      fedilink
      arrow-up
      2
      ·
      edit-2
      2 years ago

      Actually CC BY-SA was the first license that came to my mind for accomplishing this goal, but yeah, not ideal at all for code. Code projects that use this are actually considered non-free.

      But still, thanks!

      For some of my simple scripts, config files, and HTML+CSS templates, I actually do use CC BY-SA already though (mostly for convenience, for example I have my whole website licensed under CC BY-SA, including my CI scripts (maybe 30 lines total, the bulk of my code is in a static site generator I released as AGPL3) and HTML+CSS code, because text and media are like 90% of the entire thing)

        • octtOP
          link
          fedilink
          arrow-up
          2
          ·
          edit-2
          2 years ago

          Because it explicitely doesn’t grant patent rights.

          Just a few weeks ago, Fedora tackled this issue by announcing the stop on accepting CC0 (license that is actually really popular for software, in comparison to CC BY-SA) software: https://www.theregister.com/2022/07/25/fedora_sours_on_creative_commons/

          All Creative Commons licenses have this issue, not only CC0, including CC BY-SA.

          • RoboHack@lemmy.ca
            link
            fedilink
            arrow-up
            1
            ·
            2 years ago

            Patent rights don’t apply to me as much – I live in Canada, and though it’s a bit more complicated than I let on here, we effectively don’t have software patents.