gnu: glibc: Look for locale data in versioned sub-directories.

* gnu/packages/base.scm (glibc)[native-search-paths]: Add
  'lib/locale/VERSION' for 'GUIX_LOCPATH'.
  (glibc-locales, glibc-utf8-locales): Write to a VERSION
  sub-directory.
* guix/profiles.scm (ca-certificate-bundle): Adjust LOCPATH value
  accordingly.
This commit is contained in:
Ludovic Courtès 2015-10-03 18:02:30 +02:00
parent fbb909ac7e
commit f2d7bbb537
2 changed files with 10 additions and 5 deletions

View file

@ -620,7 +620,8 @@ (define-public glibc
;; distros.
(list (search-path-specification
(variable "GUIX_LOCPATH")
(files '("lib/locale")))))
(files (list (string-append "lib/locale/" version)
"lib/locale")))))
(synopsis "The GNU C Library")
(description
@ -663,7 +664,8 @@ (define-public glibc-locales
;; Use $(libdir)/locale as is the case by default.
(list (string-append "libc_cv_localedir="
(assoc-ref %outputs "out")
"/lib/locale")))))))))
"/lib/locale/"
,(package-version glibc))))))))))
(define-public glibc-utf8-locales
(package
@ -672,7 +674,7 @@ (define-public glibc-utf8-locales
(source #f)
(build-system trivial-build-system)
(arguments
'(#:modules ((guix build utils))
`(#:modules ((guix build utils))
#:builder (begin
(use-modules (srfi srfi-1)
(guix build utils))
@ -680,7 +682,8 @@ (define-public glibc-utf8-locales
(let* ((libc (assoc-ref %build-inputs "glibc"))
(gzip (assoc-ref %build-inputs "gzip"))
(out (assoc-ref %outputs "out"))
(localedir (string-append out "/lib/locale")))
(localedir (string-append out "/lib/locale/"
,version)))
;; 'localedef' needs 'gzip'.
(setenv "PATH" (string-append libc "/bin:" gzip "/bin"))

View file

@ -573,7 +573,9 @@ (define (dump file port)
;; Some file names in the NSS certificates are UTF-8 encoded so
;; install a UTF-8 locale.
(setenv "LOCPATH" (string-append #+glibc-utf8-locales "/lib/locale"))
(setenv "LOCPATH"
(string-append #+glibc-utf8-locales "/lib/locale/"
#+(package-version glibc-utf8-locales)))
(setlocale LC_ALL "en_US.UTF-8")
(match (append-map ca-files '#$(manifest-inputs manifest))