doc: Document 'mount-may-fail?' field.
[jackhill/guix/guix.git] / doc / build.scm
index 3907b49..7256fb9 100644 (file)
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2019, 2020 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2020 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
       "guix"))
 
 (define %languages
-  '("de" "en" "es" "fr" "ru" "zh_CN"))
+  ;; The cookbook is currently only translated into German.
+  (if (string=? %manual "guix-cookbook")
+      '("de" "en")
+      '("de" "en" "es" "fr" "ru" "zh_CN")))
 
 (define (texinfo-manual-images source)
   "Return a directory containing all the images used by the user manual, taken
@@ -137,7 +141,7 @@ as well as images, OS examples, and translations."
                             (date->string date "~B ~Y")
                             version version))))))
 
-          (install-file #$(file-append* documentation "/htmlxref.cnf")
+          (install-file #$(file-append documentation "/htmlxref.cnf")
                         #$output)
 
           (for-each (lambda (texi)
@@ -178,30 +182,27 @@ content=\"width=device-width, initial-scale=1\" />"))
   ;; Guile-Lib with a hotfix for (htmlprag).
   (package
     (inherit guile-lib)
-    (source (origin
-              (inherit (package-source guile-lib))
-              (modules '(( guix build utils)))
-              (snippet
-               '(begin
-                  ;; When parsing
-                  ;; "<body><blockquote><p>foo</p>\n</blockquote></body>",
-                  ;; 'html->shtml' would mistakenly close 'blockquote' right
-                  ;; before <p>.  This patch removes 'p' from the
-                  ;; 'parent-constraints' alist to fix that.
-                  (substitute* "src/htmlprag.scm"
-                    (("^[[:blank:]]*\\(p[[:blank:]]+\\. \\(body td th\\)\\).*")
-                     ""))
-                  #t))))
     (arguments
      (substitute-keyword-arguments (package-arguments guile-lib)
        ((#:phases phases '%standard-phases)
         `(modify-phases ,phases
-          (add-before 'check 'skip-known-failure
-            (lambda _
-              ;; XXX: The above change causes one test failure among
-              ;; the htmlprag tests.
-              (setenv "XFAIL_TESTS" "htmlprag.scm")
-              #t))))))))
+           (add-before 'build 'fix-htmlprag
+             (lambda _
+               ;; When parsing
+               ;; "<body><blockquote><p>foo</p>\n</blockquote></body>",
+               ;; 'html->shtml' would mistakenly close 'blockquote' right
+               ;; before <p>.  This patch removes 'p' from the
+               ;; 'parent-constraints' alist to fix that.
+               (substitute* "src/htmlprag.scm"
+                 (("^[[:blank:]]*\\(p[[:blank:]]+\\. \\(body td th\\)\\).*")
+                  ""))
+               #t))
+           (add-before 'check 'skip-known-failure
+             (lambda _
+               ;; XXX: The above change causes one test failure among
+               ;; the htmlprag tests.
+               (setenv "XFAIL_TESTS" "htmlprag.scm")
+               #t))))))))
 
 (define* (syntax-highlighted-html input
                                   #:key
@@ -451,7 +452,9 @@ its <pre class=\"lisp\"> blocks (as produced by 'makeinfo --html')."
                             (lambda (mono)
                               (let ((anchors (collect-anchors mono)))
                                 (process-html mono anchors)))
-                            (find-files #$input "^guix(\\.[a-zA-Z_-]+)?\\.html$"))
+                            (find-files
+                             #$input
+                             "^guix(-cookbook|)(\\.[a-zA-Z_-]+)?\\.html$"))
 
             ;; Next process the multi-node HTML files in two phases: (1)
             ;; collect the list of anchors, and (2) perform