docs: Recommend to use SPDX license identifiers [skip ci]

Some license identifiers are ambiguous (e.g. "GPL3"). The SPDX license
identifiers avoid this by providing standardized and unique identifiers
(e.g. "GPL-3.0-only" or "GPL-3.0-or-later" for the previous example).

Because SPDX short-form identifiers are also both human- and
machine-readable we should recommend them in the documentation.

More information (advantages, details, etc.) can be found here:
- https://spdx.dev/resources/use/#identifiers
- https://spdx.dev/ids/

Fix #7905.
This commit is contained in:
Michael Weiss 2020-11-05 20:28:12 +01:00 committed by GitHub
parent 7860a6aeab
commit cc033e5476
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 10 deletions

View File

@ -1398,13 +1398,14 @@ Project supports the following keyword arguments.
specific options are used normally even in subprojects. specific options are used normally even in subprojects.
- `license`: takes a string or array of strings describing the - `license`: takes a string or array of strings describing the license(s) the
license(s) the code is under. Usually this would be something like code is under. To avoid ambiguity it is recommended to use a standardized
`license : 'GPL2+'`, but if the code has multiple licenses you can license identifier from the [SPDX license list](https://spdx.org/licenses/).
specify them as an array like this: `license : ['proprietary', Usually this would be something like `license : 'GPL-2.0-or-later'`, but if
'GPL3']`. Note that the text is informal and is only written to the code has multiple licenses you can specify them as an array like this:
the dependency manifest. Meson does not do any license validation, `license : ['proprietary', 'GPL-3.0-only']`. Note that the text is informal
you are responsible for verifying that you abide by all licensing and is only written to the dependency manifest. Meson does not do any license
validation, you are responsible for verifying that you abide by all licensing
terms. You can access the value in your Meson build files with terms. You can access the value in your Meson build files with
`meson.project_license()`. `meson.project_license()`.

View File

@ -1,8 +1,8 @@
project('bar', 'c', license: 'Apache') project('bar', 'c', license: 'Apache-2.0')
executable('bar', 'bar.c') executable('bar', 'bar.c')
license = meson.project_license()[0] license = meson.project_license()[0]
if license != 'Apache' if license != 'Apache-2.0'
error('The license should be Apache, but it is: ' + license) error('The license should be Apache-2.0, but it is: ' + license)
endif endif