From 15ec93a7832ae7dde747ccd9bb2bb2776be9f199 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 6 Jun 2019 13:36:51 +0200 Subject: Add (gnu build locale). * gnu/build/locale.scm: New file. * gnu/local.mk (MODULES_NOT_COMPILED): Add it. * gnu/installer/locale.scm (normalize-codeset): Remove. * gnu/system/locale.scm (localedef-command): Remove. (single-locale-directory): Use (gnu build locale). (glibc-supported-locales)[build]: Likewise, and remove 'read-supported-locales'. --- gnu/installer/locale.scm | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'gnu/installer') diff --git a/gnu/installer/locale.scm b/gnu/installer/locale.scm index 2ee5eecd96..13f3a1e881 100644 --- a/gnu/installer/locale.scm +++ b/gnu/installer/locale.scm @@ -19,6 +19,7 @@ (define-module (gnu installer locale) #:use-module (gnu installer utils) + #:use-module ((gnu build locale) #:select (normalize-codeset)) #:use-module (guix records) #:use-module (json) #:use-module (srfi srfi-1) @@ -71,24 +72,6 @@ optionally, CODESET." (codeset . ,(or codeset (match:substring matches 5))) (modifier . ,(match:substring matches 7))))) -(define (normalize-codeset codeset) - "Compute the \"normalized\" variant of CODESET." - ;; info "(libc) Using gettextized software", for the algorithm used to - ;; compute the normalized codeset. - (letrec-syntax ((-> (syntax-rules () - ((_ proc value) - (proc value)) - ((_ proc rest ...) - (proc (-> rest ...)))))) - (-> (lambda (str) - (if (string-every char-set:digit str) - (string-append "iso" str) - str)) - string-downcase - (lambda (str) - (string-filter char-set:letter+digit str)) - codeset))) - (define (locale->locale-string locale) "Reverse operation of locale-string->locale." (let ((language (locale-language locale)) -- cgit v1.2.3