guix-commits
[Top][All Lists]
Advanced

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

03/03: locale: Demonadify the locale creation API.


From: Ludovic Courtès
Subject: 03/03: locale: Demonadify the locale creation API.
Date: Mon, 17 Jul 2017 17:42:35 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit b19a49d015070f9109c157bc39b47574a8dad481
Author: Ludovic Courtès <address@hidden>
Date:   Mon Jul 17 23:38:23 2017 +0200

    locale: Demonadify the locale creation API.
    
    * gnu/system/locale.scm (single-locale-directory): Use 'computed-file'
    instead of 'gexp->derivation'.
    (locale-directory): Adjust accordingly and do the same.
    * gnu/system.scm (operating-system-directory-base-entries): Adjust
    accordingly.
---
 gnu/system.scm        | 23 ++++++++++++-----------
 gnu/system/locale.scm | 26 +++++++++++---------------
 2 files changed, 23 insertions(+), 26 deletions(-)

diff --git a/gnu/system.scm b/gnu/system.scm
index ee1e10f..bffbee7 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -403,17 +403,18 @@ OS."
 (define* (operating-system-directory-base-entries os #:key container?)
   "Return the basic entries of the 'system' directory of OS for use as the
 value of the SYSTEM-SERVICE-TYPE service."
-  (mlet %store-monad ((locale (operating-system-locale-directory os)))
-    (if container?
-        (return `(("locale" ,locale)))
-        (mlet %store-monad
-            ((kernel  ->  (operating-system-kernel os))
-             (initrd      (operating-system-initrd-file os))
-             (params      (operating-system-boot-parameters-file os)))
-          (return `(("kernel" ,kernel)
-                    ("parameters" ,params)
-                    ("initrd" ,initrd)
-                    ("locale" ,locale)))))))      ;used by libc
+  (let ((locale (operating-system-locale-directory os)))
+    (with-monad %store-monad
+      (if container?
+          (return `(("locale" ,locale)))
+          (mlet %store-monad
+              ((kernel  ->  (operating-system-kernel os))
+               (initrd      (operating-system-initrd-file os))
+               (params      (operating-system-boot-parameters-file os)))
+            (return `(("kernel" ,kernel)
+                      ("parameters" ,params)
+                      ("initrd" ,initrd)
+                      ("locale" ,locale))))))))   ;used by libc
 
 (define* (essential-services os #:key container?)
   "Return the list of essential services for OS.  These are special services
diff --git a/gnu/system/locale.scm b/gnu/system/locale.scm
index 2ee834d..75cb855 100644
--- a/gnu/system/locale.scm
+++ b/gnu/system/locale.scm
@@ -19,7 +19,6 @@
 (define-module (gnu system locale)
   #:use-module (guix gexp)
   #:use-module (guix store)
-  #:use-module (guix monads)
   #:use-module (guix records)
   #:use-module (guix packages)
   #:use-module (gnu packages base)
@@ -118,8 +117,7 @@ of LIBC."
          (and #$@(map (cut localedef-command <> #:libc libc)
                       locales)))))
 
-  (gexp->derivation (string-append "locale-" version) build
-                    #:local-build? #t))
+  (computed-file (string-append "locale-" version) build))
 
 (define* (locale-directory locales
                            #:key (libcs %default-locale-libcs))
@@ -133,18 +131,16 @@ data format changes between libc versions."
     ((libc)
      (single-locale-directory locales #:libc libc))
     ((libcs ..1)
-     (mlet %store-monad ((dirs (mapm %store-monad
-                                     (lambda (libc)
-                                       (single-locale-directory locales
-                                                                #:libc libc))
-                                     libcs)))
-       (gexp->derivation "locale-multiple-versions"
-                         (with-imported-modules '((guix build union))
-                           #~(begin
-                               (use-modules (guix build union))
-                               (union-build #$output (list address@hidden))))
-                         #:local-build? #t
-                         #:substitutable? #f)))))
+     (let ((dirs (map (lambda (libc)
+                        (single-locale-directory locales #:libc libc))
+                      libcs)))
+       (computed-file "locale-multiple-versions"
+                      (with-imported-modules '((guix build union))
+                        #~(begin
+                            (use-modules (guix build union))
+                            (union-build #$output (list address@hidden))))
+                      #:options '(#:local-build? #t
+                                  #:substitutable? #f))))))
 
 (define %default-locale-libcs
   ;; The libcs for which we build locales by default.



reply via email to

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