diff options
| author | Karl Hallsby <karl@hallsby.com> | 2023-01-08 13:37:55 -0600 |
|---|---|---|
| committer | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2023-03-21 16:19:12 -0400 |
| commit | 306bd7b8b952b1e721fd36a9d69b3373862e8087 (patch) | |
| tree | b1ce2074e60250675e86fff355ea7fc6fa10d987 /doc | |
| parent | ad8abf18ddc1144cb3dba0b507568674c8fcfd7c (diff) | |
doc: Document how to use specific package outputs in code.
* doc/guix.texi (Packages with Multiple Outputs): Provide an example of
selecting a package's output in Scheme.
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Modified-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/guix.texi | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/doc/guix.texi b/doc/guix.texi index 330d83d9abc..5a2dc2a3a3c 100644 --- a/doc/guix.texi +++ b/doc/guix.texi | |||
| @@ -113,6 +113,7 @@ Copyright @copyright{} 2022–2023 Bruno Victal@* | |||
| 113 | Copyright @copyright{} 2022 Ivan Vilata-i-Balaguer@* | 113 | Copyright @copyright{} 2022 Ivan Vilata-i-Balaguer@* |
| 114 | Copyright @copyright{} 2023 Giacomo Leidi@* | 114 | Copyright @copyright{} 2023 Giacomo Leidi@* |
| 115 | Copyright @copyright{} 2022 Antero Mejr@* | 115 | Copyright @copyright{} 2022 Antero Mejr@* |
| 116 | Copyright @copyright{} 2023 Karl Hallsby | ||
| 116 | 117 | ||
| 117 | Permission is granted to copy, distribute and/or modify this document | 118 | Permission is granted to copy, distribute and/or modify this document |
| 118 | under the terms of the GNU Free Documentation License, Version 1.3 or | 119 | under the terms of the GNU Free Documentation License, Version 1.3 or |
| @@ -4317,6 +4318,25 @@ The command to install its documentation is: | |||
| 4317 | guix install glib:doc | 4318 | guix install glib:doc |
| 4318 | @end example | 4319 | @end example |
| 4319 | 4320 | ||
| 4321 | While the colon syntax works for command-line specification of package | ||
| 4322 | outputs, it will not work when using a package @emph{variable} in Scheme | ||
| 4323 | code. For example, to add the documentation of @code{glib} to the | ||
| 4324 | globally installed packages of an @code{operating-system} (see | ||
| 4325 | @ref{operating-system Reference}), a list of two items, the first one | ||
| 4326 | being the package @emph{variable} and the second one the name of the | ||
| 4327 | output to select (a string), must be used instead: | ||
| 4328 | |||
| 4329 | @lisp | ||
| 4330 | (use-modules (gnu packages glib)) | ||
| 4331 | ;; glib-with-documentation is the Guile symbol for the glib package | ||
| 4332 | (operating-system | ||
| 4333 | ... | ||
| 4334 | (packages | ||
| 4335 | (append | ||
| 4336 | (list (list glib-with-documentation "doc")) | ||
| 4337 | %base-packages))) | ||
| 4338 | @end lisp | ||
| 4339 | |||
| 4320 | Some packages install programs with different ``dependency footprints''. | 4340 | Some packages install programs with different ``dependency footprints''. |
| 4321 | For instance, the WordNet package installs both command-line tools and | 4341 | For instance, the WordNet package installs both command-line tools and |
| 4322 | graphical user interfaces (GUIs). The former depend solely on the C | 4342 | graphical user interfaces (GUIs). The former depend solely on the C |
