#:use-module (gnu packages ncurses)
#:use-module (gnu packages package-management)
#:use-module (gnu packages xorg)
+ #:use-module (gnu system locale)
#:use-module (ice-9 match)
#:use-module (srfi srfi-1)
#:export (installer-program))
(string-append #$file "/" #$name ".go")))
(let* ((supported-locales #~(supported-locales->locales
- #$(local-file "installer/aux-files/SUPPORTED")))
+ #+(glibc-supported-locales)))
(iso-codes #~(string-append #$iso-codes "/share/iso-codes/json/"))
(iso639-3 #~(string-append #$iso-codes "iso_639-3.json"))
(iso639-5 #~(string-append #$iso-codes "iso_639-5.json"))
(define (locale-modifier assoc)
(assoc-ref assoc 'modifier))
-(define (locale-string->locale string)
- "Return the locale association list built from the parsing of STRING."
+(define* (locale-string->locale string #:optional codeset)
+ "Return the locale association list built from the parsing of STRING and,
+optionally, CODESET."
(let ((matches (string-match locale-regexp string)))
`((language . ,(match:substring matches 1))
(territory . ,(match:substring matches 3))
- (codeset . ,(match:substring matches 5))
+ (codeset . ,(or codeset (match:substring matches 5)))
(modifier . ,(match:substring matches 7)))))
(define (normalize-codeset codeset)
'())))))
(define (supported-locales->locales supported-locales)
- "Parse the SUPPORTED-LOCALES file from the glibc and return the matching
-list of LOCALE association lists."
- (call-with-input-file supported-locales
- (lambda (port)
- (let ((lines (read-lines port)))
- (map (lambda (line)
- (match (string-split line #\ )
- ((locale-string codeset)
- (let ((line-locale (locale-string->locale locale-string)))
- (assoc-set! line-locale 'codeset codeset)))))
- lines)))))
+ "Given SUPPORTED-LOCALES, a file produced by 'glibc-supported-locales',
+return a list of locales where each locale is an alist."
+ (map (match-lambda
+ ((locale . codeset)
+ (locale-string->locale locale codeset)))
+ (call-with-input-file supported-locales read)))
\f
;;;
installerdir = $(guilemoduledir)/%D%/installer
dist_installer_DATA = \
- %D%/installer/aux-files/logo.txt \
- %D%/installer/aux-files/SUPPORTED
+ %D%/installer/aux-files/logo.txt
# Modules that do not need to be compiled.
MODULES_NOT_COMPILED += \