From 0e6cee21a48294b81a5e57e00602728fe7f7075f Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 6 Jun 2019 16:52:15 +0200 Subject: gnu: glibc-locales: Install symlinks using the normalized codeset. Fixes . Reported by Jack Hill and Giovanni Biscuolo * 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. --- gnu/build/locale.scm | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'gnu/build') diff --git a/gnu/build/locale.scm b/gnu/build/locale.scm index c75a2e9dc5..412759a320 100644 --- a/gnu/build/locale.scm +++ b/gnu/build/locale.scm @@ -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)))))) -- cgit v1.2.3