summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim@guixotic.coop>2026-05-28 09:44:42 +0900
committerMaxim Cournoyer <maxim@guixotic.coop>2026-06-19 14:15:56 +0900
commite27ebca94304d822db563942f675491f45e5a604 (patch)
tree652ab4ac5f400e113a85fe48ba0a0d4627a97837 /doc
parent86776ccd30bb44eb856fcf3a14a8338f38fe1367 (diff)
doc: Add some guidance for the package `license' field.
It's a frequent enough question by contributors that we should document its purpose better. * doc/guix.texi (package Reference) [license]: Precise the intent of this field, and add a few examples. Merges: !8904 Reviewed-by: Nguyễn Gia Phong <cnx@loang.net>
Diffstat (limited to 'doc')
-rw-r--r--doc/guix.texi80
1 files changed, 78 insertions, 2 deletions
diff --git a/doc/guix.texi b/doc/guix.texi
index 9c591faaccc..f384dfb2539 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -8633,8 +8633,84 @@ syntax.
8633 8633
8634@item @code{license} 8634@item @code{license}
8635@cindex license, of packages 8635@cindex license, of packages
8636The license of the package; a value from @code{(guix licenses)}, 8636The @emph{published} and effective license of the package; a value from
8637or a list of such values. 8637@code{(guix licenses)}, or a list of such values.
8638
8639@cindex package license field, guidance
8640@cindex GNU FSDG, acceptable licenses
8641The purpose of the @code{license} field is to let users know what
8642license the upstream project is using rather than exhaustively listing
8643all the licenses used in its source files. When a project is published
8644under multiple licenses, the licenses should ideally appear in
8645decreasing order of usage in the project. Only free software licenses
8646should be listed in the Guix project, which, as a GNU project, adheres
8647to the
8648@url{https://www.gnu.org/distros/free-system-distribution-guidelines.html,
8649@acronym{GNU FSDG, Free System Distribution Guidelines}}. Below are
8650some examples:
8651
8652@lisp
8653(license gpl3+) ;GPL 3.0 or later
8654@end lisp
8655
8656@lisp
8657(license (list gpl3+ asl2.0)) ;dual-licensed
8658@end lisp
8659
8660@lisp
8661(license (non-copyleft "file:///NOTICE"
8662 "Variant of the Expat license"))
8663@end lisp
8664
8665The variables such as @code{gpl3+} are instances of the @code{license}
8666data type, documented below:
8667
8668@deftp {Data Type} license name uri comment
8669
8670@table @code
8671@item name
8672The name of the license
8673@item uri
8674The URI of the license, preferably an @samp{https://} link to its home
8675page, else a @samp{file://} URI of the license file, relative to the
8676root of the package source tree.
8677@item comment
8678A comment or URI providing further details about the license.
8679@end table
8680
8681As an example, the @code{gpl3+} license is defined this way:
8682
8683@lisp
8684(define gpl3+
8685 (license "GPL 3+"
8686 "https://www.gnu.org/licenses/gpl.html"
8687 "https://www.gnu.org/licenses/license-list#GNUGPLv3"))
8688@end lisp
8689@end deftp
8690
8691@code{non-copyleft} is a procedure that is used when encountering a
8692non-copyleft license that is not common enough to deserve its own entry
8693in the @code{(guix licenses)} module. Its usage is documented below:
8694
8695@deffn {Procedure} non-copyleft uri [comment]
8696Return a @code{license} object specialized with a name and comment
8697appropriate for a non-copyleft license. The URI is as documented for
8698the @code{license} record, and may be a @samp{file://} URI referring to
8699a file relative to the root of the source tree of the package.
8700@end deffn
8701
8702Below are other license-generating procedures found in the @code{(guix
8703licenses)} module. Please refer to their documentation strings for more
8704details.
8705
8706@deffn {Procedure} x11-style uri [comment]
8707@end deffn
8708
8709@deffn {Procedure} fsf-free uri [comment]
8710@end deffn
8711
8712@deffn {Procedure} fsdg-compatible uri [comment]
8713@end deffn
8638 8714
8639@item @code{home-page} 8715@item @code{home-page}
8640The URL to the home-page of the package, as a string. 8716The URL to the home-page of the package, as a string.