gnu: gettext: Set encoding to ISO-8859-1 when modifying files.

* gnu/packages/gettext.scm (gnu-gettext)[arguments] <patch-tests>: Set
  %default-port-encoding.  Fixes test failures at
  <http://hydra.gnu.org/build/262586>.
This commit is contained in:
Ludovic Courtès 2015-02-27 14:37:03 +01:00
parent 50915d2c2e
commit e8c9f0498f
1 changed files with 17 additions and 13 deletions

View File

@ -51,21 +51,25 @@
'check 'patch-tests 'check 'patch-tests
(lambda* (#:key inputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
(let* ((bash (which "sh"))) (let* ((bash (which "sh")))
(substitute* ;; Some of the files we're patching are
(find-files "gettext-tools/tests" ;; ISO-8859-1-encoded, so choose it as the default
"^(lang-sh|msg(exec|filter)-[0-9])") ;; encoding so the byte encoding is preserved.
(("#![[:blank:]]/bin/sh") (with-fluids ((%default-port-encoding #f))
(format #f "#!~a" bash))) (substitute*
(find-files "gettext-tools/tests"
"^(lang-sh|msg(exec|filter)-[0-9])")
(("#![[:blank:]]/bin/sh")
(format #f "#!~a" bash)))
(substitute* (cons "gettext-tools/src/msginit.c" (substitute* (cons "gettext-tools/src/msginit.c"
(find-files "gettext-tools/gnulib-tests" (find-files "gettext-tools/gnulib-tests"
"posix_spawn")) "posix_spawn"))
(("/bin/sh") (("/bin/sh")
bash)) bash))
(substitute* "gettext-tools/src/project-id" (substitute* "gettext-tools/src/project-id"
(("/bin/pwd") (("/bin/pwd")
"pwd")))) "pwd")))))
%standard-phases) %standard-phases)
;; When tests fail, we want to know the details. ;; When tests fail, we want to know the details.