E.2 Software support to keep track of license conditions
Given the above, it is possible that SWI-Prolog packages and extensions rely on the GPL, LGPL or other licenses. The predicates below allow for registering license requirements for Prolog files and foreign modules. The predicate license/0 reports which components from the currently configured system are distributed under non-permissive open source licenses and therefore may need to be replaced to suit your requirements.
- license
- Evaluate the license conditions of all loaded components. If the system
contains one or more components that are licensed under GPL-like
restrictions the system indicates this program may only be distributed
under the
GPLlicense as well as which components prohibit the use of other license conditions. Likewise for LGPL components. Components under acopyleftlicense such as the EPL are listed separately: the copyleft of these licenses only applies to the component itself. - license(+LicenseId, +Component)
- Register the fact that Component is distributed under a
license identified by LicenseId. Known license identifiers
can be listed using known_licenses/0.
A new license can be registered as a known language using a declaration
like below. The second argument defines the
category if the license, which is one of
gpl,lgpl,copyleft,permissiveorproprietary. The categorycopyleftis for licenses whose copyleft is limited to the component itself, such as the Eclipse Public License (EPL). The third argument is a list of properties. Defined arecomment(Text),url(URL)andgpl_compatible(false). The latter makes license/0 warn if the license is combined with a component in thegplcategory.:- multifile license:license/3. license:license(mylicense, permissive, [ comment('My personal license'), url('http://www.mine.org/license.html') ]). :- license(mylicense). - license(+LicenseId)
- Intended as a directive in Prolog source files. It takes the current filename and calls license/2.
- void PL_license(const char *LicenseId, const char *Component)
- Intended for the install() procedure of foreign libraries. This call can be made before PL_initialise().
- known_licenses
- List all licenses known to the system. This does not imply the system contains code covered by the listed licenses. See license/2.