1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-04-26 20:20:32 +02:00

gnu: gettext: Replace ncurses input by libtextstyle.

* gnu/packages/gettext.scm (gettext-minimal)
[inputs]: Replace ncurses by libtextstyle.
[arguments]<#:phases>: Refresh phase 'patch-tests.
(libtextstyle): Inherit version and source from gnu-gettext.
[arguments]: Improve style, migrate to G-expressions.

Change-Id: Ic0346983d5c5d26ac0c70fa713f61dfd47433689
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Nicolas Graves
2026-02-23 22:48:29 +01:00
committed by Ludovic Courtès
parent 36127046cd
commit ac87e13e8e

View File

@@ -71,10 +71,7 @@
(inputs
(list libunistring
libxml2
;; TODO: ncurses is only needed for the 'libtextstyle' library.
;; The next version of gettext can use a separate libtextstyle,
;; but for now we include it here in 'gettext-minimal'.
ncurses))
libtextstyle))
(arguments
(list #:configure-flags #~'("--with-included-libunistring=no"
"--with-included-libxml=no")
@@ -93,11 +90,11 @@
(("/bin/pwd") "pwd"))))
(add-before 'check 'patch-tests
(lambda* (#:key inputs #:allow-other-keys)
;;libgettextlib-0.23.so => not found
;;libgettextlib-1.0.so => not found
(substitute* "gettext-tools/gnulib-tests/test-execute.sh"
(("^#!.*" all)
(string-append all "exit 77;\n")))
(let* ((bash (which "sh")))
(let* ((bash (search-input-file inputs "bin/sh")))
;; Some of the files we're patching are
;; ISO-8859-1-encoded, so choose it as the default
;; encoding so the byte encoding is preserved.
@@ -106,7 +103,7 @@
(find-files "gettext-tools/tests"
"^(lang-sh|msg(exec|filter)-[0-9])")
(("#![[:blank:]]/bin/sh")
(format #f "#!~a" bash)))
(string-append "#!" bash)))
(substitute* (cons "gettext-tools/src/msginit.c"
(find-files "gettext-tools/gnulib-tests"
@@ -204,22 +201,17 @@ translated messages from the catalogs. Nearly all GNU packages use Gettext.")
(define-public libtextstyle
(package
(name "libtextstyle")
(version "0.21")
(source (origin
(inherit (package-source gnu-gettext))
(uri (string-append "mirror://gnu/gettext/gettext-"
version ".tar.gz"))
(sha256
(base32
"04kbg1sx0ncfrsbr85ggjslqkzzb243fcw9nyh3rrv1a22ihszf7"))))
(version (package-version gnu-gettext))
(source (package-source gnu-gettext))
(build-system gnu-build-system)
(arguments
'(#:configure-flags '("--disable-static")
#:phases (modify-phases %standard-phases
(add-after 'unpack 'chdir
(lambda _
(chdir "libtextstyle")
#t)))))
(list
#:configure-flags #~(list "--disable-static")
#:phases
#~(modify-phases %standard-phases
(add-after 'unpack 'chdir
(lambda _
(chdir "libtextstyle"))))))
;; libtextstyle bundles libxml2, glib (a small subset thereof), and
;; libcroco, but it purposefully prevents users from using an external
;; copy, to reduce the startup time of programs using libtextstyle.