doc: Use G-Expressions for package definition example.
* doc/guix.texi (Build Phases): Use G-Expressions for example. Co-authored-by: Nicolas Goaziou <mail@nicolasgoaziou.fr> Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
		
							parent
							
								
									aaa0e7b3f8
								
							
						
					
					
						commit
						8ffe52df47
					
				
					 1 changed files with 22 additions and 14 deletions
				
			
		| 
						 | 
					@ -10140,23 +10140,31 @@ phase before the @code{build} phase, called
 | 
				
			||||||
    ;; other fields omitted
 | 
					    ;; other fields omitted
 | 
				
			||||||
    (build-system gnu-build-system)
 | 
					    (build-system gnu-build-system)
 | 
				
			||||||
    (arguments
 | 
					    (arguments
 | 
				
			||||||
     '(#:phases (modify-phases %standard-phases
 | 
					     (list
 | 
				
			||||||
 | 
					      #:phases
 | 
				
			||||||
 | 
					      #~(modify-phases %standard-phases
 | 
				
			||||||
          (delete 'configure)
 | 
					          (delete 'configure)
 | 
				
			||||||
          (add-before 'build 'set-prefix-in-makefile
 | 
					          (add-before 'build 'set-prefix-in-makefile
 | 
				
			||||||
                    (lambda* (#:key outputs #:allow-other-keys)
 | 
					            (lambda* (#:key inputs #:allow-other-keys)
 | 
				
			||||||
              ;; Modify the makefile so that its
 | 
					              ;; Modify the makefile so that its
 | 
				
			||||||
                      ;; 'PREFIX' variable points to "out".
 | 
					              ;; 'PREFIX' variable points to #$output and
 | 
				
			||||||
                      (let ((out (assoc-ref outputs "out")))
 | 
					              ;; 'XMLLINT' points to the correct path.
 | 
				
			||||||
              (substitute* "Makefile"
 | 
					              (substitute* "Makefile"
 | 
				
			||||||
                (("PREFIX =.*")
 | 
					                (("PREFIX =.*")
 | 
				
			||||||
                           (string-append "PREFIX = "
 | 
					                 (string-append "PREFIX = " #$output "\n"))
 | 
				
			||||||
                                          out "\n")))))))))))
 | 
					                (("XMLLINT =.*")
 | 
				
			||||||
 | 
					                 (string-append "XMLLINT = "
 | 
				
			||||||
 | 
					                                (search-input-file inputs "/bin/xmllint")
 | 
				
			||||||
 | 
					                                "\n"))))))))))
 | 
				
			||||||
@end lisp
 | 
					@end lisp
 | 
				
			||||||
 | 
					
 | 
				
			||||||
The new phase that is inserted is written as an anonymous procedure,
 | 
					The new phase that is inserted is written as an anonymous procedure,
 | 
				
			||||||
introduced with @code{lambda*}; it honors the @code{outputs} parameter
 | 
					introduced with @code{lambda*}; it looks for the @file{xmllint}
 | 
				
			||||||
we have seen before.  @xref{Build Utilities}, for more about the helpers
 | 
					executable under a @file{/bin} directory among the package's inputs
 | 
				
			||||||
used by this phase, and for more examples of @code{modify-phases}.
 | 
					(@pxref{package Reference}).  It also honors the @code{outputs} parameter
 | 
				
			||||||
 | 
					we have seen before.  @xref{Build Utilities}, for more about
 | 
				
			||||||
 | 
					the helpers used by this phase, and for more examples of
 | 
				
			||||||
 | 
					@code{modify-phases}.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@cindex code staging
 | 
					@cindex code staging
 | 
				
			||||||
@cindex staging, of code
 | 
					@cindex staging, of code
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in a new issue