Skip to content
Snippets Groups Projects
Unverified Commit ba488958 authored by Ludovic Courtès's avatar Ludovic Courtès
Browse files

self: Bundle 'glibc-utf8-locales'.

This minimizes the risk of locale-related warnings, at least for those
who use one of the bundled UTF-8 locales.

* guix/self.scm (guix-command)[glibc-utf8-locales]: New variable.
In program body, set GUIX_LOCPATH.
parent 8a973abc
No related branches found
No related tags found
No related merge requests found
...@@ -390,6 +390,10 @@ (define* (guix-command modules ...@@ -390,6 +390,10 @@ (define* (guix-command modules
guile (guile-version (effective-version))) guile (guile-version (effective-version)))
"Return the 'guix' command such that it adds MODULES and DEPENDENCIES in its "Return the 'guix' command such that it adds MODULES and DEPENDENCIES in its
load path." load path."
(define glibc-utf8-locales
(module-ref (resolve-interface '(gnu packages base))
'glibc-utf8-locales))
(define module-directory (define module-directory
;; To minimize the number of 'stat' calls needed to locate a module, ;; To minimize the number of 'stat' calls needed to locate a module,
;; create the union of all the module directories. ;; create the union of all the module directories.
...@@ -410,6 +414,16 @@ (define module-directory ...@@ -410,6 +414,16 @@ (define module-directory
"/site-ccache") "/site-ccache")
%load-compiled-path)) %load-compiled-path))
;; To maximize the chances that locales are set up right
;; out-of-the-box, bundle "common" UTF-8 locales.
(let ((locpath (getenv "GUIX_LOCPATH")))
(setenv "GUIX_LOCPATH"
(string-append (if locpath
(string-append locpath ":")
"")
#$(file-append glibc-utf8-locales
"/lib/locale"))))
(let ((guix-main (module-ref (resolve-interface '(guix ui)) (let ((guix-main (module-ref (resolve-interface '(guix ui))
'guix-main))) 'guix-main)))
#$(if source #$(if source
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment