summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-05-13 23:30:51 +0200
committerLudovic Courtès <ludo@gnu.org>2019-05-13 23:46:08 +0200
commit76269f6bc4200ef79aa80a8a6160ae269c2a36c9 (patch)
treeadea56c977be7aec00a919440234932a3ad34110
parent1be065c4784805e7a7b4c3f08970d8e4043b0a60 (diff)
installer: Use 'glibc-supported-locales'.
The list of locales supported by glibc is now built from source. * gnu/installer/locale.scm (locale-string->locale): Add optional 'codeset' parameter and honor it. (supported-locales->locales): Rewrite to 'read' from SUPPORTED-LOCALES. * gnu/installer.scm (compute-locale-step): Pass the result of 'glibc-supported-locales' instead of the "aux-files/SUPPORTED" file. * gnu/installer/aux-files/SUPPORTED: Remove. * gnu/local.mk (dist_installer_DATA): Remove it.
-rw-r--r--gnu/installer.scm3
-rw-r--r--gnu/installer/aux-files/SUPPORTED484
-rw-r--r--gnu/installer/locale.scm24
-rw-r--r--gnu/local.mk3
4 files changed, 13 insertions, 501 deletions
diff --git a/gnu/installer.scm b/gnu/installer.scm
index fe2841397ec..3dd76707bfb 100644
--- a/gnu/installer.scm
+++ b/gnu/installer.scm
@@ -39,6 +39,7 @@
39 #:use-module (gnu packages ncurses) 39 #:use-module (gnu packages ncurses)
40 #:use-module (gnu packages package-management) 40 #:use-module (gnu packages package-management)
41 #:use-module (gnu packages xorg) 41 #:use-module (gnu packages xorg)
42 #:use-module (gnu system locale)
42 #:use-module (ice-9 match) 43 #:use-module (ice-9 match)
43 #:use-module (srfi srfi-1) 44 #:use-module (srfi srfi-1)
44 #:export (installer-program)) 45 #:export (installer-program))
@@ -118,7 +119,7 @@ been performed at build time."
118 (string-append #$file "/" #$name ".go"))) 119 (string-append #$file "/" #$name ".go")))
119 120
120 (let* ((supported-locales #~(supported-locales->locales 121 (let* ((supported-locales #~(supported-locales->locales
121 #$(local-file "installer/aux-files/SUPPORTED"))) 122 #+(glibc-supported-locales)))
122 (iso-codes #~(string-append #$iso-codes "/share/iso-codes/json/")) 123 (iso-codes #~(string-append #$iso-codes "/share/iso-codes/json/"))
123 (iso639-3 #~(string-append #$iso-codes "iso_639-3.json")) 124 (iso639-3 #~(string-append #$iso-codes "iso_639-3.json"))
124 (iso639-5 #~(string-append #$iso-codes "iso_639-5.json")) 125 (iso639-5 #~(string-append #$iso-codes "iso_639-5.json"))
diff --git a/gnu/installer/aux-files/SUPPORTED b/gnu/installer/aux-files/SUPPORTED
deleted file mode 100644
index 24aae1e089f..00000000000
--- a/gnu/installer/aux-files/SUPPORTED
+++ /dev/null
@@ -1,484 +0,0 @@
1aa_DJ.UTF-8 UTF-8
2aa_DJ ISO-8859-1
3aa_ER UTF-8
4aa_ER@saaho UTF-8
5aa_ET UTF-8
6af_ZA.UTF-8 UTF-8
7af_ZA ISO-8859-1
8agr_PE UTF-8
9ak_GH UTF-8
10am_ET UTF-8
11an_ES.UTF-8 UTF-8
12an_ES ISO-8859-15
13anp_IN UTF-8
14ar_AE.UTF-8 UTF-8
15ar_AE ISO-8859-6
16ar_BH.UTF-8 UTF-8
17ar_BH ISO-8859-6
18ar_DZ.UTF-8 UTF-8
19ar_DZ ISO-8859-6
20ar_EG.UTF-8 UTF-8
21ar_EG ISO-8859-6
22ar_IN UTF-8
23ar_IQ.UTF-8 UTF-8
24ar_IQ ISO-8859-6
25ar_JO.UTF-8 UTF-8
26ar_JO ISO-8859-6
27ar_KW.UTF-8 UTF-8
28ar_KW ISO-8859-6
29ar_LB.UTF-8 UTF-8
30ar_LB ISO-8859-6
31ar_LY.UTF-8 UTF-8
32ar_LY ISO-8859-6
33ar_MA.UTF-8 UTF-8
34ar_MA ISO-8859-6
35ar_OM.UTF-8 UTF-8
36ar_OM ISO-8859-6
37ar_QA.UTF-8 UTF-8
38ar_QA ISO-8859-6
39ar_SA.UTF-8 UTF-8
40ar_SA ISO-8859-6
41ar_SD.UTF-8 UTF-8
42ar_SD ISO-8859-6
43ar_SS UTF-8
44ar_SY.UTF-8 UTF-8
45ar_SY ISO-8859-6
46ar_TN.UTF-8 UTF-8
47ar_TN ISO-8859-6
48ar_YE.UTF-8 UTF-8
49ar_YE ISO-8859-6
50ayc_PE UTF-8
51az_AZ UTF-8
52az_IR UTF-8
53as_IN UTF-8
54ast_ES.UTF-8 UTF-8
55ast_ES ISO-8859-15
56be_BY.UTF-8 UTF-8
57be_BY CP1251
58be_BY@latin UTF-8
59bem_ZM UTF-8
60ber_DZ UTF-8
61ber_MA UTF-8
62bg_BG.UTF-8 UTF-8
63bg_BG CP1251
64bhb_IN.UTF-8 UTF-8
65bho_IN UTF-8
66bho_NP UTF-8
67bi_VU UTF-8
68bn_BD UTF-8
69bn_IN UTF-8
70bo_CN UTF-8
71bo_IN UTF-8
72br_FR.UTF-8 UTF-8
73br_FR ISO-8859-1
74br_FR@euro ISO-8859-15
75brx_IN UTF-8
76bs_BA.UTF-8 UTF-8
77bs_BA ISO-8859-2
78byn_ER UTF-8
79ca_AD.UTF-8 UTF-8
80ca_AD ISO-8859-15
81ca_ES.UTF-8 UTF-8
82ca_ES ISO-8859-1
83ca_ES@euro ISO-8859-15
84ca_ES@valencia UTF-8
85ca_FR.UTF-8 UTF-8
86ca_FR ISO-8859-15
87ca_IT.UTF-8 UTF-8
88ca_IT ISO-8859-15
89ce_RU UTF-8
90chr_US UTF-8
91cmn_TW UTF-8
92crh_UA UTF-8
93cs_CZ.UTF-8 UTF-8
94cs_CZ ISO-8859-2
95csb_PL UTF-8
96cv_RU UTF-8
97cy_GB.UTF-8 UTF-8
98cy_GB ISO-8859-14
99da_DK.UTF-8 UTF-8
100da_DK ISO-8859-1
101de_AT.UTF-8 UTF-8
102de_AT ISO-8859-1
103de_AT@euro ISO-8859-15
104de_BE.UTF-8 UTF-8
105de_BE ISO-8859-1
106de_BE@euro ISO-8859-15
107de_CH.UTF-8 UTF-8
108de_CH ISO-8859-1
109de_DE.UTF-8 UTF-8
110de_DE ISO-8859-1
111de_DE@euro ISO-8859-15
112de_IT.UTF-8 UTF-8
113de_IT ISO-8859-1
114de_LI.UTF-8 UTF-8
115de_LU.UTF-8 UTF-8
116de_LU ISO-8859-1
117de_LU@euro ISO-8859-15
118doi_IN UTF-8
119dv_MV UTF-8
120dz_BT UTF-8
121el_GR.UTF-8 UTF-8
122el_GR ISO-8859-7
123el_GR@euro ISO-8859-7
124el_CY.UTF-8 UTF-8
125el_CY ISO-8859-7
126en_AG UTF-8
127en_AU.UTF-8 UTF-8
128en_AU ISO-8859-1
129en_BW.UTF-8 UTF-8
130en_BW ISO-8859-1
131en_CA.UTF-8 UTF-8
132en_CA ISO-8859-1
133en_DK.UTF-8 UTF-8
134en_DK ISO-8859-1
135en_GB.UTF-8 UTF-8
136en_GB ISO-8859-1
137en_HK.UTF-8 UTF-8
138en_HK ISO-8859-1
139en_IE.UTF-8 UTF-8
140en_IE ISO-8859-1
141en_IE@euro ISO-8859-15
142en_IL UTF-8
143en_IN UTF-8
144en_NG UTF-8
145en_NZ.UTF-8 UTF-8
146en_NZ ISO-8859-1
147en_PH.UTF-8 UTF-8
148en_PH ISO-8859-1
149en_SC.UTF-8 UTF-8
150en_SG.UTF-8 UTF-8
151en_SG ISO-8859-1
152en_US.UTF-8 UTF-8
153en_US ISO-8859-1
154en_ZA.UTF-8 UTF-8
155en_ZA ISO-8859-1
156en_ZM UTF-8
157en_ZW.UTF-8 UTF-8
158en_ZW ISO-8859-1
159eo UTF-8
160es_AR.UTF-8 UTF-8
161es_AR ISO-8859-1
162es_BO.UTF-8 UTF-8
163es_BO ISO-8859-1
164es_CL.UTF-8 UTF-8
165es_CL ISO-8859-1
166es_CO.UTF-8 UTF-8
167es_CO ISO-8859-1
168es_CR.UTF-8 UTF-8
169es_CR ISO-8859-1
170es_CU UTF-8
171es_DO.UTF-8 UTF-8
172es_DO ISO-8859-1
173es_EC.UTF-8 UTF-8
174es_EC ISO-8859-1
175es_ES.UTF-8 UTF-8
176es_ES ISO-8859-1
177es_ES@euro ISO-8859-15
178es_GT.UTF-8 UTF-8
179es_GT ISO-8859-1
180es_HN.UTF-8 UTF-8
181es_HN ISO-8859-1
182es_MX.UTF-8 UTF-8
183es_MX ISO-8859-1
184es_NI.UTF-8 UTF-8
185es_NI ISO-8859-1
186es_PA.UTF-8 UTF-8
187es_PA ISO-8859-1
188es_PE.UTF-8 UTF-8
189es_PE ISO-8859-1
190es_PR.UTF-8 UTF-8
191es_PR ISO-8859-1
192es_PY.UTF-8 UTF-8
193es_PY ISO-8859-1
194es_SV.UTF-8 UTF-8
195es_SV ISO-8859-1
196es_US.UTF-8 UTF-8
197es_US ISO-8859-1
198es_UY.UTF-8 UTF-8
199es_UY ISO-8859-1
200es_VE.UTF-8 UTF-8
201es_VE ISO-8859-1
202et_EE.UTF-8 UTF-8
203et_EE ISO-8859-1
204et_EE.ISO-8859-15 ISO-8859-15
205eu_ES.UTF-8 UTF-8
206eu_ES ISO-8859-1
207eu_ES@euro ISO-8859-15
208fa_IR UTF-8
209ff_SN UTF-8
210fi_FI.UTF-8 UTF-8
211fi_FI ISO-8859-1
212fi_FI@euro ISO-8859-15
213fil_PH UTF-8
214fo_FO.UTF-8 UTF-8
215fo_FO ISO-8859-1
216fr_BE.UTF-8 UTF-8
217fr_BE ISO-8859-1
218fr_BE@euro ISO-8859-15
219fr_CA.UTF-8 UTF-8
220fr_CA ISO-8859-1
221fr_CH.UTF-8 UTF-8
222fr_CH ISO-8859-1
223fr_FR.UTF-8 UTF-8
224fr_FR ISO-8859-1
225fr_FR@euro ISO-8859-15
226fr_LU.UTF-8 UTF-8
227fr_LU ISO-8859-1
228fr_LU@euro ISO-8859-15
229fur_IT UTF-8
230fy_NL UTF-8
231fy_DE UTF-8
232ga_IE.UTF-8 UTF-8
233ga_IE ISO-8859-1
234ga_IE@euro ISO-8859-15
235gd_GB.UTF-8 UTF-8
236gd_GB ISO-8859-15
237gez_ER UTF-8
238gez_ER@abegede UTF-8
239gez_ET UTF-8
240gez_ET@abegede UTF-8
241gl_ES.UTF-8 UTF-8
242gl_ES ISO-8859-1
243gl_ES@euro ISO-8859-15
244gu_IN UTF-8
245gv_GB.UTF-8 UTF-8
246gv_GB ISO-8859-1
247ha_NG UTF-8
248hak_TW UTF-8
249he_IL.UTF-8 UTF-8
250he_IL ISO-8859-8
251hi_IN UTF-8
252hif_FJ UTF-8
253hne_IN UTF-8
254hr_HR.UTF-8 UTF-8
255hr_HR ISO-8859-2
256hsb_DE ISO-8859-2
257hsb_DE.UTF-8 UTF-8
258ht_HT UTF-8
259hu_HU.UTF-8 UTF-8
260hu_HU ISO-8859-2
261hy_AM UTF-8
262hy_AM.ARMSCII-8 ARMSCII-8
263ia_FR UTF-8
264id_ID.UTF-8 UTF-8
265id_ID ISO-8859-1
266ig_NG UTF-8
267ik_CA UTF-8
268is_IS.UTF-8 UTF-8
269is_IS ISO-8859-1
270it_CH.UTF-8 UTF-8
271it_CH ISO-8859-1
272it_IT.UTF-8 UTF-8
273it_IT ISO-8859-1
274it_IT@euro ISO-8859-15
275iu_CA UTF-8
276ja_JP.EUC-JP EUC-JP
277ja_JP.UTF-8 UTF-8
278ka_GE.UTF-8 UTF-8
279ka_GE GEORGIAN-PS
280kab_DZ UTF-8
281kk_KZ.UTF-8 UTF-8
282kk_KZ PT154
283kl_GL.UTF-8 UTF-8
284kl_GL ISO-8859-1
285km_KH UTF-8
286kn_IN UTF-8
287ko_KR.EUC-KR EUC-KR
288ko_KR.UTF-8 UTF-8
289kok_IN UTF-8
290ks_IN UTF-8
291ks_IN@devanagari UTF-8
292ku_TR.UTF-8 UTF-8
293ku_TR ISO-8859-9
294kw_GB.UTF-8 UTF-8
295kw_GB ISO-8859-1
296ky_KG UTF-8
297lb_LU UTF-8
298lg_UG.UTF-8 UTF-8
299lg_UG ISO-8859-10
300li_BE UTF-8
301li_NL UTF-8
302lij_IT UTF-8
303ln_CD UTF-8
304lo_LA UTF-8
305lt_LT.UTF-8 UTF-8
306lt_LT ISO-8859-13
307lv_LV.UTF-8 UTF-8
308lv_LV ISO-8859-13
309lzh_TW UTF-8
310mag_IN UTF-8
311mai_IN UTF-8
312mai_NP UTF-8
313mfe_MU UTF-8
314mg_MG.UTF-8 UTF-8
315mg_MG ISO-8859-15
316mhr_RU UTF-8
317mi_NZ.UTF-8 UTF-8
318mi_NZ ISO-8859-13
319miq_NI UTF-8
320mjw_IN UTF-8
321mk_MK.UTF-8 UTF-8
322mk_MK ISO-8859-5
323ml_IN UTF-8
324mn_MN UTF-8
325mni_IN UTF-8
326mr_IN UTF-8
327ms_MY.UTF-8 UTF-8
328ms_MY ISO-8859-1
329mt_MT.UTF-8 UTF-8
330mt_MT ISO-8859-3
331my_MM UTF-8
332nan_TW UTF-8
333nan_TW@latin UTF-8
334nb_NO.UTF-8 UTF-8
335nb_NO ISO-8859-1
336nds_DE UTF-8
337nds_NL UTF-8
338ne_NP UTF-8
339nhn_MX UTF-8
340niu_NU UTF-8
341niu_NZ UTF-8
342nl_AW UTF-8
343nl_BE.UTF-8 UTF-8
344nl_BE ISO-8859-1
345nl_BE@euro ISO-8859-15
346nl_NL.UTF-8 UTF-8
347nl_NL ISO-8859-1
348nl_NL@euro ISO-8859-15
349nn_NO.UTF-8 UTF-8
350nn_NO ISO-8859-1
351nr_ZA UTF-8
352nso_ZA UTF-8
353oc_FR.UTF-8 UTF-8
354oc_FR ISO-8859-1
355om_ET UTF-8
356om_KE.UTF-8 UTF-8
357om_KE ISO-8859-1
358or_IN UTF-8
359os_RU UTF-8
360pa_IN UTF-8
361pa_PK UTF-8
362pap_AW UTF-8
363pap_CW UTF-8
364pl_PL.UTF-8 UTF-8
365pl_PL ISO-8859-2
366ps_AF UTF-8
367pt_BR.UTF-8 UTF-8
368pt_BR ISO-8859-1
369pt_PT.UTF-8 UTF-8
370pt_PT ISO-8859-1
371pt_PT@euro ISO-8859-15
372quz_PE UTF-8
373raj_IN UTF-8
374ro_RO.UTF-8 UTF-8
375ro_RO ISO-8859-2
376ru_RU.KOI8-R KOI8-R
377ru_RU.UTF-8 UTF-8
378ru_RU ISO-8859-5
379ru_UA.UTF-8 UTF-8
380ru_UA KOI8-U
381rw_RW UTF-8
382sa_IN UTF-8
383sat_IN UTF-8
384sc_IT UTF-8
385sd_IN UTF-8
386sd_IN@devanagari UTF-8
387se_NO UTF-8
388sgs_LT UTF-8
389shn_MM UTF-8
390shs_CA UTF-8
391si_LK UTF-8
392sid_ET UTF-8
393sk_SK.UTF-8 UTF-8
394sk_SK ISO-8859-2
395sl_SI.UTF-8 UTF-8
396sl_SI ISO-8859-2
397sm_WS UTF-8
398so_DJ.UTF-8 UTF-8
399so_DJ ISO-8859-1
400so_ET UTF-8
401so_KE.UTF-8 UTF-8
402so_KE ISO-8859-1
403so_SO.UTF-8 UTF-8
404so_SO ISO-8859-1
405sq_AL.UTF-8 UTF-8
406sq_AL ISO-8859-1
407sq_MK UTF-8
408sr_ME UTF-8
409sr_RS UTF-8
410sr_RS@latin UTF-8
411ss_ZA UTF-8
412st_ZA.UTF-8 UTF-8
413st_ZA ISO-8859-1
414sv_FI.UTF-8 UTF-8
415sv_FI ISO-8859-1
416sv_FI@euro ISO-8859-15
417sv_SE.UTF-8 UTF-8
418sv_SE ISO-8859-1
419sw_KE UTF-8
420sw_TZ UTF-8
421szl_PL UTF-8
422ta_IN UTF-8
423ta_LK UTF-8
424tcy_IN.UTF-8 UTF-8
425te_IN UTF-8
426tg_TJ.UTF-8 UTF-8
427tg_TJ KOI8-T
428th_TH.UTF-8 UTF-8
429th_TH TIS-620
430the_NP UTF-8
431ti_ER UTF-8
432ti_ET UTF-8
433tig_ER UTF-8
434tk_TM UTF-8
435tl_PH.UTF-8 UTF-8
436tl_PH ISO-8859-1
437tn_ZA UTF-8
438to_TO UTF-8
439tpi_PG UTF-8
440tr_CY.UTF-8 UTF-8
441tr_CY ISO-8859-9
442tr_TR.UTF-8 UTF-8
443tr_TR ISO-8859-9
444ts_ZA UTF-8
445tt_RU UTF-8
446tt_RU@iqtelif UTF-8
447ug_CN UTF-8
448uk_UA.UTF-8 UTF-8
449uk_UA KOI8-U
450unm_US UTF-8
451ur_IN UTF-8
452ur_PK UTF-8
453uz_UZ.UTF-8 UTF-8
454uz_UZ ISO-8859-1
455uz_UZ@cyrillic UTF-8
456ve_ZA UTF-8
457vi_VN UTF-8
458wa_BE ISO-8859-1
459wa_BE@euro ISO-8859-15
460wa_BE.UTF-8 UTF-8
461wae_CH UTF-8
462wal_ET UTF-8
463wo_SN UTF-8
464xh_ZA.UTF-8 UTF-8
465xh_ZA ISO-8859-1
466yi_US.UTF-8 UTF-8
467yi_US CP1255
468yo_NG UTF-8
469yue_HK UTF-8
470yuw_PG UTF-8
471zh_CN.GB18030 GB18030
472zh_CN.GBK GBK
473zh_CN.UTF-8 UTF-8
474zh_CN GB2312
475zh_HK.UTF-8 UTF-8
476zh_HK BIG5-HKSCS
477zh_SG.UTF-8 UTF-8
478zh_SG.GBK GBK
479zh_SG GB2312
480zh_TW.EUC-TW EUC-TW
481zh_TW.UTF-8 UTF-8
482zh_TW BIG5
483zu_ZA.UTF-8 UTF-8
484zu_ZA ISO-8859-1
diff --git a/gnu/installer/locale.scm b/gnu/installer/locale.scm
index 284062a6e7c..2ee5eecd96f 100644
--- a/gnu/installer/locale.scm
+++ b/gnu/installer/locale.scm
@@ -62,12 +62,13 @@
62(define (locale-modifier assoc) 62(define (locale-modifier assoc)
63 (assoc-ref assoc 'modifier)) 63 (assoc-ref assoc 'modifier))
64 64
65(define (locale-string->locale string) 65(define* (locale-string->locale string #:optional codeset)
66 "Return the locale association list built from the parsing of STRING." 66 "Return the locale association list built from the parsing of STRING and,
67optionally, CODESET."
67 (let ((matches (string-match locale-regexp string))) 68 (let ((matches (string-match locale-regexp string)))
68 `((language . ,(match:substring matches 1)) 69 `((language . ,(match:substring matches 1))
69 (territory . ,(match:substring matches 3)) 70 (territory . ,(match:substring matches 3))
70 (codeset . ,(match:substring matches 5)) 71 (codeset . ,(or codeset (match:substring matches 5)))
71 (modifier . ,(match:substring matches 7))))) 72 (modifier . ,(match:substring matches 7)))))
72 73
73(define (normalize-codeset codeset) 74(define (normalize-codeset codeset)
@@ -107,17 +108,12 @@
107 '()))))) 108 '())))))
108 109
109(define (supported-locales->locales supported-locales) 110(define (supported-locales->locales supported-locales)
110 "Parse the SUPPORTED-LOCALES file from the glibc and return the matching 111 "Given SUPPORTED-LOCALES, a file produced by 'glibc-supported-locales',
111list of LOCALE association lists." 112return a list of locales where each locale is an alist."
112 (call-with-input-file supported-locales 113 (map (match-lambda
113 (lambda (port) 114 ((locale . codeset)
114 (let ((lines (read-lines port))) 115 (locale-string->locale locale codeset)))
115 (map (lambda (line) 116 (call-with-input-file supported-locales read)))
116 (match (string-split line #\ )
117 ((locale-string codeset)
118 (let ((line-locale (locale-string->locale locale-string)))
119 (assoc-set! line-locale 'codeset codeset)))))
120 lines)))))
121 117
122 118
123;;; 119;;;
diff --git a/gnu/local.mk b/gnu/local.mk
index 133293aad32..1b0298ec6f8 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -629,8 +629,7 @@ endif
629 629
630installerdir = $(guilemoduledir)/%D%/installer 630installerdir = $(guilemoduledir)/%D%/installer
631dist_installer_DATA = \ 631dist_installer_DATA = \
632 %D%/installer/aux-files/logo.txt \ 632 %D%/installer/aux-files/logo.txt
633 %D%/installer/aux-files/SUPPORTED
634 633
635# Modules that do not need to be compiled. 634# Modules that do not need to be compiled.
636MODULES_NOT_COMPILED += \ 635MODULES_NOT_COMPILED += \