mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-25 20:19:18 -05:00
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>
This commit is contained in:
parent
ad8abf18dd
commit
306bd7b8b9
1 changed files with 20 additions and 0 deletions
|
@ -113,6 +113,7 @@ Copyright @copyright{} 2022–2023 Bruno Victal@*
|
||||||
Copyright @copyright{} 2022 Ivan Vilata-i-Balaguer@*
|
Copyright @copyright{} 2022 Ivan Vilata-i-Balaguer@*
|
||||||
Copyright @copyright{} 2023 Giacomo Leidi@*
|
Copyright @copyright{} 2023 Giacomo Leidi@*
|
||||||
Copyright @copyright{} 2022 Antero Mejr@*
|
Copyright @copyright{} 2022 Antero Mejr@*
|
||||||
|
Copyright @copyright{} 2023 Karl Hallsby
|
||||||
|
|
||||||
Permission is granted to copy, distribute and/or modify this document
|
Permission is granted to copy, distribute and/or modify this document
|
||||||
under the terms of the GNU Free Documentation License, Version 1.3 or
|
under the terms of the GNU Free Documentation License, Version 1.3 or
|
||||||
|
@ -4317,6 +4318,25 @@ The command to install its documentation is:
|
||||||
guix install glib:doc
|
guix install glib:doc
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
|
While the colon syntax works for command-line specification of package
|
||||||
|
outputs, it will not work when using a package @emph{variable} in Scheme
|
||||||
|
code. For example, to add the documentation of @code{glib} to the
|
||||||
|
globally installed packages of an @code{operating-system} (see
|
||||||
|
@ref{operating-system Reference}), a list of two items, the first one
|
||||||
|
being the package @emph{variable} and the second one the name of the
|
||||||
|
output to select (a string), must be used instead:
|
||||||
|
|
||||||
|
@lisp
|
||||||
|
(use-modules (gnu packages glib))
|
||||||
|
;; glib-with-documentation is the Guile symbol for the glib package
|
||||||
|
(operating-system
|
||||||
|
...
|
||||||
|
(packages
|
||||||
|
(append
|
||||||
|
(list (list glib-with-documentation "doc"))
|
||||||
|
%base-packages)))
|
||||||
|
@end lisp
|
||||||
|
|
||||||
Some packages install programs with different ``dependency footprints''.
|
Some packages install programs with different ``dependency footprints''.
|
||||||
For instance, the WordNet package installs both command-line tools and
|
For instance, the WordNet package installs both command-line tools and
|
||||||
graphical user interfaces (GUIs). The former depend solely on the C
|
graphical user interfaces (GUIs). The former depend solely on the C
|
||||||
|
|
Loading…
Reference in a new issue