From 7f614e49e877cbf3e909ed74b3e6822dc39eabe5 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 5 Mar 2013 18:38:05 +0100 Subject: gnu: glibc: Install locale data. * gnu/packages/base.scm (glibc): Add `outputs' field. Pass `--localedir' and set `libc_cv_localedir'. Add `install-locales' phase. --- gnu/packages/base.scm | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'gnu/packages/base.scm') diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm index 5aeb050863..537bd5af6d 100644 --- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm @@ -508,13 +508,28 @@ (define-public glibc ;; users should automatically pull Linux headers as well. (propagated-inputs `(("linux-headers" ,linux-libre-headers))) + ;; Store the locales separately (~100 MiB). Note that "out" retains a + ;; reference to them anyway, so there's no space savings here. + ;; TODO: Eventually we may want to add a $LOCALE_ARCHIVE search path like + ;; Nixpkgs does. + (outputs '("out" "locales")) + (arguments `(#:out-of-source? #t #:patches (list (assoc-ref %build-inputs "patch/ld.so.cache")) #:configure-flags (list "--enable-add-ons" "--sysconfdir=/etc" - "--localedir=/var/run/current-system/sw/lib/locale" ; XXX + (string-append "--localedir=" (assoc-ref %outputs "locales") + "/share/locale") + + ;; `--localedir' is not honored, so work around it. + ;; See . + (string-append "libc_cv_localedir=" + (assoc-ref %outputs "locales") + "/share/locale") + + (string-append "--with-headers=" (assoc-ref %build-inputs "linux-headers") "/include") @@ -580,7 +595,12 @@ (define-public glibc (substitute* "libio/iopopen.c" (("/bin/sh") (string-append out "/bin/bash"))))) - %standard-phases))) + (alist-cons-after + 'install 'install-locales + (lambda _ + (zero? (system* "make" "localedata/install-locales"))) + %standard-phases)))) + (inputs `(("patch/ld.so.cache" ,(search-patch "glibc-no-ld-so-cache.patch")) ("static-bash" ,(static-package bash-light)))) -- cgit v1.2.3