Recommended/required license for generated code
Open, Needs TriagePublic

Description

KDE's Licensing policy (https://community.kde.org/Policies/Licensing_Policy) currently does not specify what license to use for generated code, like that generated from kapptemplate templates or other code generators like kconfigcompiler. So not the template itself or the generation code, but the output generated by them/with them.

I guess that should be some license which does not require any mentioning of the origin/author, and gives the person copying the code all rights, as if they wrote this from scratch themselves. So something like Public Domain, or whatever is a working license with the same effect.

Some kapptenplates have license statements for the generated code, but that usually is more a recommendation and more, the respective user only is noted as copyright holder already next to it, so effectively the output had been kind of passed through a "public domain" state and from there turned into ownership of the user. IANAL, so this seems in need of care.

kossebau created this task.Jun 28 2020, 2:56 PM

Generated code isn't copyrighted as it isn't written by a person as a creative expression. So there's no licence needed for the general case.

In some cases such as kapptemplate copies of code templates are included in the output and the code template licence will apply. Looking at the template they are generally GPL 2+ and I seem to remember when I've cared about this in the past that I'm happy with that because I want to spread freedom and encourage people to use the GPL. In practice if people want to use some other licence they'll just switch it to that and nobody will mind.

adridg added a subscriber: adridg.Jun 29 2020, 3:12 PM

The classic example of Jon's second paragraph is YACC (and Bison), which generates code and adds a big chunk of template code. Or Boost, which has parts intended for header-only use, and so that gets copied all over the place (think of the header as "generated code from the source 'use boost::pointer'"). The template is copyrighted, but in context is liberally licensed.

Sticking the GPL in a kapptemplate seems somehow "sneaky" unless there's an indication why that license is required. If it's not required, there should be language nearby saying "pick your license here, but here's a good one:..". That language might be a good idea anyway: you don't want to suggest that the generated code has license requirements imposed by the generator.

One other reason to have GPL 2+ in there by default is that it's KDE's default licence and with reuse stuff having the right licence text in the right place is quite faffy so it helps if that is part of the template along with the c++ etc bits.