aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrafan <rafan@FreeBSD.org>2008-04-06 19:58:29 +0800
committerrafan <rafan@FreeBSD.org>2008-04-06 19:58:29 +0800
commita0f651dcb42c826446abe1245112dc9f12b0725a (patch)
treed000468343a7987320f09ad868602650000f2aa5
parent129bf8eef13a80443de96b8712256d8af785c27f (diff)
downloadfreebsd-ports-gnome-a0f651dcb42c826446abe1245112dc9f12b0725a.tar.gz
freebsd-ports-gnome-a0f651dcb42c826446abe1245112dc9f12b0725a.tar.zst
freebsd-ports-gnome-a0f651dcb42c826446abe1245112dc9f12b0725a.zip
- Use correct locale zh_CN.GB2312 instead of invalid locale zh_CN.EUC
- Bump PORTREVISION PR: ports/122091 Submitted by: Yuri <yuri at tsoft.com>
-rw-r--r--chinese/chinput3/Makefile2
-rw-r--r--chinese/chinput3/files/patch-src_Chinput-3.0.2_resource_Chinput.ad13
-rw-r--r--chinese/chinput3/files/patch-src_Chinput-3.0.2_src_init.c32
-rw-r--r--chinese/chinput3/files/pkg-message.in2
4 files changed, 47 insertions, 2 deletions
diff --git a/chinese/chinput3/Makefile b/chinese/chinput3/Makefile
index 0309736f92de..449c46d3f776 100644
--- a/chinese/chinput3/Makefile
+++ b/chinese/chinput3/Makefile
@@ -7,7 +7,7 @@
PORTNAME= chinput
PORTVERSION= 3.0.2.5
-PORTREVISION= 4
+PORTREVISION= 5
CATEGORIES= chinese x11
MASTER_SITES= http://ftp.jaist.ac.jp/pub/FreeBSD/distfiles/ \
http://www.gtlib.gatech.edu/pub/FreeBSD/distfiles/
diff --git a/chinese/chinput3/files/patch-src_Chinput-3.0.2_resource_Chinput.ad b/chinese/chinput3/files/patch-src_Chinput-3.0.2_resource_Chinput.ad
new file mode 100644
index 000000000000..2464e63e2876
--- /dev/null
+++ b/chinese/chinput3/files/patch-src_Chinput-3.0.2_resource_Chinput.ad
@@ -0,0 +1,13 @@
+--- src/Chinput-3.0.2/resource/Chinput.ad.orig 2008-03-25 12:16:09.000000000 -0700
++++ src/Chinput-3.0.2/resource/Chinput.ad 2008-03-25 12:21:36.000000000 -0700
+@@ -2,8 +2,8 @@
+ !It based on chinput
+
+
+-chinput.gblocale = zh_CN.EUC
+-chinput.big5locale = zh_CN.EUC
++chinput.gblocale = zh_CN.GB2312
++chinput.big5locale = zh_CN.GB2312
+
+ !
+ ! input style: AUTO, ROOT, OVERSPOT, ONSPOT, OFFSPOT
diff --git a/chinese/chinput3/files/patch-src_Chinput-3.0.2_src_init.c b/chinese/chinput3/files/patch-src_Chinput-3.0.2_src_init.c
new file mode 100644
index 000000000000..34ad8740ad5b
--- /dev/null
+++ b/chinese/chinput3/files/patch-src_Chinput-3.0.2_src_init.c
@@ -0,0 +1,32 @@
+--- src/Chinput-3.0.2/src/init.c.orig 2008-03-25 11:18:01.000000000 -0700
++++ src/Chinput-3.0.2/src/init.c 2008-03-25 12:23:41.000000000 -0700
+@@ -94,6 +94,13 @@
+ load_font(&font_info, font_latin);
+ }
+
++static int is_locale_supported(char *locale) {
++ char *setlocale_string = setlocale(LC_ALL, locale);
++ int success = (setlocale_string != NULL && strcmp(setlocale_string, locale)==0 && XSupportsLocale());
++ if (!success && locale[0] != 0 && setlocale_string != NULL && setlocale_string[0] != 0) {
++ fprintf(stderr, "Error : requested locale '%s' not supported\n");
++ }
++}
+
+ void HZinitServerGC(void)
+ {
+@@ -103,12 +110,9 @@
+ char fontname[256];
+
+ //create font set
+- if(strcmp(setlocale(LC_ALL, gb18030locale), gb18030locale) ||
+- !XSupportsLocale()){
+- if(strcmp(setlocale(LC_ALL, gbklocale), gbklocale) ||
+- !XSupportsLocale()){
+- if(strcmp(setlocale(LC_ALL, gblocale), gblocale) ||
+- !XSupportsLocale()){
++ if(!is_locale_supported(gb18030locale)){
++ if(!is_locale_supported(gbklocale)){
++ if(!is_locale_supported(gblocale)){
+ fprintf(stderr, "Error : Chinese Locale not supported!\n");
+ exit(1);
+ }
diff --git a/chinese/chinput3/files/pkg-message.in b/chinese/chinput3/files/pkg-message.in
index acc0298d882f..eb3bb5e49bf6 100644
--- a/chinese/chinput3/files/pkg-message.in
+++ b/chinese/chinput3/files/pkg-message.in
@@ -6,5 +6,5 @@ If not exist, copy %%X11BASE%%/lib/X11/locale/zh/XI18N_OBJS to it.
Remember to set environment varible XMODIFIERS:
csh/tcsh: setenv XMODIFIERS @im=Chinput
sh/bash: export XMODIFIERS='@im=Chinput'
-and set LANG, LC_CTYPE to zh_CN.EUC.
+and set LANG, LC_CTYPE to zh_CN.GB2312.
-------------------------------------------------------------------------------