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.
This commit is contained in:
Ludovic Courtès 2015-04-21 22:53:09 +02:00
parent ef593a103d
commit 6162b95d21
2 changed files with 45 additions and 2 deletions

View File

@ -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

View File

@ -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.