summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2021-07-12 10:59:36 +0200
committerLudovic Courtès <ludo@gnu.org>2021-07-12 10:59:36 +0200
commit12c2648f4e8e050d9374ca70efd1856dc8238979 (patch)
treed6a1800cfa824be2cbfbb1cdcc21f03a3f79d241 /doc
parentbc7dd3f713cc7482238fe688b23adf6569389b67 (diff)
doc: cookbook: Adjust example to simplified input style.
* doc/guix-cookbook.texi (Extended example): Adjust example to new input style and adjust "Inputs" section.
Diffstat (limited to 'doc')
-rw-r--r--doc/guix-cookbook.texi43
1 files changed, 21 insertions, 22 deletions
diff --git a/doc/guix-cookbook.texi b/doc/guix-cookbook.texi
index d3c91326e9..ed0cd19cd5 100644
--- a/doc/guix-cookbook.texi
+++ b/doc/guix-cookbook.texi
@@ -814,15 +814,12 @@ another, more sophisticated package (slightly modified from the source):
(add-after 'unpack 'make-files-writable-for-tests
(lambda _ (for-each make-file-writable (find-files "." ".*")))))))
(inputs
- `(("libssh2" ,libssh2)
- ("http-parser" ,http-parser)
- ("python" ,python-wrapper)))
+ (list libssh2 http-parser python-wrapper))
(native-inputs
- `(("pkg-config" ,pkg-config)))
+ (list pkg-config))
(propagated-inputs
;; These two libraries are in 'Requires.private' in libgit2.pc.
- `(("openssl" ,openssl)
- ("zlib" ,zlib)))
+ (list openssl zlib))
(home-page "https://libgit2.github.com/")
(synopsis "Library providing Git core methods")
(description
@@ -886,22 +883,6 @@ Snippets might need additional Guile modules which can be imported from the
@subsubsection Inputs
-First, a syntactic comment: See the quasi-quote / comma syntax?
-
-@lisp
- (native-inputs
- `(("pkg-config" ,pkg-config)))
-@end lisp
-
-is equivalent to
-
-@lisp
- (native-inputs
- (list (list "pkg-config" pkg-config)))
-@end lisp
-
-You'll mostly see the former because it's shorter.
-
There are 3 different input types. In short:
@table @asis
@@ -935,6 +916,24 @@ It also matters when a substitute is available, in which case only the @emph{inp
and @emph{propagated inputs} will be fetched: the @emph{native inputs} are not required to
install a package from a substitute.
+@quotation Note
+You may see here and there snippets where package inputs are written
+quite differently, like so:
+
+@lisp
+;; The "old style" for inputs.
+(inputs
+ `(("libssh2" ,libssh2)
+ ("http-parser" ,http-parser)
+ ("python" ,python-wrapper)))
+@end lisp
+
+This is the ``old style'', where each input in the list is explicitly
+given a label (a string). It is still supported but we recommend using
+the style above instead. @xref{package Reference,,, guix, GNU Guix
+Reference Manual}, for more info.
+@end quotation
+
@subsubsection Outputs
Just like how a package can have multiple inputs, it can also produce multiple