[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/02: gnu: libc: Look for locale data under /run/current-system/locale/
From: |
Ludovic Courtès |
Subject: |
01/02: gnu: libc: Look for locale data under /run/current-system/locale/X.Y. |
Date: |
Wed, 30 Sep 2015 15:20:47 +0000 |
civodul pushed a commit to branch core-updates
in repository guix.
commit 46bd6edd5af4b4fe1f1d066028a6a84ed17ce96b
Author: Ludovic Courtès <address@hidden>
Date: Wed Sep 30 17:06:40 2015 +0200
gnu: libc: Look for locale data under /run/current-system/locale/X.Y.
* gnu/packages/base.scm (glibc)[arguments]: Append VERSION to
'libc_cv_localedir'.
* gnu/system/locale.scm (localedef-command): Write to the sub-directory
called (package-version libc) in #$output.
(locale-directory): Create said directory.
* doc/guix.texi (Locales): Mention the per-version sub-directory.
---
doc/guix.texi | 7 ++++---
gnu/packages/base.scm | 10 +++++++---
gnu/system/locale.scm | 9 ++++++++-
3 files changed, 19 insertions(+), 7 deletions(-)
diff --git a/doc/guix.texi b/doc/guix.texi
index 6a3765f..68ee451 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -5591,9 +5591,10 @@ list only the locales that are actually used, as in:
@vindex LOCPATH
The compiled locale definitions are available at
address@hidden/run/current-system/locale}, which is the default location where
-the address@hidden looks for locale data. This can be overridden using
-the @code{LOCPATH} environment variable (@pxref{locales-and-locpath,
address@hidden/run/current-system/locale/X.Y}, where @code{X.Y} is the libc
+version, which is the default location where the address@hidden provided
+by Guix looks for locale data. This can be overridden using the
address@hidden environment variable (@pxref{locales-and-locpath,
@code{LOCPATH} and locale packages}).
The @code{locale-definition} form is provided by the @code{(gnu system
diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index a3e3e36..a7d9459 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -509,12 +509,16 @@ store.")
;; Set the default locale path. In practice, $LOCPATH may be
;; defined to point whatever locales users want. However, setuid
;; binaries don't honor $LOCPATH, so they'll instead look into
- ;; $libc_cv_localedir; we choose /run/current-system/locale, with
- ;; the idea that it is going to be populated by the sysadmin.
+ ;; $libc_cv_localedir; we choose /run/current-system/locale/X.Y,
+ ;; with the idea that it is going to be populated by the sysadmin.
+ ;; The "X.Y" sub-directory is because locale data formats are
+ ;; incompatible across libc versions; see
+ ;;
<https://lists.gnu.org/archive/html/guix-devel/2015-08/msg00737.html>.
;;
;; `--localedir' is not honored, so work around it.
;; See <http://sourceware.org/ml/libc-alpha/2013-03/msg00093.html>.
- (string-append "libc_cv_localedir=/run/current-system/locale")
+ (string-append "libc_cv_localedir=/run/current-system/locale/"
+ ,version)
(string-append "--with-headers="
(assoc-ref %build-inputs "linux-headers")
diff --git a/gnu/system/locale.scm b/gnu/system/locale.scm
index 393dd42..010fb45 100644
--- a/gnu/system/locale.scm
+++ b/gnu/system/locale.scm
@@ -19,6 +19,7 @@
(define-module (gnu system locale)
#:use-module (guix gexp)
#:use-module (guix records)
+ #:use-module (guix packages)
#:use-module (gnu packages base)
#:use-module (gnu packages compression)
#:use-module (srfi srfi-26)
@@ -57,14 +58,20 @@
"-i" #$(locale-definition-source locale)
"-f" #$(locale-definition-charset locale)
(string-append #$output "/"
+ #$(package-version libc) "/"
#$(locale-definition-name locale))))))
(define* (locale-directory locales
#:key (libc (canonical-package glibc)))
- "Return a directory containing all of LOCALES compiled."
+ "Return a directory containing all of LOCALES for LIBC compiled.
+
+Because locale data formats are incompatible when switching from one libc to
+another, locale data is put in a sub-directory named after the 'version' field
+of LIBC."
(define build
#~(begin
(mkdir #$output)
+ (mkdir (string-append #$output "/" #$(package-version libc)))
;; 'localedef' executes 'gzip' to access compressed locale sources.
(setenv "PATH" (string-append #$gzip "/bin"))