summaryrefslogtreecommitdiff
path: root/converters/nkf
diff options
context:
space:
mode:
authorobache <obache>2009-01-22 08:50:12 +0000
committerobache <obache>2009-01-22 08:50:12 +0000
commit37668bc5aca3da52cc4e6e44254324f05ea8208e (patch)
tree8dae9e28dc3f1ed5f717bf4aea263627ca117378 /converters/nkf
parent1c8f739443447bc182c59975367416913307cc07 (diff)
downloadpkgsrc-37668bc5aca3da52cc4e6e44254324f05ea8208e.tar.gz
Update nkf to 2.09.
While here, add support of self test if PKGSRC_RUN_TEST=YES, and let p5-nkf to sync with nkf. Changes: * Add -Z4 option. Convert JIS X 0208 KANA to JIS X 0201 KANA (ZENKAKU to HANKAKU). * Add -g=0, -g=1, --guess=0 and --guess=1 option. guesses linefeed code. * Add some comple option. See also config.h for more information. * Some bug fixes. * Change license from original one to zlib's one. * Change SCM from CVS to Git.
Diffstat (limited to 'converters/nkf')
-rw-r--r--converters/nkf/Makefile18
-rw-r--r--converters/nkf/Makefile.common11
-rw-r--r--converters/nkf/distinfo11
-rw-r--r--converters/nkf/patches/patch-aa40
-rw-r--r--converters/nkf/patches/patch-ab43
-rw-r--r--converters/nkf/patches/patch-ac23
6 files changed, 135 insertions, 11 deletions
diff --git a/converters/nkf/Makefile b/converters/nkf/Makefile
index b0d8f38ab84..7e79ea3da67 100644
--- a/converters/nkf/Makefile
+++ b/converters/nkf/Makefile
@@ -1,19 +1,16 @@
-# $NetBSD: Makefile,v 1.11 2008/01/13 13:13:42 obache Exp $
+# $NetBSD: Makefile,v 1.12 2009/01/22 08:50:12 obache Exp $
-DISTNAME= nkf-2.0.8b
-PKGNAME= nkf-2.08b
+.include "${.CURDIR}/Makefile.common"
+
+PKGNAME= nkf-2.09
CATEGORIES= japanese converters
-MASTER_SITES= ${MASTER_SITE_SOURCEFORGE_JP:=nkf/26243/}
MAINTAINER= cjs@NetBSD.org
-HOMEPAGE= http://sourceforge.jp/projects/nkf/
COMMENT= Convert between various Japanese character encodings
PKG_INSTALLATION_TYPES= overwrite pkgviews
PKG_DESTDIR_SUPPORT= user-destdir
-WRKSRC= ${WRKDIR}/nkf-2.0.8
-
INSTALLATION_DIRS= bin ${PKGMANDIR}/man1
BUILD_TARGET= nkf
@@ -22,4 +19,11 @@ do-install:
${INSTALL_PROGRAM} ${WRKSRC}/nkf ${DESTDIR}${PREFIX}/bin
${INSTALL_MAN} ${WRKSRC}/nkf.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1
+.include "../../mk/bsd.prefs.mk"
+
+.if !empty(PKGSRC_RUN_TEST:M[yY][eE][sS])
+USE_TOOLS+= perl
+TEST_TARGET= test
+.endif
+
.include "../../mk/bsd.pkg.mk"
diff --git a/converters/nkf/Makefile.common b/converters/nkf/Makefile.common
new file mode 100644
index 00000000000..1cbd31793d8
--- /dev/null
+++ b/converters/nkf/Makefile.common
@@ -0,0 +1,11 @@
+# $NetBSD: Makefile.common,v 1.1 2009/01/22 08:50:12 obache Exp $
+# used by converters/nkf/Makefile
+# used by converters/p5-nkf/Makefile
+
+DISTNAME= nkf-2.0.9
+MASTER_SITES= ${MASTER_SITE_SOURCEFORGE_JP:=nkf/37177/}
+
+HOMEPAGE= http://sourceforge.jp/projects/nkf/
+
+DISTINFO_FILE= ${.CURDIR}/../../converters/nkf/distinfo
+PATCHDIR= ${.CURDIR}/../../converters/nkf/patches
diff --git a/converters/nkf/distinfo b/converters/nkf/distinfo
index a39ab7b396e..d7fac8df80b 100644
--- a/converters/nkf/distinfo
+++ b/converters/nkf/distinfo
@@ -1,5 +1,8 @@
-$NetBSD: distinfo,v 1.5 2008/01/13 13:13:42 obache Exp $
+$NetBSD: distinfo,v 1.6 2009/01/22 08:50:12 obache Exp $
-SHA1 (nkf-2.0.8b.tar.gz) = 9587e427173b6c0420284afef19b18b3f905fbaa
-RMD160 (nkf-2.0.8b.tar.gz) = 952698a09f8e28b6385a7b41301e95dc237aa893
-Size (nkf-2.0.8b.tar.gz) = 152883 bytes
+SHA1 (nkf-2.0.9.tar.gz) = 68e9d5c6224940e6f1fe1d3cf0a54e47c5769a27
+RMD160 (nkf-2.0.9.tar.gz) = c27b176f675428c0cbfb7779700979e60de3a42f
+Size (nkf-2.0.9.tar.gz) = 157686 bytes
+SHA1 (patch-aa) = 04ae92c1ff89b68750cb64186921b8984d527879
+SHA1 (patch-ab) = dcb7619ef049f3e9824566565281efaec54587fa
+SHA1 (patch-ac) = 2d891bdd891cabd760f7fd905d2ecc5e40908ad0
diff --git a/converters/nkf/patches/patch-aa b/converters/nkf/patches/patch-aa
new file mode 100644
index 00000000000..6e0ab259f34
--- /dev/null
+++ b/converters/nkf/patches/patch-aa
@@ -0,0 +1,40 @@
+$NetBSD: patch-aa,v 1.1 2009/01/22 08:50:12 obache Exp $
+
+Fix: redefinition of macro SP (workarround).
+http://git.sourceforge.jp/view?p=nkf/nkf.git;a=commitdiff;h=d2f5d12b00a610a371ec48f6c841953b792aa721
+
+NKF.xs must follow nkf.c doesn't have WISH_TRUE AND NO_X0201
+http://git.sourceforge.jp/view?p=nkf/nkf.git;a=commitdiff;h=f06661980bb179714f60338e09d48ae66ca15f97
+
+--- NKF.mod/NKF.xs.orig 2009-01-20 09:49:31.000000000 +0000
++++ NKF.mod/NKF.xs
+@@ -95,7 +95,9 @@ nkf_putchar_grow(unsigned int c)
+
+ #define PERL_XS 1
+ #include "../utf8tbl.c"
++#undef SP
+ #include "../nkf.c"
++#define SP sp /* perl's CORE/pp.h */
+
+ /* package defenition */
+
+@@ -134,9 +136,6 @@ nkf(...)
+ data = SvPV(ST(argc),i_len);
+ input_ctr = 0;
+
+- if(x0201_f == WISH_TRUE)
+- x0201_f = ((!iso2022jp_f)? TRUE : NO_X0201);
+-
+ /* allocate the result buffer */
+
+ /* During conversion, stirngs length may grow. This is the unit */
+@@ -178,9 +177,6 @@ nkf_continue(...)
+ data = SvPV(ST(0),i_len);
+ input_ctr = 0;
+
+- if(x0201_f == WISH_TRUE)
+- x0201_f = ((!iso2022jp_f)? TRUE : NO_X0201);
+-
+ /* allocate the result buffer */
+
+ /* During conversion, stirngs length may grow. This is the unit */
diff --git a/converters/nkf/patches/patch-ab b/converters/nkf/patches/patch-ab
new file mode 100644
index 00000000000..9b9a7e85d63
--- /dev/null
+++ b/converters/nkf/patches/patch-ab
@@ -0,0 +1,43 @@
+$NetBSD: patch-ab,v 1.1 2009/01/22 08:50:12 obache Exp $
+
+Fix: can't run test.
+http://git.sourceforge.jp/view?p=nkf/nkf.git;a=commitdiff;h=b7ee1f1b26ba715116fd8f66e83bf1ad8a95bcce
+
+--- NKF.mod/test.pl.orig 2009-01-20 09:49:31.000000000 +0000
++++ NKF.mod/test.pl
+@@ -114,8 +114,35 @@ END {print "not ok 1\n" unless $loaded;}
+ } else {
+ print "no 5\n";
+ }
++}
+
++sub command_tests {
++ my @tests = @_;
++ my ($in, $out, $ans);
+
++ for (my $i = 0; $i <= $#tests; $i += 3){
++ local (@nkf) = split(/ /,$tests[$i]);
++ shift(@nkf);
++ $in = $tests[$i+1];
++ $ans = $tests[$i+2];
++ $out = NKF::nkf(@nkf,$in);
++ $out =~ s/ //g if $nkf =~ /-\w+m[NS]/o;
++ $ans =~ s/ //g if $nkf =~ /-\w+m[NS]/o;
++ if ($out ne $ans) {
++ last;
++ }
++ }
++ if ($out eq $ans) {
++ print "Ok\n";
++ return;
++ }
++ print "Fail\n";
++ if ($diff) {
++ open(R,"|od -c >tmp.result.bad"); binmode R; print R $out; close(R);
++ open(R,"|od -c >tmp.expect.bad"); binmode R; print R $ans; close(R);
++ system "diff -c tmp.result.bad tmp.expect.bad";
++ }
++ return;
+ }
+
+ do "../nkf_test.pl";
diff --git a/converters/nkf/patches/patch-ac b/converters/nkf/patches/patch-ac
new file mode 100644
index 00000000000..f492b6ec74d
--- /dev/null
+++ b/converters/nkf/patches/patch-ac
@@ -0,0 +1,23 @@
+$NetBSD: patch-ac,v 1.1 2009/01/22 08:50:12 obache Exp $
+
+Fix: can't run test.
+http://git.sourceforge.jp/view?p=nkf/nkf.git;a=commitdiff;h=b7ee1f1b26ba715116fd8f66e83bf1ad8a95bcce
+
+--- nkf_test.pl.orig 2009-01-20 09:49:31.000000000 +0000
++++ nkf_test.pl
+@@ -957,6 +957,7 @@ eofeof
+ printf "%-40s", "test_data/bugs10904";
+ &test("$nkf -Mj",$example{'test_data/bugs10904'},$example{'test_data/bugs10904.ans'});
+
++ if (!NKF) {
+ printf "%-40s", "Guess NL";
+ &command_tests(
+ "$nkf --guess","none", "ASCII\n",
+@@ -980,6 +981,7 @@ printf "%-40s", "Guess NL";
+ "$nkf --guess","\r\n.\n", "ASCII (MIXED NL)\n",
+ "$nkf --guess","\r\n.\r", "ASCII (MIXED NL)\n",
+ "$nkf --guess","\r\n.\r\n", "ASCII (CRLF)\n");
++ }
+
+ printf "%-40s", "Convert NL to LF";
+ &command_tests(