summaryrefslogtreecommitdiff
path: root/chinese/kon2
diff options
context:
space:
mode:
authorVanilla I. Shu <vanilla@FreeBSD.org>2005-05-01 00:42:58 +0000
committerVanilla I. Shu <vanilla@FreeBSD.org>2005-05-01 00:42:58 +0000
commite244b1d6cecb6584cf815eedaecfebdf752962a0 (patch)
treea818e6668b75cc1211515a0fada8e8923569b2d4 /chinese/kon2
parentUpgrade to 1.3.3 which fixes IP spoofing and cross site scripting (diff)
add gb2312 font support.
PR: ports/80482 Submitted by: maintainer
Notes
Notes: svn path=/head/; revision=134423
Diffstat (limited to 'chinese/kon2')
-rw-r--r--chinese/kon2/Makefile23
-rw-r--r--chinese/kon2/files/patch-kon.cfg.FreeBSD34
-rw-r--r--chinese/kon2/files/patch-lib::coding.c43
3 files changed, 71 insertions, 29 deletions
diff --git a/chinese/kon2/Makefile b/chinese/kon2/Makefile
index fa63ed557b6f..04ed0775b81e 100644
--- a/chinese/kon2/Makefile
+++ b/chinese/kon2/Makefile
@@ -8,32 +8,27 @@
PORTREVISION= 1
MASTERDIR= ${.CURDIR}/../../japanese/kon2-16dot
-EXTRA_PATCHES= ${.CURDIR}/files/patch-lib::coding.c
CATEGORIES= chinese
MAINTAINER= statue@freebsd.netlab.cse.yzu.edu.tw
-BUILD_DEPENDS+= ${NONEXISTENT}:${PORTSDIR}/chinese/kcfonts:patch
+BUILD_DEPENDS+= ${NONEXISTENT}:${PORTSDIR}/chinese/kcfonts:patch \
+ ${NONEXISTENT}:${PORTSDIR}/x11-fonts/xorg-fonts-miscbitmaps:extract
USE_REINPLACE= yes
KCFONTS_WRKSRC= `cd ${PORTSDIR}/chinese/kcfonts; make -V WRKSRC`
+GB16ST_WRKSRC= `cd ${PORTSDIR}/x11-fonts/xorg-fonts-miscbitmaps; make -V WRKSRC`
-PLIST_FILES= share/fonts/bdf/kc15f.bdf.gz
+PLIST_FILES= share/fonts/bdf/kc15f.bdf.gz \
+ share/fonts/bdf/gb16st.bdf.gz \
+ share/fonts/bdf/8x16.bdf.gz
post-patch: post-patch-zhkon2
post-patch-zhkon2:
- @${REINPLACE_CMD} -e "s;jiskan16.bdf.gz;kc15f.bdf.gz;g" \
- -e "s;ja_JP.ujis:Coding;ja_JP.ujis:;g" \
- -e "s;zh_TW.big5:;zh_TW.big5:Coding;g" \
- -e "s;BIG5.HKU-0;BIG5-0;g" \
- -e "s,GB2312.1980,GBK,g" \
- ${WRKSRC}/kon.cfg.FreeBSD
- @${REINPLACE_CMD} -e "s;BIG5.HKU-0;BIG5-0;g" \
- -e "s;BIG5, 0;BIG5, 0xfefe;g" \
- -e "s,GB2312.1980,GBK,g" \
- ${WRKSRC}/lib/coding.c
@${REINPLACE_CMD} -e 's,/dev/vga,/dev/ttyv0,g' ${WRKSRC}/src/term.c \
${WRKSRC}/src/display/vga.c
+ @cd ${WRKSRC} && ${PATCH} < ${.CURDIR}/files/patch-lib::coding.c
+ @cd ${WRKSRC} && ${PATCH} < ${.CURDIR}/files/patch-kon.cfg.FreeBSD
post-build: post-build-zhkon2
post-build-zhkon2:
@@ -43,5 +38,7 @@ post-install: post-install-zhkon2
post-install-zhkon2:
@${MKDIR} ${PREFIX}/share/fonts/bdf
cd ${KCFONTS_WRKSRC} && ./kc15f | ${GZIP_CMD} - > ${PREFIX}/share/fonts/bdf/kc15f.bdf.gz
+ cd ${GB16ST_WRKSRC} && cat fonts/bdf/misc/gb16st.bdf | ${GZIP_CMD} - > ${PREFIX}/share/fonts/bdf/gb16st.bdf.gz
+ cd ${GB16ST_WRKSRC} && cat fonts/bdf/misc/8x16.bdf | ${GZIP_CMD} - > ${PREFIX}/share/fonts/bdf/8x16.bdf.gz
.include "${MASTERDIR}/Makefile"
diff --git a/chinese/kon2/files/patch-kon.cfg.FreeBSD b/chinese/kon2/files/patch-kon.cfg.FreeBSD
new file mode 100644
index 000000000000..b11467dd261d
--- /dev/null
+++ b/chinese/kon2/files/patch-kon.cfg.FreeBSD
@@ -0,0 +1,34 @@
+--- kon.cfg.FreeBSD.orig Sun May 1 01:39:21 2005
++++ kon.cfg.FreeBSD Sun May 1 01:40:35 2005
+@@ -115,8 +115,10 @@
+
+ # Startup command definition (usually font loading commands are specified)
+ bdf-zcat16:@@KON16FONT@@
++ gzip -cd @@PREFIX@@/share/fonts/bdf/8x16.bdf.gz | /usr/local/bin/fld -t bdf -n
+ gzip -cd @@PREFIX@@/share/fonts/bdf/jiskan16.bdf.gz | /usr/local/bin/fld -t bdf -n
+- gzip -cd @@PREFIX@@/share/fonts/bdf/8x16rk.bdf.gz | /usr/local/bin/fld -t bdf -n
++ gzip -cd @@PREFIX@@/share/fonts/bdf/kc15f.bdf.gz | /usr/local/bin/fld -t bdf -n
++ gzip -cd @@PREFIX@@/share/fonts/bdf/gb16st.bdf.gz | /usr/local/bin/fld -t bdf -n
+ bdf-zcat14:@@KON14FONT@@
+ gzip -cd @@PREFIX@@/share/fonts/bdf/k14.bdf.gz | /usr/local/bin/fld -t bdf -n
+ gzip -cd @@PREFIX@@/share/fonts/bdf/7x14rk.bdf.gz | /usr/local/bin/fld -t bdf -n
+@@ -199,16 +201,16 @@
+ # BIG5.HKU-0, GB2312.1980-1, JISX0208.1983-0, KSC5601.1987-0
+ # EUC, SJIS
+
+-ja_JP.ujis:Coding
++ja_JP.ujis:
+ JISX0201.1976-0 JISX0208.1983-0 EUC
+
+ ja_JP.sjis:
+ JISX0201.1976-0 JISX0208.1983-0 SJIS
+
+-zh_TW.big5:
++zh_TW.Big5:Coding
+ ISO8859-1 BIG5.HKU-0
+
+-zh_CN.ugb:
++zh_CN.GB2312:
+ ISO8859-1 GB2312.1980-0
+
+ ko_KR.euc:
diff --git a/chinese/kon2/files/patch-lib::coding.c b/chinese/kon2/files/patch-lib::coding.c
index 09ce75eb0503..129a8f9afbb0 100644
--- a/chinese/kon2/files/patch-lib::coding.c
+++ b/chinese/kon2/files/patch-lib::coding.c
@@ -1,20 +1,24 @@
---- lib/coding.c.orig Sat May 3 01:39:46 2003
-+++ lib/coding.c Sat May 3 01:41:08 2003
-@@ -43,10 +43,10 @@
+--- lib/coding.c.orig Fri Jan 24 15:08:40 1997
++++ lib/coding.c Sun May 1 01:53:52 2005
+@@ -120,7 +120,7 @@
- static u_int GB2312(u_char ch1, u_char ch2)
- {
-- if (ch1 > 0x29)
-- return(((ch1 - 0x27) * 94 + ch2 - 0x21) << 5);
-+ if (ch1 < 0x80)
-+ return(((ch1 - 0x81) * 191 + ch2 - 0x40) << 5);
- else
-- return(((ch1 - 0x21) * 94 + ch2 - 0x21) << 5);
-+ return(((ch1 - 0x81) * 191 + 63 + ch2 - 0x80) << 5);
- }
-
- static u_int BIG5(u_char ch1, u_char ch2)
-@@ -135,7 +135,7 @@
+ struct fontRegs fDRegs[] = {
+ /* DF_GB2312 */
+- { GB2312, 0, "GB2312.1980-0", NULL, 0, 0, 'A', 0, 0},
++ { FldGB2312, 0, "GB2312.1980-0", NULL, 0, 0, 'A', 0, 0},
+ /* DF_JISX0208 */
+ {JISX0208, 0,"JISX0208.1983-0", NULL, 0, 0, 'B', 0, 0},
+ /* DF_KSC5601 */
+@@ -128,19 +128,19 @@
+ /* DF_JISX0212 */
+ {JISX0208, 0, "JISX0212", NULL, 0, 0, 'D', 0, 0},
+ /* DF_BIG5_0 */
+- { BIG5, 0, "BIG5.HKU-0", NULL, 0, 0, '0', 0, 0},
++ { BIG5, 0, "BIG5-0", NULL, 0, 0, '0', 0, 0},
+ /* DF_BIG5_1 */
+- { BIG5, 0, "BIG5.HKU-0", NULL, 0, 0, '1', 0, 0},
++ { BIG5, 0, "BIG5-0", NULL, 0, 0, '1', 0, 0},
+ { NULL, 0, NULL, NULL, 0, 0, 0, 0, 0}
};
struct fontLoaderRegs fldDRegs[] = {
@@ -23,3 +27,10 @@
{FldJISX0208, 0x7424},
{ FldKSC5601, 0x7D7E},
{FldJISX0208, 0x7424},
+- { BIG5, 0},
+- { BIG5, 0},
++ { BIG5, 0xfefe},
++ { BIG5, 0xfefe},
+ { NULL, 0}
+ };
+