[oe] Method for specifying which among a recipe's multiple available licenses is desired?

Matt Hoosier matt.hoosier at gmail.com
Fri Oct 27 16:41:05 UTC 2017


Hi,

I'm searching for an annotation that I can insert (perhaps with a
.bbappend) into a recipe that indicates which of the multiple licensing
terms I elect to use for a given recipe.

The regular LICENSE_FLAGS_WHITELIST variable is somewhat related, but it
works in the opposite way: make an exception to global preference against a
license.

What I had in mind would work as follows. Suppose foo.bb has:

  LICENSE="MIT BSD LGPLv2 LGPLv3"

If I choose to take only the MIT or LGPLv2 terms of use for this one
package (not as an overall global prohibition against the remaining
licenses), the idea is that I would write something like:

  LICENSE_CHOSEN="MIT LGPLv2"

The main desired outcome is that the build/tmp/deploy/license/<pn>
directory will only contain the texts of the license terms that I actually
accepted, rather than all conceivable ones under which Foo is offered.

It would be a bonus if some Bitbake magic behind the scenes would validate
that there is a nonempty intersection between ${LICENSE} and
${LICENSE_CHOSEN}. If there's no overlap, an explicit fatal error would be
nice. But this isn't a deal-breaker; I can infer this from an empty
build/tmp/deploy/license/<pn> directory.

Are there any existing add-on bbclass'es that might do this? I had a brief
try at rolling my own, but parsing the nested LICENSE text involving && and
|| operators looks non-trivial.



More information about the Openembedded-devel mailing list