2 # See https://wiki.freebsd.org/LocaleNewApproach
3 # Taken from FreeBSD svn [base]/user/edwin/locale/cldr
8 # Modified by John Marino to suit DragonFly needs
12 CLDRDIR
!= grep ^cldr etc
/unicode.conf | cut
-f
2 -d
" "
14 .if
!defined
(UNIDATADIR
)
15 UNIDATADIR
!= grep ^unidata etc
/unicode.conf | cut
-f
2 -d
" "
17 PASSON
= CLDRDIR
="${CLDRDIR}" UNIDATADIR
="${UNIDATADIR}"
19 ETCDIR
= ${.CURDIR
}/etc
21 KNOWN
= monetdef numericdef msgdef timedef colldef ctypedef
23 LOCALE_DESTDIR?
= /tmp
/generated-locales
/
33 .for area enc in
${COLLATION_SPECIAL}
34 COLLATIONS_SPECIAL_ENV
+= ${area}.
${enc}
36 PASSON
+= COLLATIONS_SPECIAL
="${COLLATIONS_SPECIAL_ENV}"
43 cp
${ETCDIR}/common.UTF-8.src
${CLDRDIR}/posix
/xx_Comm_US.UTF-8.src
46 test -d
${t} || mkdir
${t}
57 rm -rf
${.CURDIR
}/${t}.draft
58 rm -rf
${.CURDIR
}/..
/${t}
59 mv
${.CURDIR
}/${t} ${.CURDIR
}/..
/${t}
66 (cd
${.CURDIR
}/..
/${t} && \
67 ${MAKE} && ${MAKE} install && ${MAKE} clean)
73 mkdir
-p
${t} ${t}.draft
74 perl
-I tools tools
/cldr2def.pl \
75 --cldr
=$$(realpath
${CLDRDIR}) \
76 --unidata
=$$(realpath
${UNIDATADIR}) \
77 --etc
=$$(realpath
${ETCDIR}) \
81 env
${PASSON} tools
/finalize
${t}
84 gen-ctypedef
: transfer-rollup
85 static-colldef
: gen-colldef
86 build-colldef
: static-colldef
89 .for area enc in
${COLLATION_SPECIAL}
90 awk
-f tools
/extract-colldef.awk
${CLDRDIR}/posix
/${area}.
${enc}.src
> colldef
/${area}.
${enc}.src
94 cp
${ETCDIR}/common.UTF-8.src
${CLDRDIR}/posix
/xx_Comm_US.UTF-8.src
97 perl
-I tools tools
/utf8-rollup.pl \
98 --cldr
=$$(realpath
${CLDRDIR}) \
99 --etc
=$$(realpath
${ETCDIR})
103 rm -rf
${t} ${t}.draft
106 BASE_LOCALES_OF_INTEREST?
= \
107 af_ZA am_ET ar_AE ar_BH ar_DZ ar_EG ar_IQ ar_JO ar_KW \
108 ar_LB ar_LY ar_MA ar_OM ar_QA ar_SA ar_TN ar_YE \
109 as_IN be_BY bg_BG bn_BD bo_CN ca_AD ca_ES ca_FR ca_IT \
110 cs_CZ da_DK de_AT de_BE de_CH de_DE de_LI de_LU el_CY el_GR \
111 en_AU en_BW en_BZ en_CA \
112 en_GB en_HK en_IE en_IN en_JM en_MH en_MT en_NA en_NZ en_PH \
113 en_PK en_SG en_TT en_US en_ZA en_ZW \
114 es_AR es_BO es_CL es_CR es_CO es_DO es_EC es_ES es_GQ \
115 es_GT es_HN es_MX es_NI es_PA es_PE es_PR es_PY es_SV \
116 es_US es_UY es_VE et_EE \
118 fr_CA fr_CF fr_CH fr_FR fr_GN fr_LU fr_MC fr_MG fr_ML fr_NE \
119 fr_SN ga_IE he_IL hi_IN hr_HR hu_HU hy_AM id_ID \
120 is_IS it_CH it_IT ja_JP ko_KR kok_IN lt_LT lv_LV mk_MK mr_IN \
121 mt_MT ne_IN ne_NP nb_NO nl_BE nl_NL nn_NO pl_PL \
122 pt_BR pt_GW pt_MZ pt_PT ro_MD ro_RO \
123 ru_MD ru_RU ru_UA se_FI se_NO sk_SK sl_SI sq_AL sv_FI sv_SE \
124 ta_LK tr_TR uk_UA ur_IN ur_PK \
125 az_Latn_AZ bs_Latn_BA kk_Cyrl_KZ mn_Cyrl_MN \
126 ms_Latn_MY sr_Cyrl_RS sr_Latn_BA sr_Latn_ME sr_Latn_RS ug_Arab_CN \
127 zh_Hans_CN zh_Hans_MO zh_Hans_SG zh_Hant_HK zh_Hant_TW \
128 bn_IN gu_IN or_IN ta_IN te_IN kn_IN ml_IN si_LK \
129 th_TH lo_LA bo_IN my_MM pa_Arab_PK pa_Guru_IN ka_GE chr_US \
130 km_KH shi_Tfng_MA ii_CN vai_Vaii_LR vi_VN
144 .if exists
(${CLDRDIR}/tools
/java
/cldr.jar
)
145 mkdir
-p
${CLDRDIR}/posix
146 . for area in
${BASE_LOCALES_OF_INTEREST}
147 . if
!exists
(${CLDRDIR}/posix
/${area}.UTF-8.src
)
148 java
-DCLDR_DIR
=${CLDRDIR
:Q
} -jar
${CLDRDIR}/tools
/java
/cldr.jar \
149 org.unicode.cldr.posix.GeneratePOSIX \
150 -d
${CLDRDIR}/posix
-m
${area} -c UTF-8
153 . for area encoding in
${COLLATION_SPECIAL}
154 . if
!exists
(${CLDRDIR}/posix
/${area}.
${encoding}.src
)
155 java
-DCLDR_DIR
=${CLDRDIR
:Q
} -jar
${CLDRDIR}/tools
/java
/cldr.jar \
156 org.unicode.cldr.posix.GeneratePOSIX \
157 -d
${CLDRDIR}/posix
-m
${area} -c
${encoding}
160 . for enc in
${ENCODINGS}
161 . if
!exists
(${CLDRDIR}/posix
/${enc}.cm
)
162 java
-DCLDR_DIR
=${CLDRDIR
:Q
} -jar
${CLDRDIR}/tools
/java
/cldr.jar \
163 org.unicode.cldr.posix.GenerateCharmap \
164 -d
${CLDRDIR}/posix
-c
${enc}
168 @echo
"Please install CLDR toolset for the desired release"
169 @echo
"It should go at ${CLDRDIR}/tools"
173 rm -f
${CLDRDIR}/posix
/*