mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2026-04-06 21:20:33 +02:00
gnu: glibc-locales: Install symlinks using the normalized codeset.
Fixes <https://bugs.gnu.org/36076>. Reported by Jack Hill <jackhill@jackhill.us> and Giovanni Biscuolo <g@xelera.eu> * gnu/build/locale.scm (locale->name+codeset): New file. * gnu/packages/base.scm (make-glibc-locales): Add #:modules and #:imported-modules. Add a 'symlink-normalized-codesets' phase.
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
#:use-module (ice-9 regex)
|
||||
#:export (build-locale
|
||||
normalize-codeset
|
||||
locale->name+codeset
|
||||
read-supported-locales))
|
||||
|
||||
(define locale-rx
|
||||
@@ -84,3 +85,11 @@ discarded."
|
||||
(invoke localedef "--no-archive" "--prefix" directory
|
||||
"-i" locale "-f" codeset
|
||||
(string-append directory "/" name)))
|
||||
|
||||
(define (locale->name+codeset locale)
|
||||
"Split a locale name such as \"aa_ER@saaho.UTF-8\" into two values: the
|
||||
language/territory/modifier part, and the codeset."
|
||||
(match (string-rindex locale #\.)
|
||||
(#f (values locale #f))
|
||||
(dot (values (string-take locale dot)
|
||||
(string-drop locale (+ dot 1))))))
|
||||
|
||||
Reference in New Issue
Block a user