diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2019-06-06 13:36:51 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2019-06-07 21:50:18 +0200 |
| commit | 15ec93a7832ae7dde747ccd9bb2bb2776be9f199 (patch) | |
| tree | c6b97d333950ec8ad734624244586cb60ca7e47d /gnu/installer/locale.scm | |
| parent | bc48088b14a4513044f87ce656db6945311c40d6 (diff) | |
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'.
Diffstat (limited to 'gnu/installer/locale.scm')
| -rw-r--r-- | gnu/installer/locale.scm | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/gnu/installer/locale.scm b/gnu/installer/locale.scm index 2ee5eecd96f..13f3a1e881c 100644 --- a/gnu/installer/locale.scm +++ b/gnu/installer/locale.scm | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | 19 | ||
| 20 | (define-module (gnu installer locale) | 20 | (define-module (gnu installer locale) |
| 21 | #:use-module (gnu installer utils) | 21 | #:use-module (gnu installer utils) |
| 22 | #:use-module ((gnu build locale) #:select (normalize-codeset)) | ||
| 22 | #:use-module (guix records) | 23 | #:use-module (guix records) |
| 23 | #:use-module (json) | 24 | #:use-module (json) |
| 24 | #:use-module (srfi srfi-1) | 25 | #:use-module (srfi srfi-1) |
| @@ -71,24 +72,6 @@ optionally, CODESET." | |||
| 71 | (codeset . ,(or codeset (match:substring matches 5))) | 72 | (codeset . ,(or codeset (match:substring matches 5))) |
| 72 | (modifier . ,(match:substring matches 7))))) | 73 | (modifier . ,(match:substring matches 7))))) |
| 73 | 74 | ||
| 74 | (define (normalize-codeset codeset) | ||
| 75 | "Compute the \"normalized\" variant of CODESET." | ||
| 76 | ;; info "(libc) Using gettextized software", for the algorithm used to | ||
| 77 | ;; compute the normalized codeset. | ||
| 78 | (letrec-syntax ((-> (syntax-rules () | ||
| 79 | ((_ proc value) | ||
| 80 | (proc value)) | ||
| 81 | ((_ proc rest ...) | ||
| 82 | (proc (-> rest ...)))))) | ||
| 83 | (-> (lambda (str) | ||
| 84 | (if (string-every char-set:digit str) | ||
| 85 | (string-append "iso" str) | ||
| 86 | str)) | ||
| 87 | string-downcase | ||
| 88 | (lambda (str) | ||
| 89 | (string-filter char-set:letter+digit str)) | ||
| 90 | codeset))) | ||
| 91 | |||
| 92 | (define (locale->locale-string locale) | 75 | (define (locale->locale-string locale) |
| 93 | "Reverse operation of locale-string->locale." | 76 | "Reverse operation of locale-string->locale." |
| 94 | (let ((language (locale-language locale)) | 77 | (let ((language (locale-language locale)) |
