mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-11 13:49:23 -05:00
gnu: glibc-utf8-locales: Generalize and use gexps.
Previously code was dependent on the ‘name’ field of the GLIBC package. * gnu/packages/base.scm (make-glibc-utf8-locales): Use gexps. Replace references to ‘%build-inputs’ by calls to ‘which’. Replace reference to ‘version’ by (package-version this-package). Change-Id: I1e7003047aa85df74069b233191ab331b5f887b6
This commit is contained in:
parent
1487b3f53c
commit
61c6d0bdd8
1 changed files with 36 additions and 31 deletions
|
@ -1410,24 +1410,32 @@ (define %default-utf8-locales
|
|||
(define*-public (make-glibc-utf8-locales glibc #:key
|
||||
(locales %default-utf8-locales)
|
||||
(name "glibc-utf8-locales"))
|
||||
(define default-locales? (equal? locales %default-utf8-locales))
|
||||
(define default-locales?
|
||||
(equal? locales %default-utf8-locales))
|
||||
|
||||
(package
|
||||
(name name)
|
||||
(version (package-version glibc))
|
||||
(source #f)
|
||||
(build-system trivial-build-system)
|
||||
(arguments
|
||||
`(#:modules ((guix build utils))
|
||||
#:builder (begin
|
||||
(list #:modules '((guix build utils))
|
||||
#:builder
|
||||
#~(begin
|
||||
(use-modules (guix build utils))
|
||||
|
||||
(let* ((libc (assoc-ref %build-inputs "glibc"))
|
||||
(gzip (assoc-ref %build-inputs "gzip"))
|
||||
(out (assoc-ref %outputs "out"))
|
||||
(let* ((libc (dirname
|
||||
(search-input-file %build-inputs
|
||||
"/bin/localedef")))
|
||||
(gzip (dirname
|
||||
(search-input-file %build-inputs
|
||||
"/bin/gzip")))
|
||||
(out #$output)
|
||||
(localedir (string-append out "/lib/locale/"
|
||||
,(version-major+minor version))))
|
||||
#$(version-major+minor
|
||||
(package-version this-package)))))
|
||||
;; 'localedef' needs 'gzip'.
|
||||
(setenv "PATH" (string-append libc "/bin:" gzip "/bin"))
|
||||
(setenv "PATH" (string-append libc ":" gzip ""))
|
||||
|
||||
(mkdir-p localedir)
|
||||
(for-each (lambda (locale)
|
||||
|
@ -1446,11 +1454,8 @@ (define file
|
|||
(symlink (string-append locale ".utf8")
|
||||
(string-append localedir "/"
|
||||
locale ".UTF-8")))
|
||||
',locales)
|
||||
#t))))
|
||||
(native-inputs
|
||||
`(("glibc" ,glibc)
|
||||
("gzip" ,gzip)))
|
||||
'#$locales)))))
|
||||
(native-inputs (list glibc gzip))
|
||||
(synopsis (if default-locales?
|
||||
(P_ "Small sample of UTF-8 locales")
|
||||
(P_ "Customized sample of UTF-8 locales")))
|
||||
|
|
Loading…
Reference in a new issue