guix-commits
[Top][All Lists]
Advanced

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

02/02: profiles: Build profiles in a UTF-8 locale.


From: Ludovic Courtès
Subject: 02/02: profiles: Build profiles in a UTF-8 locale.
Date: Fri, 16 Dec 2016 17:02:45 +0000 (UTC)

civodul pushed a commit to branch master
in repository guix.

commit 1af0860e8be81c01ad405c1226d6bc4516e62863
Author: Ludovic Courtès <address@hidden>
Date:   Fri Dec 16 18:01:08 2016 +0100

    profiles: Build profiles in a UTF-8 locale.
    
    Fixes <http://bugs.gnu.org/25213>.
    Reported by Christopher Baines <address@hidden>.
    
    * guix/profiles.scm (profile-derivation)[glibc-utf8-locales]: New
    variable.
    [builder]: Use it to set 'LOCPATH'.
---
 guix/profiles.scm |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/guix/profiles.scm b/guix/profiles.scm
index 0b317ef..82d8b33 100644
--- a/guix/profiles.scm
+++ b/guix/profiles.scm
@@ -939,6 +939,10 @@ the monadic procedures listed in HOOKS--such as an Info 
'dir' file, etc."
                           extras)
               (manifest-inputs manifest)))
 
+    (define glibc-utf8-locales                    ;lazy reference
+      (module-ref (resolve-interface '(gnu packages base))
+                  'glibc-utf8-locales))
+
     (define builder
       (with-imported-modules '((guix build profiles)
                                (guix build union)
@@ -953,6 +957,13 @@ the monadic procedures listed in HOOKS--such as an Info 
'dir' file, etc."
             (setvbuf (current-output-port) _IOLBF)
             (setvbuf (current-error-port) _IOLBF)
 
+            ;; Some file names (e.g., in 'nss-certs') are UTF-8 encoded so
+            ;; install a UTF-8 locale.
+            (setenv "LOCPATH"
+                    (string-append #+glibc-utf8-locales "/lib/locale/"
+                                   #+(package-version glibc-utf8-locales)))
+            (setlocale LC_ALL "en_US.utf8")
+
             (define search-paths
               ;; Search paths of MANIFEST's packages, converted back to their
               ;; record form.



reply via email to

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