Hey fellow Linux enthusiasts.

I’m inching closer to releasing my program for Linux. I’ll go into details on what the program is when I release it, as it’s not really relevant to this question (IMHO).

Anyway, here are my prerequisites:

  • the program will be free. I will accept donations, but the program will be free to download and use.
  • open source.
  • I’m happy for others to use my code, as long as I’m credited.
  • I do not wish to allow others to use my code in commercial applications (as there will be mobile versions later, and I don’t want clones selling it for money, as the mobile versions will also be free.

I’m looking for advice on the best code license to choose, based on my requirements. I’d also like it if my choice of license didn’t prohibit my program from potentially being included in package managers.

I’m grateful for any advice. Thank you.

Edit

Thanks for the replies everyone. I’ve decided to not let my concerns overcome the most important thing of releasing the project as fully open source.

Just going to go with GPLv3 and not worry about the clones that will happen regardless of the license type, if the program becomes popular.

Thank you all for your insight and for helping me come to what I believe to be the best option.

  • stifle867@programming.dev
    link
    fedilink
    arrow-up
    29
    arrow-down
    2
    ·
    1 year ago

    There are no open source licenses that do not allow for commercial applications. It goes against the very core of what it means to be open source.

    However, what you’re probably looking for is a license that prevents people from taking your code and making a commercial application without giving back. What this means is that any copy of your source code must also be open source. This is what a copyleft license does and you could look at something like the GPLv3 or the less restrictive MPLv2.

          • PixxlMan@lemmy.world
            link
            fedilink
            arrow-up
            2
            arrow-down
            1
            ·
            1 year ago

            They replied as if to show that the comment claiming OSS can’t be non commercial was wrong by giving CC-NC as an example

          • guillem@aussie.zone
            link
            fedilink
            arrow-up
            1
            arrow-down
            1
            ·
            edit-2
            1 year ago

            The BY is implicit, read my comment as CC-NC-* if you wish, the fact doesn’t change.

      • MHLoppy2@aussie.zone
        link
        fedilink
        arrow-up
        11
        arrow-down
        2
        ·
        edit-2
        1 year ago

        In addition to not qualifying by most definitions of open source (as already mentioned), CC is not recommended for use in software: https://creativecommons.org/faq/#can-i-apply-a-creative-commons-license-to-software

        We recommend against using Creative Commons licenses for software. Instead, we strongly encourage you to use one of the very good software licenses which are already available.

        […]

        Unlike software-specific licenses, CC licenses do not contain specific terms about the distribution of source code, which is often important to ensuring the free reuse and modifiability of software. Many software licenses also address patent rights, which are important to software but may not be applicable to other copyrightable works. Additionally, our licenses are currently not compatible with the major software licenses, so it would be difficult to integrate CC-licensed work with other free software. Existing software licenses were designed specifically for use with software and offer a similar set of rights to the Creative Commons licenses.


        Edited link for kbin/mbin users: https://creativecommons.org/faq (scroll to Can I apply a Creative Commons license to software?)

  • pavunkissa@sopuli.xyz
    link
    fedilink
    English
    arrow-up
    18
    ·
    1 year ago

    As others have already said, the prohibition of using the code in commercial applications would make the license not open source/free software (as defined by the Free Software Foundation and Open Source Initiative.)

    These are some of the most commonly used licenses:

    • MIT - a very permissive license. Roughly says “do anything with this as long as you give attribution”
    • BSD - similar to MIT (note that there are multiple versions of the BSD license)
    • ASL2 - another permissive license. Major difference is that it also includes a patent grant clause. (Mini rant: I often hear that GPL3’s patent clause is the reason big companies don’t like it. Yet, ASL2 has the very same clause and it’s Google’s favored license.)
    • GPL - the most popular copyleft license (family). Requires derived works to be licensed under the same terms.
    • LGPL - a variant of the GPL that permits dynamic linking to differently licensed works. Mainly useful for libraries.
    • AGPL - a variant of GPL that specifies that making the software available over a network counts as distribution. (Works around the SaaS loophole. Mainly used for server applications.)
    • Mozilla - a hybrid permissive/copyleft license. I don’t fully understand how this one works.

    If you want to use a true FLOSS license and your goal is to discourage people from selling it, I’d say the GPL is your best bet. Legit vendors who don’t want to give out their source code won’t touch GPL code. The non-legit ones won’t care no matter what license you choose. Also, iOS App Store terms are not compatible with the GPL so they can’t release their stuff there, but you can as long as you hold full copyright to your application.

      • stifle867@programming.dev
        link
        fedilink
        arrow-up
        5
        arrow-down
        2
        ·
        1 year ago

        Please don’t do this. It’s immoral to ride off the free work of others, then turn around and rug pull them. Either stick with open source and take the good and the bad, or go proprietary. Don’t do this fake open source that harms the community. If you have a permissive license there’s nothing stopping you from selling other’s work and a CLA is not needed. If you have a copyleft license then a CLA defeats the entire purpose of that.

      • pavunkissa@sopuli.xyz
        link
        fedilink
        arrow-up
        3
        ·
        1 year ago

        That is a good point to emphasize. A downside of a CLA is that it adds a bit of bureaucracy and may deter some contributors. If the primary concern is whether a GPL licensed app is publishable on an App Store, an alternative is to add an app store exception clause to the license. (The GPL allows optional extra clauses to make the license more permissive.) Though this means that while your code can be incorporated to other GPL licensed applications, you can’t take code from other GPL projects that don’t have the same exception.

  • skami@sh.itjust.works
    link
    fedilink
    arrow-up
    13
    ·
    1 year ago

    Open source Not […] allow […] commercial applications

    For some definitions of open source, this is contradictory (FOSS). Some non FOSS licenses do limit commercial use while making the source available, this could be a possibility for you.

    But, I’d instead recommend that you check if a copyleft license such as the GPL provide enough protections for your use case.

    • Zion@lemmy.worldOP
      link
      fedilink
      arrow-up
      4
      ·
      edit-2
      1 year ago

      Thanks. To be honest, I couldn’t care less if people use parts of my code in commercial programs.

      The only thing I’m trying to prevent is someone taking the entire project, changing some strings and icons and releasing a paid Android version based on my work. Especially as I will be releasing mobile versions myself after the desktop versions for free.

      • Spectacle8011@lemmy.comfysnug.space
        link
        fedilink
        arrow-up
        4
        ·
        1 year ago

        Zion isn’t going to see my comment because I’m from an instance that lemmy.world blocks. If somebody thinks my comment might be useful to Zion, please pass it on in my stead by reposting it.

        The only thing I’m trying to prevent is someone taking the entire project, changing some strings and icons and releasing a paid Android version based on my work.

        If you released your program under an open source license, they wouldn’t even need to change anything. They could simply republish your program unmodified for a price. Open source is fundamentally incompatible with restricting commercial use because it means surrendering your monopoly over commercial exploitation.

        One way you could restrict this is by trademarking the name you publish your program under. This way, no one will be able to publish a version of your program with the same name, as they would be violating your trademark. The good thing about this is that trademarks have nothing to do with copyright and so are fully compatible with open source licenses. The bad news is that someone could always republish your program under a different name. If you’re primarily concerned about users confusing another program with yours, though, trademarks are a great option. You should register a trademark for the name anyway…before someone else does.

        I don’t have a particular license to recommend that prevents commercial redistribution, but you appear to be looking for a “source-available” license. You might need something custom…every program I’ve heard of that is source-available has their own custom license (Futo Temporary License, the TrueCrypt license, Microsoft Shared Source Initiative, etc.) The closest thing I could find was the Commons Clause. I know very little about it, though.

      • lemmyvore@feddit.nl
        link
        fedilink
        English
        arrow-up
        4
        ·
        1 year ago

        You shouldn’t worry about that. It’s going to happen anyway. Probably 5 minutes after you publish the source code. Open means open.

        The most lazy example I saw of this recently is where they took advantage that InnerTune was not on Play Store and published a verbatim copy with the same app id and everything, just the name changed to Max Music Player. It’s free too so it wouldn’t break a no commercial license.

        So if it’s a mobile application you need to come to terms with this now, before you publish.

      • LeFrog@discuss.tchncs.de
        link
        fedilink
        arrow-up
        5
        arrow-down
        1
        ·
        edit-2
        1 year ago

        Hi, the user https://lemmy.comfysnug.space/u/Spectacle8011 posted an answer that you probably will not see:

        Original text by spectacle8011:

        Zion isn’t going to see my comment because I’m from an instance that lemmy.world blocks. If somebody thinks my comment might be useful to Zion, please pass it on in my stead by reposting it.

        The only thing I’m trying to prevent is someone taking the entire project, changing some strings and icons and releasing a paid Android version based on my work.

        If you released your program under an open source license, they wouldn’t even need to change anything. They could simply republish your program unmodified for a price. Open source is fundamentally incompatible with restricting commercial use because it means surrendering your monopoly over commercial exploitation.

        One way you could restrict this is by trademarking the name you publish your program under. This way, no one will be able to publish a version of your program with the same name, as they would be violating your trademark. The good thing about this is that trademarks have nothing to do with copyright and so are fully compatible with open source licenses. The bad news is that someone could always republish your program under a different name. If you’re primarily concerned about users confusing another program with yours, though, trademarks are a great option. You should register a trademark for the name anyway…before someone else does.

        I don’t have a particular license to recommend that prevents commercial redistribution, but you appear to be looking for a “source-available” license. You might need something custom…every program I’ve heard of that is source-available has their own custom license (Futo Temporary License, the TrueCrypt license, Microsoft Shared Source Initiative, etc.) The closest thing I could find was the Commons Clause. I know very little about it, though.

  • Zion@lemmy.worldOP
    link
    fedilink
    arrow-up
    12
    ·
    edit-2
    1 year ago

    Thanks for the replies everyone. I’ve decided to not let my concerns overcome the most important thing of releasing the project as fully open source.

    Just going to go with GPLv3 and not worry about the clones that will happen regardless of the license type, if the program becomes popular.

    Thank you all for your insight and for helping me come to what I believe to be the best decision.

    • Adanisi@lemmy.zip
      link
      fedilink
      English
      arrow-up
      5
      ·
      edit-2
      1 year ago

      That doesn’t permit restricting commercial stuff

      AGPL and GPL are good choices though

  • pmk@lemmy.sdf.org
    link
    fedilink
    arrow-up
    4
    ·
    edit-2
    1 year ago

    Of the points, not allowing others to make money from a fork could be difficult. You can ensure that a fork stays free, but iirc it’s hard to stop anyone making money. Although I’m hesitant to suggest this, you might want to look at the license for Gnuplot (it’s not gnu as in GNU), which is imho the least free license commonly called “free software”, it effectively prevents forked projects. In which case another question might be, do you want it to be free software? Is the gratis aspect more important?

  • NaN@lemmy.sdf.org
    link
    fedilink
    English
    arrow-up
    4
    ·
    edit-2
    1 year ago

    What you’re describing is closer to a source-available license like the Commons Clause.

    Many distros would not include it due to the restrictions, some have non-free repositories and might.

    Something like the GPL would allow someone to sell it.

    • Zion@lemmy.worldOP
      link
      fedilink
      arrow-up
      4
      ·
      edit-2
      1 year ago

      I replied to a similar question below. Here it is:

      Thanks. To be honest, I couldn’t care less if people use parts of my code in commercial programs.

      The only thing I’m trying to prevent is someone taking the entire project, changing some strings and icons and releasing a paid Android version based on my work. Especially as I will be releasing mobile versions myself after the desktop versions for free.

      • 𝘋𝘪𝘳𝘬@lemmy.ml
        link
        fedilink
        arrow-up
        4
        ·
        1 year ago

        The only thing I’m trying to prevent is someone taking the entire project, changing some strings and icons and releasing a paid Android version based on my work.

        Yeah, but why. If you “don’t care about commercial use”, why you care about commercial use?

        Oh, and to stay on topic: Use GPLv3. It does prevent that. If you actually do not care, use the MIT license.