gnu: base: Add keywords to make-glibc-utf8-locales.

* gnu/packages/base.scm (make-glibc-utf8-locales): Add keyword parameters
locales and name with the old values as default.
[name]: Use name parameter.
[arguments]: Use locales parameter.

Co-authored-by: Efraim Flashner <efraim@flashner.co.il>
Co-authored-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Miguel Ángel Arruga Vivas 2020-11-04 15:48:45 +01:00
parent 106c663dd8
commit 0d3f2716a8
No known key found for this signature in database
GPG key ID: 634C6E8979FABEC2

View file

@ -52,13 +52,16 @@ (define-module (gnu packages base)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages python)
#:use-module (gnu packages gettext)
#:use-module (guix i18n)
#:use-module (guix utils)
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix git-download)
#:use-module (guix build-system gnu)
#:use-module (guix build-system trivial)
#:use-module (ice-9 format)
#:use-module (ice-9 match)
#:use-module (ice-9 optargs)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-26)
#:export (glibc
@ -1106,9 +1109,16 @@ (define (locale-directory? file stat)
,(version-major+minor
(package-version glibc)))))))))))
(define-public (make-glibc-utf8-locales glibc)
(define %default-utf8-locales
;; These are the locales commonly used for tests---e.g., in Guile's i18n
;; tests.
'("de_DE" "el_GR" "en_US" "fr_FR" "tr_TR"))
(define*-public (make-glibc-utf8-locales glibc #:key
(locales %default-utf8-locales)
(name "glibc-utf8-locales"))
(define default-locales? (equal? locales %default-utf8-locales))
(package
(name "glibc-utf8-locales")
(name name)
(version (package-version glibc))
(source #f)
(build-system trivial-build-system)
@ -1142,17 +1152,22 @@ (define file
(symlink (string-append locale ".utf8")
(string-append localedir "/"
locale ".UTF-8")))
;; These are the locales commonly used for
;; tests---e.g., in Guile's i18n tests.
'("de_DE" "el_GR" "en_US" "fr_FR" "tr_TR"))
',locales)
#t))))
(native-inputs `(("glibc" ,glibc)
("gzip" ,gzip)))
(synopsis "Small sample of UTF-8 locales")
(synopsis (if default-locales?
(P_ "Small sample of UTF-8 locales")
(P_ "Customized sample of UTF-8 locales")))
(description
"This package provides a small sample of UTF-8 locales mostly useful in
(if default-locales?
(P_ "This package provides a small sample of UTF-8 locales mostly useful in
test environments.")
(format #f (P_ "This package provides the following UTF-8 locales:
@itemize
~{@item ~a~%~}
@end itemize~%")
locales)))
(home-page (package-home-page glibc))
(license (package-license glibc))))