Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

License Templates #749

Closed
wants to merge 18 commits into from
Closed

License Templates #749

wants to merge 18 commits into from

Conversation

DevynCJohnson
Copy link
Contributor

[ci skip]

  • Added AGPLv2 (GNU Affero General Public License v2)
  • Added AGPLv3 (GNU Affero General Public License v3)
  • Renamed ./data/templates/gpl to ./data/templates/gpl2
    • This makes it clear that the license is version 2
  • Added GPLv3 (GNU General Public License v3)
    • Many developers prefer GPLv3 over GPLv2
  • Added LGPLv2 license (GNU Lesser General Public License v2)
  • Added LGPLv3 license (GNU Lesser General Public License v3)
    • The LGPL licenses are commonly used in libraries and other code
  • Added BSD 2-Clause License
  • Renamed ./data/templates/bsd to ./data/templates/bsd-3-clause (BSD 3-Clause License)
    • This makes it clear that the license is 3-Clause
  • Updated ./data/templates/bsd-3-clause (BSD 3-Clause License)
    • Ensured that this license matches the official BSD 3-Clause License
  • Variety is the spice of life; Some other commonly used licenses should be added
    • Added Apache License v2.0
    • Added cc0 (CC0 1.0 Universal (CC0 1.0))
    • Added the MIT License (MIT)
    • Added MPLv2 (Mozilla Public License v2.0)
    • Added zib/libpng License
    • I plan to add more licenses in the future (perhaps WTFPL)

The functions "editor_insert_snippet" and "editor_find_snippet" in ./src/editor.c dynamically find and add license templates to the "Edit > Insert Comments" sub-menu during compilation.

Added LGPLv3 license
Rename gpl to gpl2 to explicitly indicate the license version
Added LGPLv2 license (GNU Lesser General Public License Version 2)
Added cc0 (CC0 1.0 Universal (CC0 1.0))
Added MPLv2 (Mozilla Public License v2.0)
Added AGPLv3 (GNU Affero General Public License v3)
Added AGPLv2 (GNU Affero General Public License v2)
Added GPLv3 (GNU General Public License v3)
Added BSD 2-Clause License
Renamed ./data/templates/bsd to ./data/templates/bsd-3-clause (BSD 3-Clause License)
Updated ./data/templates/bsd-3-clause (BSD 3-Clause License)
Fixed formatting
Added the zib/libpng License
Added Apache License v2.0
Added the MIT License (MIT)
@elextr
Copy link
Member

elextr commented Nov 10, 2015

Nice try to sneak #305 in again, but ... :)

  1. these break the build
  2. templates are for creating a file, that is they are language specific and the license text is in a comment, so creating a file from just the license text isn't the way to go either.

@DevynCJohnson
Copy link
Contributor Author

@elextr , you remembered me (^u^).

Why do these break the build? Why is it that the "gpl" and "bsd" license in the mainstream Geany release not break the build? What code could I (or someone else) add or fix to make this work?

These additional templates (like the "gpl" and "bsd" licenses) can be inserted in a block-comment of the code the developer has open. For instance, in C, I could uses C's multi-line comments and then insert a license template between the opening and closing comment-syntax. Thus, these license templates are "universal", just like the "gpl" and "bsd" licenses in the "Edit > Insert Comments" sub-menu.

@DevynCJohnson
Copy link
Contributor Author

I explained this license feature in more detail on the ML. However, I would love to help fix this "broken build" issue.

@codebrainz
Copy link
Member

Why do these break the build?

@DevynCJohnson at the bottom of pull requests it shows whether it would break the build system on the build server. There's a "Details" link that shows the results. In this case, the relevant error is around here:

https://travis-ci.org/geany/geany/jobs/90350084#L1041

Probably the new files weren't added to the relevant Makefile.am file properly.

@codebrainz
Copy link
Member

For maximum likelihood of getting this PR merged quickly, your best bet is to reproduce the kind of changes in this Gist for the current Geany master branch and with your additional licenses. (Note: I manually edited the Gist patch, compared to the version I linked on the mailing list, to remove all the noise in the GUI XML builder file).

Of course it would be better to make the licenses more easily user-extensible, but unless you want to re-do the related code in Geany, just hard-coding more licenses would probably be accepted.

@codebrainz
Copy link
Member

Regarding:

Why is it that the "gpl" and "bsd" license in the mainstream Geany release not break the build?

I think it's because you renamed the files but did not update the build system to reflect the new names.

@elextr
Copy link
Member

elextr commented Nov 11, 2015

@DevynCJohnson the big red message below "all checks have failed" is a giveaway :)

As @codebrainz said, just adding the template to the directory won't do anything, the associated menu items need to be created.

The template area of Geany has grown rather than being designed, so maybe its confusing. Let me summarise.

There are two sorts of templates, those that paste into comments using Menu->Edit->Insert Comments and those that are a template for creating new files (usually called file templates).

The comment templates include a couple of licenses and are "hard coded" because they need menu entries to be added inside Menu->Edit->Insert Comments to copy and manipulate the appropriate template file in data/templates. Just adding files to data/templates will not do anything unless the menu items are added. The user can customise the template file in their config, but cannot add new ones. This is not very extendible, and as @codebrainz said would be better if it picked up files and added them to the menu automagically like file templates below (pull requests are welcome).

The file templates are used to create new files and show in the Menu->File->New (with template) list, and in this case the elements in the list are the files in data/templates/files. Adding new files will automatically show up in the list (Geany restart may be needed). The user can customise the template file in their user config and can add new ones. The filetype and extension of the newly created file is taken from the extension of the template file.

So it doesn't make adding new licenses easy the way it works at the moment. Which is why the list is so limited. The best solution is to make the Insert Comment list extensible and allow those to be included in the file templates, just needs "somebody" to do it.

@DevynCJohnson
Copy link
Contributor Author

@codebrainz , thanks! I was not aware that I had to add license templates to Makefile.am. I will try that.

I added the code needed for the license templates that I proposed.
Added the code needed for the proposed license templates.
Added the code needed for the proposed license templates.
Added the proposed licenses to "templates=".
@DevynCJohnson
Copy link
Contributor Author

I will make a new pull-request that has the new modifications.

@codebrainz
Copy link
Member

New PR #752

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants