guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

04/04: doc: cookbook: Adjust example to simplified input style.


From: guix-commits
Subject: 04/04: doc: cookbook: Adjust example to simplified input style.
Date: Mon, 12 Jul 2021 05:00:23 -0400 (EDT)

civodul pushed a commit to branch core-updates
in repository guix.

commit 12c2648f4e8e050d9374ca70efd1856dc8238979
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Mon Jul 12 10:59:36 2021 +0200

    doc: cookbook: Adjust example to simplified input style.
    
    * doc/guix-cookbook.texi (Extended example): Adjust example to new input
    style and adjust "Inputs" section.
---
 doc/guix-cookbook.texi | 43 +++++++++++++++++++++----------------------
 1 file changed, 21 insertions(+), 22 deletions(-)

diff --git a/doc/guix-cookbook.texi b/doc/guix-cookbook.texi
index d3c9132..ed0cd19 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]