From 6162b95d21a7b75fe3753c22c7755c5d12a8302f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Tue, 21 Apr 2015 22:53:09 +0200 Subject: [PATCH] gnu: glibc: Add dependency on Gettext, to install the message catalogs. This fixes a bug whereby the libc.mo files were not installed, and thus translations of libc's messages were not available. * gnu/packages/commencement.scm (gettext-boot0): New variable. (glibc-final)[native-inputs]: New field. * gnu/packages/base.scm (glibc)[native-inputs]: Add GNU-GETTEXT. --- gnu/packages/base.scm | 6 +++-- gnu/packages/commencement.scm | 41 +++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 2 deletions(-) diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm index 361436157d..0c2a4a5725 100644 --- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm @@ -568,9 +568,11 @@ store.") (inputs `(("static-bash" ,(static-package bash-light)))) - ;; To build the manual, we need Texinfo and Perl. + ;; To build the manual, we need Texinfo and Perl. Gettext is needed to + ;; install the message catalogs, with 'msgfmt'. (native-inputs `(("texinfo" ,texinfo) - ("perl" ,perl))) + ("perl" ,perl) + ("gettext" ,gnu-gettext))) (native-search-paths ;; Search path for packages that provide locale data. This is useful diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm index 4342dc56d1..9918c21fd1 100644 --- a/gnu/packages/commencement.scm +++ b/gnu/packages/commencement.scm @@ -31,6 +31,7 @@ #:use-module (gnu packages gawk) #:use-module (gnu packages bison) #:use-module (gnu packages guile) + #:use-module (gnu packages gettext) #:use-module (gnu packages multiprecision) #:use-module (gnu packages compression) #:use-module (gnu packages perl) @@ -418,6 +419,42 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%" '("gcc" "libc"))) (current-source-location))))) +(define gettext-boot0 + ;; A minimal gettext used during bootstrap. + (let ((gettext-minimal (package + (inherit gnu-gettext) + (name "gettext-boot0") + (inputs '()) ;zero dependencies + (arguments + (substitute-keyword-arguments + `(#:configure-flags '("--disable-threads") + #:tests? #f + ,@(package-arguments gnu-gettext)) + ((#:phases phases) + `(modify-phases ,phases + ;; Build only the tools. + (add-after 'unpack 'chdir + (lambda _ + (chdir "gettext-tools"))) + + ;; Some test programs require pthreads, + ;; which we don't have. + (add-before 'configure 'no-test-programs + (lambda _ + (substitute* "tests/Makefile.in" + (("^PROGRAMS =.*$") + "PROGRAMS =\n")) + #t)) + + ;; Don't try to link against libexpat. + (delete 'link-expat) + (delete 'patch-tests)))))))) + (package-with-bootstrap-guile + (package-with-explicit-inputs gettext-minimal + %boot1-inputs + (current-source-location) + #:guile %bootstrap-guile)))) + (define-public glibc-final ;; The final glibc, which embeds the statically-linked Bash built above. (package (inherit glibc-final-with-bootstrap-bash) @@ -427,6 +464,10 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%" "static-bash" (package-inputs glibc-final-with-bootstrap-bash)))) + ;; This time we need 'msgfmt' to install all the libc.mo files. + (native-inputs `(,@(package-native-inputs glibc-final-with-bootstrap-bash) + ("gettext" ,gettext-boot0))) + ;; The final libc only refers to itself, but the 'debug' output contains ;; references to GCC-BOOT0 and to the Linux headers. XXX: Would be great ;; if 'allowed-references' were per-output.