Date: Fri, 13 Mar 2009 07:21:58 +0900 From: Tsurutani Naoki <turutani@scphys.kyoto-u.ac.jp> To: FreeBSD-gnats-submit@FreeBSD.org, freebsd-ports-bugs@FreeBSD.org Subject: Re: ports/132453: upgrade japanese/nkf Message-ID: <200903122221.AA00965@POLYMER5.scphys.kyoto-u.ac.jp> In-Reply-To: <200903091320.n29DK1Ba035810@freefall.freebsd.org> References: <200903091320.n29DK1Ba035810@freefall.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
here is a new patch: diff -urN nkf.orig/Makefile nkf/Makefile --- nkf.orig/Makefile 2006-07-02 21:51:09.000000000 +0900 +++ nkf/Makefile 2009-03-09 21:21:17.000000000 +0900 @@ -6,19 +6,17 @@ # PORTNAME= nkf -PORTVERSION= 2.0.7 +PORTVERSION= 2.0.9 PORTEPOCH= 1 CATEGORIES?= japanese MASTER_SITES= ${MASTER_SITE_SOURCEFORGE_JP} -MASTER_SITE_SUBDIR= ${PORTNAME}/20770 +MASTER_SITE_SUBDIR= ${PORTNAME}/37177 PKGNAMEPREFIX?= ja- -DISTNAME= ${PORTNAME}${PORTVERSION:S/.//g} +DISTNAME= ${PORTNAME}-${PORTVERSION} MAINTAINER= nork@FreeBSD.org COMMENT?= Network Kanji code conversion Filter -WRKSRC?= ${WRKDIR}/${PORTNAME}${PORTVERSION:S/.//g} - .if ${PKGNAMEPREFIX} != "ja-p5-" MAN1= nkf.1 MANLANG= "" ja diff -urN nkf.orig/distinfo nkf/distinfo --- nkf.orig/distinfo 2006-07-02 21:51:09.000000000 +0900 +++ nkf/distinfo 2009-03-09 21:11:10.000000000 +0900 @@ -1,3 +1,3 @@ -MD5 (nkf207.tar.gz) = af11dcd3fe71d67831c020e3bfd5073b -SHA256 (nkf207.tar.gz) = 71d2ba992df209a00bb1dca45e3336729dc16e51b71526bd20f897cc6127a275 -SIZE (nkf207.tar.gz) = 150501 +MD5 (nkf-2.0.9.tar.gz) = 0dadcf178785c87874822a2ff8da9f19 +SHA256 (nkf-2.0.9.tar.gz) = 3b2a972437e425c2c1e2786f20d74deaaf06bb7386eaa2925dfd5a772198f81f +SIZE (nkf-2.0.9.tar.gz) = 157686 diff -urN nkf.orig/files/patch-209fix nkf/files/patch-209fix --- nkf.orig/files/patch-209fix 1970-01-01 09:00:00.000000000 +0900 +++ nkf/files/patch-209fix 2009-03-09 22:08:18.000000000 +0900 @@ -0,0 +1,178 @@ +diff -urBbN nkf-2.0.9/NKF.mod/NKF.xs nkf.cur/NKF.mod/NKF.xs +--- ./NKF.mod/NKF.xs.orig 2009-01-20 18:49:31.000000000 +0900 ++++ ./NKF.mod/NKF.xs 2009-02-21 15:51:20.000000000 +0900 +@@ -95,7 +95,10 @@ + + #define PERL_XS 1 + #include "../utf8tbl.c" ++#undef SP + #include "../nkf.c" ++#undef SP ++#define SP sp /* perl's CORE/pp.h */ + + /* package defenition */ + +@@ -134,9 +137,6 @@ + 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 +178,6 @@ + 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 -urBbN nkf-2.0.9/NKF.mod/test.pl nkf.cur/NKF.mod/test.pl +--- ./NKF.mod/test.pl.orig 2009-01-20 18:49:31.000000000 +0900 ++++ ./NKF.mod/test.pl 2009-02-21 15:51:20.000000000 +0900 +@@ -114,8 +114,35 @@ + } 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 -urBbN nkf-2.0.9/nkf.c nkf.cur/nkf.c +--- ./nkf.c.orig 2009-01-20 18:49:31.000000000 +0900 ++++ ./nkf.c 2009-02-21 15:51:20.000000000 +0900 +@@ -21,7 +21,7 @@ + * 3. This notice may not be removed or altered from any source distribution. + */ + #define NKF_VERSION "2.0.9" +-#define NKF_RELEASE_DATE "2009-01-20" ++#define NKF_RELEASE_DATE "2009-02-21" + #define COPY_RIGHT \ + "Copyright (C) 1987, FUJITSU LTD. (I.Ichikawa).\n" \ + "Copyright (C) 1996-2009, The nkf Project." +@@ -468,6 +468,8 @@ + {"Shift_JIS", 0, 0, 0, {0, 0, 0}, s_status, s_iconv, 0}, + #ifdef UTF8_INPUT_ENABLE + {"UTF-8", 0, 0, 0, {0, 0, 0}, w_status, w_iconv, 0}, ++ {"UTF-16", 0, 0, 0, {0, 0, 0}, NULL, w_iconv16, 0}, ++ {"UTF-32", 0, 0, 0, {0, 0, 0}, NULL, w_iconv32, 0}, + #endif + {0} + }; +@@ -1426,6 +1428,7 @@ + output_endian = ENDIAN_LITTLE; + output_bom_f = TRUE; + break; ++ case UTF_32: + case UTF_32BE_BOM: + output_bom_f = TRUE; + break; +@@ -6159,9 +6162,6 @@ + output_endian = ENDIAN_LITTLE; + } else if (cp[0] == 'B') { + cp++; +- } else { +- output_encoding = nkf_enc_from_index(enc_idx); +- continue; + } + if (cp[0] == '0'){ + cp++; +@@ -6232,6 +6232,7 @@ + while ('0'<= *cp && *cp <='9') { + alpha_f |= 1 << (*cp++ - '0'); + } ++ if (alpha_f & ((1 << 2) | (1 << 3))) alpha_f |= 1; + if (!alpha_f) alpha_f = 1; + continue; + case 'x': /* Convert X0201 kana to X0208 or X0201 Conversion */ +diff -urBbN nkf-2.0.9/nkf_test.pl nkf.cur/nkf_test.pl +--- ./nkf_test.pl.orig 2009-01-20 18:49:31.000000000 +0900 ++++ ./nkf_test.pl 2009-02-21 15:51:20.000000000 +0900 +@@ -216,8 +216,37 @@ + print "UTF8 to EUC ...";&test("$nkf -e",$example{'utf1'},$example{'euc1'}); + print "UTF8 to UTF8...";&test("$nkf -w",$example{'utf1'},$example{'utf1'}); + +-print "\nOther Features\n\n"; ++# UTF ++sub h {pack("H*",shift)} ++print "SJIS to -w... ";&test("$nkf -w",h("82A0"),h("E38182")); ++print "SJIS to -w8... ";&test("$nkf -w8",h("82A0"),h("EFBBBFE38182")); ++print "SJIS to -w80... ";&test("$nkf -w80",h("82A0"),h("E38182")); ++print "SJIS to UTF-8... ";&test("$nkf --oc=UTF-8",h("82A0"),h("E38182")); ++print "SJIS to UTF-8N... ";&test("$nkf --oc=UTF-8N",h("82A0"),h("E38182")); ++print "SJIS to UTF-8-BOM... ";&test("$nkf --oc=UTF-8-BOM",h("82A0"),h ("EFBBBFE38182")); ++print "SJIS to -w16... ";&test("$nkf -w16",h("82A0"),h("FEFF3042")); ++print "SJIS to UTF-16... ";&test("$nkf --oc=UTF-16",h("82A0"),h("FEFF3042")); ++print "SJIS to -w16B... ";&test("$nkf -w16B",h("82A0"),h("FEFF3042")); ++print "SJIS to -w16B0... ";&test("$nkf -w16B0",h("82A0"),h("3042")); ++print "SJIS to UTF-16BE... ";&test("$nkf --oc=UTF-16BE",h("82A0"),h("3042")); ++print "SJIS to UTF-16BE-BOM...";&test("$nkf --oc=UTF-16BE-BOM",h("82A0"),h("FEFF3042")); ++print "SJIS to -w16L... ";&test("$nkf -w16L",h("82A0"),h("FFFE4230")); ++print "SJIS to -w16L0... ";&test("$nkf -w16L0",h("82A0"),h("4230")); ++print "SJIS to UTF-16LE... ";&test("$nkf --oc=UTF-16LE",h("82A0"),h("4230")); ++print "SJIS to UTF-16LE-BOM...";&test("$nkf --oc=UTF-16LE-BOM",h("82A0"),h("FFFE4230")); ++print "SJIS to -w32... ";&test("$nkf -w32",h("82A0"),h("0000FEFF00003042")); ++print "SJIS to UTF-32... ";&test("$nkf --oc=UTF-32",h("82A0"),h ("0000FEFF00003042")); ++print "SJIS to -w32B... ";&test("$nkf -w32B",h("82A0"),h("0000FEFF00003042")); ++print "SJIS to -w32B0... ";&test("$nkf -w32B0",h("82A0"),h("00003042")); ++print "SJIS to UTF-32BE... ";&test("$nkf --oc=UTF-32BE",h("82A0"),h("00003042")); ++print "SJIS to UTF-32BE-BOM...";&test("$nkf --oc=UTF-32BE-BOM",h("82A0"),h ("0000FEFF00003042")); ++print "SJIS to -w32L... ";&test("$nkf -w32L",h("82A0"),h("FFFE000042300000")); ++print "SJIS to -w32L0... ";&test("$nkf -w32L0",h("82A0"),h("42300000")); ++print "SJIS to UTF-32LE... ";&test("$nkf --oc=UTF-32LE",h("82A0"),h("42300000")); ++print "SJIS to UTF-32LE-BOM...";&test("$nkf --oc=UTF-32LE-BOM",h("82A0"),h ("FFFE000042300000")); ++ + ++print "\nOther Features\n\n"; + # Ambigous Case + + $example{'amb'} = unpack('u',<<'eofeof'); +@@ -957,6 +986,7 @@ + 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 +1010,7 @@ + "$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( diff -urN nkf.orig/files/patch-aa nkf/files/patch-aa --- nkf.orig/files/patch-aa 2006-07-02 21:51:09.000000000 +0900 +++ nkf/files/patch-aa 2009-03-09 22:13:29.000000000 +0900 @@ -1,9 +1,8 @@ ---- Makefile.orig Mon Jun 19 23:04:35 2006 -+++ Makefile Sun Jul 2 21:44:28 2006 -@@ -1,17 +1,27 @@ +--- Makefile.orig 2009-01-20 18:49:31.000000000 +0900 ++++ Makefile 2009-03-09 21:17:55.000000000 +0900 +@@ -1,15 +1,19 @@ -CC = cc --CFLAGS = -O -+PREFIX?= /usr/local +-CFLAGS = -O -Wall -pedantic +CC?= cc +CFLAGS?= -O -Wall # CFLAGS = -O3 @@ -11,24 +10,31 @@ # SHAR = shar -T -PERL = perl -RM = rm -rf -+PERL?= perl -+RM?= rm -rf ++PERL? = perl ++RM? = rm -rf +INSTALL?= /usr/bin/install +BSD_INSTALL_PROGRAM?= ${INSTALL} -s -o root -g wheel -m 555 +BSD_INSTALL_MAN?= ${INSTALL} -o root -g wheel -m 444 - VERSION = 207 + VERSION = 2.0.9 +-prefix = /usr/local ++PREFIX? = /usr/local - nkf : nkf.c config.h utf8tbl.o - $(CC) $(CFLAGS) -o nkf nkf.c utf8tbl.o + nkf : nkf.o utf8tbl.o + $(CC) $(CFLAGS) -o nkf nkf.o utf8tbl.o + ./nkf -e nkf.1j > nkf.1j.euc - utf8tbl.o : utf8tbl.c config.h - $(CC) $(CFLAGS) -c utf8tbl.c -+ -+install: -+ ${BSD_INSTALL_PROGRAM} nkf ${PREFIX}/bin + nkf.o : nkf.c nkf.h utf8tbl.h config.h + $(CC) $(CFLAGS) -c nkf.c +@@ -31,9 +35,9 @@ + make test ) + + install: +- cp nkf $(prefix)/bin/ +- cp nkf.1 $(prefix)/man/man1/ +- cp nkf.1j $(prefix)/man/ja/man1/nkf.1 ++ ${BSD_INSTALL_PROGRAM} nkf ${PREFIX}/bin/ + ${BSD_INSTALL_MAN} nkf.1 ${PREFIX}/man/man1/nkf.1 + ${BSD_INSTALL_MAN} nkf.1j.euc ${PREFIX}/man/ja/man1/nkf.1 - clean: - -$(RM) nkf.o nkf nkf.in nkf.out nkf$(VERSION) *~ *.bad utf8tbl.o + shar: + -mkdir nkf-$(VERSION)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200903122221.AA00965>