summaryrefslogtreecommitdiffstats
path: root/quip-0018-license-specification.rst
blob: 201a2f980c55abe64e15651110dc607ff18b64cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
QUIP: 18
Title: License specification in Qt's modules
Author: Lucie Gerard,
        Jörg Bornemann
Status: Active
Type: Informational
Created: 2022-09-26
Post-History:
  https://lists.qt-project.org/pipermail/development/2023-February/043648.html
  https://lists.qt-project.org/pipermail/development/2024-February/045028.html

Overview
========

This QUIP specifies the licenses that are used in different parts of a
typical Qt module repository and also provides helpful guidance about
how to express which license source code is under.

License header format
=====================

The license header follows the SPDX standard [0]_.

There is at least one copyright line and exactly one license
expression line::

  Copyright (C) 2023 The Qt Company Ltd.
  SPDX-License-Identifier: <spdx-license-expression>

A copyright line for code written by a contributor outside the Qt
Company can include that contributor's name (or a legal entity they
represent) in the Copyright header.

The copyright line should include the year the file was created, or -
in the case of additional copyright lines - the year the additional
copyright notice was added. Updating the copyright year when changes
are made to the file is possible.

The copyright line may be prefixed with `SPDX-FileCopyrightText:`.

The `<spdx-license-expression>` must be a valid expression, according
to the SPDX standard as defined in [1]_.

The license identifiers used in a license expression are either from
the list of known licenses [2]_ or prefixed with `LicenseRef-`.

The license files are placed into a `LICENSES` directory below the Qt
module repository's root. The license files are named after the SPDX
license identifier followed by ``.txt`` [3]_.

Classification of files
=======================

There are various kinds of files in a Qt module repository that should
include license headers. Here, we classify these files in order to
identify which files should be under which licenses.

Files that do not support inline comments do not have to contain
licensing information. If licensing information for such files is
still desirable, it should be placed into an adjacent ``.license``
text file. For example, ``blob.bin`` may be accompanied by
``blob.bin.license`` in the same directory.

Licensing information may be omitted for files with trivial content.

The documentation landing page of a Qt module contains a "Licenses and
Attributions" section that defines the licenses under which the module
and plugin implementation is available. See the list of Qt modules
[6]_.

Module and plugin implementation
--------------------------------

Files that belong to the implementation of Qt modules and plugins. The
usual locations for module source code are the subdirectories ``src/``
and ``plugins/``.

There are two licensing models for module and plugin implementations:
GPL-only and one that is additionally licensed under LPGL.

The license expression permitting the LPGL is
``LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR
GPL-3.0-only``.

The GPL-only license expression is ``LicenseRef-Qt-Commercial OR
GPL-3.0-only``.

The license expression for files that are statically linked with user
code - even for dynamic builds of Qt - is
``LicenseRef-Qt-Commercial OR BSD-3-Clause``.

Examples and Snippets
---------------------

Files that belong to the implementation of Qt examples. The usual
locations for examples is the ``examples/`` subdirectory.

Also, any source code that appears in the documentation. The usual locations are
``snippets/`` directories throughout the Qt module repository's directory
tree.

The license expression for examples and snippets is ``LicenseRef-Qt-Commercial OR
BSD-3-Clause``.

Tests
-----

Files that belong to the implementation of Qt tests. The usual
location is the ``tests/`` subdirectory.

The license expression for tests is ``LicenseRef-Qt-Commercial OR
GPL-3.0-only``.

Tools and Utils
---------------

Files that belong to the implementation of Qt tools that are for use
by Qt users. The usual location is the ``src/tools/`` subdirectory.

Also considered tools are script and shell files,
as long as they are not part of an example or a documentation snippet.
Such files are usually using the following file name patterns:

- ``*.sh``
- ``*.py``
- ``*.pl``
- ``*.bat``
- ``*.ps1``

Finally, files that are located in a /util/ directory.

The license expression for tools and utils is ``LicenseRef-Qt-Commercial OR
GPL-3.0-only WITH Qt-GPL-exception-1.0``.

Documentation
-------------

All ``.qdoc``, ``.qdocinc`` and ``.qdocconf`` files that are needed to
generate the documentation.

The license expression for documentation is ``LicenseRef-Qt-Commercial
OR GFDL-1.3-no-invariants-only``.

Build System Files
------------------

All files that contribute to Qt's build system. That includes the following file
name patterns:

- ``CMakeLists.txt``
- ``*.cmake``
- ``*.pro``
- ``*.pri``
- ``*.prf``

If such a file is present in a snippet directory, it is licensed as
a documentation snippets file.
If such a file is present in an example directory, it is licensed as
an example file.

The license expression for build system files is ``BSD-3-Clause``.

Testing License Usage
=====================

The Qt CI can enforce correct usages of license files.
This requires a 'licenseRule.json' file to exist in the top-level
directory of the Qt module's repository. This file contain
declarative rules, based on file suffix and directory,
and should follow the rules set out in this QUIP.
They do allow for exceptions and special cases though, if necessary.

Related Work
============

The "Software License Agreement between The KDE Free Qt Foundation and
The Qt Company Oy" [4]_ poses restrictions for the licenses of the Qt
Free Edition modules.

To a certain extent, Qt follows REUSE [5]_. REUSE is a guideline on
how to specify the licenses in a project. We don't aim for full
compliance at this point, due to small/binary files and 3rd party
content.

References
==========

.. [0] https://spdx.github.io/spdx-spec/v2.3/
.. [1] https://spdx.github.io/spdx-spec/v2.3/SPDX-license-expressions/
.. [2] https://spdx.org/licenses/
.. [3] https://reuse.software/tutorial/#step-1
.. [4] https://kde.org/community/whatiskde/Software_License_Agreement_2015_Text.pdf
.. [5] https://reuse.software/spec/
.. [6] https://doc.qt.io/qt-6/qtmodules.html