guix-commits
[Top][All Lists]
Advanced

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

04/05: self: Build and install 'guix-cookbook.info' and its translations


From: guix-commits
Subject: 04/05: self: Build and install 'guix-cookbook.info' and its translations.
Date: Tue, 21 Apr 2020 17:53:10 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit e1e6491226347d9fb93ff484d78cef98848a510a
Author: Ludovic Courtès <address@hidden>
AuthorDate: Tue Apr 21 23:05:02 2020 +0200

    self: Build and install 'guix-cookbook.info' and its translations.
    
    * guix/self.scm (translate-texi-manuals)[build]: Translate and install
    guix-cookbook.texi.
    (info-manual)[build]: Handle "guix-cookbook*.texi".
---
 guix/self.scm | 39 ++++++++++++++++++++++++---------------
 1 file changed, 24 insertions(+), 15 deletions(-)

diff --git a/guix/self.scm b/guix/self.scm
index 3cc1003..4682cd2 100644
--- a/guix/self.scm
+++ b/guix/self.scm
@@ -383,12 +383,17 @@ a list of extra files, such as '(\"contributing\")."
                                        #:extras '("contributing"))))
                     (available-translations "." "guix-manual"))
 
-          (for-each
-            (lambda (file)
-              (copy-file file (string-append #$output "/" file)))
-            (append
-              (find-files "." "contributing\\..*\\.texi$")
-              (find-files "." "guix\\..*\\.texi$"))))))
+          (for-each (match-lambda
+                      ((language . po)
+                       (translate-texi "guix-cookbook" po language)))
+                    (available-translations "." "guix-cookbook"))
+
+          (for-each (lambda (file)
+                      (install-file file #$output))
+                    (append
+                     (find-files "." "contributing\\..*\\.texi$")
+                     (find-files "." "guix\\..*\\.texi$")
+                     (find-files "." "guix-cookbook\\..*\\.texi$"))))))
 
   (computed-file "guix-translated-texinfo" build))
 
@@ -415,7 +420,8 @@ a list of extra files, such as '(\"contributing\")."
   (define build
     (with-imported-modules '((guix build utils))
       #~(begin
-          (use-modules (guix build utils))
+          (use-modules (guix build utils)
+                       (ice-9 match))
 
           (mkdir #$output)
 
@@ -476,13 +482,13 @@ a list of extra files, such as '(\"contributing\")."
                   #+(file-append glibc-utf8-locales "/lib/locale"))
 
           (for-each (lambda (texi)
-                      (unless (string=? "guix.texi" texi)
-                        ;; Create 'version-LL.texi'.
-                        (let* ((base (basename texi ".texi"))
-                               (dot  (string-index base #\.))
-                               (tag  (string-drop base (+ 1 dot))))
-                          (symlink "version.texi"
-                                   (string-append "version-" tag ".texi"))))
+                      (match (string-split (basename texi) #\.)
+                        (("guix" language "texi")
+                         ;; Create 'version-LL.texi'.
+                         (symlink "version.texi"
+                                  (string-append "version-" language
+                                                 ".texi")))
+                        (_ #f))
 
                       (invoke #+(file-append texinfo "/bin/makeinfo")
                               texi "-I" #$documentation
@@ -491,7 +497,10 @@ a list of extra files, such as '(\"contributing\")."
                                                   (basename texi ".texi")
                                                   ".info")))
                     (cons "guix.texi"
-                          (find-files "." 
"^guix\\.[a-z]{2}(_[A-Z]{2})?\\.texi$")))
+                          (append (find-files "."
+                                              
"^guix\\.[a-z]{2}(_[A-Z]{2})?\\.texi$")
+                                  (find-files "."
+                                              "^guix-cookbook.*\\.texi$"))))
 
           ;; Compress Info files.
           (setenv "PATH"



reply via email to

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