1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-12 03:00:28 +00:00

textproc/p5-XML-Parser: Convert XMLPARSER_EUCJP and XMLPARSER_SJIS to option framework

This commit is contained in:
Po-Chuan Hsieh 2022-07-07 20:23:38 +08:00
parent f519ae6825
commit 68286c8108
No known key found for this signature in database
GPG Key ID: 9A4BD10F002DD04B
2 changed files with 47 additions and 23 deletions

View File

@ -17,31 +17,51 @@ USE_PERL5= configure
CONFIGURE_ARGS= EXPATINCPATH=${LOCALBASE}/include EXPATLIBPATH=${LOCALBASE}/lib
PLIST_SUB= EUCJP=${EUCJP} SJIS=${SJIS}
CONV_ENC= ${PERL} -e '$$e=shift @ARGV; undef $$/; $$_=<>; substr($$_,4,40)=pack("a40","$$e"); print'
# XMLPARSER_EUCJP= x-euc-jp-(jisx0221|unicode)
# XMLPARSER_SJIS= x-sjis-(cp932|jdk117|jisx0221|unicode)
.if !defined(XMLPARSER_EUCJP)
EUCJP= "@comment "
.endif
.if !defined(XMLPARSER_SJIS)
SJIS= "@comment "
.endif
.if defined(XMLPARSER_EUCJP) || defined(XMLPARSER_SJIS)
USE_PERL5+= patch
.endif
OPTIONS_RADIO= EUCJP SJIS
OPTIONS_RADIO_EUCJP= EUCJP_JISX0221 EUCJP_UNICODE
OPTIONS_RADIO_SJIS= SJIS_CP932 SJIS_JDK117 SJIS_JISX0221 SJIS_UNICODE
OPTIONS_SUB= yes
EUCJP_JISX0221_DESC= Install euc-jp.enc (generated from x-euc-jp-jisx0221.enc)
EUCJP_UNICODE_DESC= Install euc-jp.enc (generated from x-euc-jp-unicode.enc)
SJIS_CP932_DESC= Install shift_jis.enc (generated from x-sjis-cp932.enc)
SJIS_JDK117_DESC= Install shift_jis.enc (generated from x-sjis-jdk117.enc)
SJIS_JISX0221_DESC= Install shift_jis.enc (generated from x-sjis-jisx0221.enc)
SJIS_UNICODE_DESC= Install shift_jis.enc (generated from x-sjis-unicode.enc)
EUCJP_JISX0221_USE= PERL5=patch
EUCJP_UNICODE_USE= PERL5=patch
SJIS_CP932_USE= PERL5=patch
SJIS_JDK117_USE= PERL5=patch
SJIS_JISX0221_USE= PERL5=patch
SJIS_UNICODE_USE= PERL5=patch
pre-patch-EUCJP_JISX0221-on:
@cd ${WRKSRC}/Parser/Encodings && ${CONV_ENC} euc-jp x-euc-jp-jisx0221.enc > euc-jp.enc
@${ECHO_CMD} Parser/Encodings/euc-jp.enc >> ${WRKSRC}/MANIFEST
pre-patch-EUCJP_UNICODE-on:
@cd ${WRKSRC}/Parser/Encodings && ${CONV_ENC} euc-jp x-euc-jp-unicode.enc > euc-jp.enc
@${ECHO_CMD} Parser/Encodings/euc-jp.enc >> ${WRKSRC}/MANIFEST
pre-patch-SJIS_CP932-on:
@cd ${WRKSRC}/Parser/Encodings && ${CONV_ENC} shift_jis x-sjis-cp932.enc > shift_jis.enc
@${ECHO_CMD} Parser/Encodings/shift_jis.enc >> ${WRKSRC}/MANIFEST
pre-patch-SJIS_JDK117-on:
@cd ${WRKSRC}/Parser/Encodings && ${CONV_ENC} shift_jis x-sjis-jdk117.enc > shift_jis.enc
@${ECHO_CMD} Parser/Encodings/shift_jis.enc >> ${WRKSRC}/MANIFEST
pre-patch-SJIS_JISX0221-on:
@cd ${WRKSRC}/Parser/Encodings && ${CONV_ENC} shift_jis x-sjis-jisx0221.enc > shift_jis.enc
@${ECHO_CMD} Parser/Encodings/shift_jis.enc >> ${WRKSRC}/MANIFEST
pre-patch-SJIS_UNICODE-on:
@cd ${WRKSRC}/Parser/Encodings && ${CONV_ENC} shift_jis x-sjis-unicode.enc > shift_jis.enc
@${ECHO_CMD} Parser/Encodings/shift_jis.enc >> ${WRKSRC}/MANIFEST
post-patch:
.if defined(XMLPARSER_EUCJP)
@cd ${WRKSRC}/Parser/Encodings && ${CONV_ENC} euc-jp ${XMLPARSER_EUCJP}.enc > euc-jp.enc
@${ECHO_CMD} Parser/Encodings/euc-jp.enc >> ${WRKSRC}/MANIFEST
.endif
.if defined(XMLPARSER_SJIS)
@cd ${WRKSRC}/Parser/Encodings && ${CONV_ENC} shift_jis ${XMLPARSER_SJIS}.enc > shift_jis.enc
@${ECHO_CMD} Parser/Encodings/shift_jis.enc >> ${WRKSRC}/MANIFEST
.endif
@${CP} ${FILESDIR}/*.enc ${WRKSRC}/Parser/Encodings/
.for e in 1 6 10 11 13 14 15
@${ECHO_CMD} Parser/Encodings/iso-8859-${e}.enc >> ${WRKSRC}/MANIFEST

View File

@ -3,7 +3,8 @@
%%SITE_ARCH%%/XML/Parser/Encodings/README
%%SITE_ARCH%%/XML/Parser/Encodings/big5.enc
%%SITE_ARCH%%/XML/Parser/Encodings/euc-kr.enc
%%EUCJP%%%%SITE_ARCH%%/XML/Parser/Encodings/euc-jp.enc
%%EUCJP_JISX0221%%%%SITE_ARCH%%/XML/Parser/Encodings/euc-jp.enc
%%EUCJP_UNICODE%%%%SITE_ARCH%%/XML/Parser/Encodings/euc-jp.enc
%%SITE_ARCH%%/XML/Parser/Encodings/ibm866.enc
%%SITE_ARCH%%/XML/Parser/Encodings/iso-8859-1.enc
%%SITE_ARCH%%/XML/Parser/Encodings/iso-8859-10.enc
@ -20,7 +21,10 @@
%%SITE_ARCH%%/XML/Parser/Encodings/iso-8859-8.enc
%%SITE_ARCH%%/XML/Parser/Encodings/iso-8859-9.enc
%%SITE_ARCH%%/XML/Parser/Encodings/koi8-r.enc
%%SJIS%%%%SITE_ARCH%%/XML/Parser/Encodings/shift_jis.enc
%%SJIS_CP932%%%%SITE_ARCH%%/XML/Parser/Encodings/shift_jis.enc
%%SJIS_JDK117%%%%SITE_ARCH%%/XML/Parser/Encodings/shift_jis.enc
%%SJIS_JISX0221%%%%SITE_ARCH%%/XML/Parser/Encodings/shift_jis.enc
%%SJIS_UNICODE%%%%SITE_ARCH%%/XML/Parser/Encodings/shift_jis.enc
%%SITE_ARCH%%/XML/Parser/Encodings/windows-1250.enc
%%SITE_ARCH%%/XML/Parser/Encodings/windows-1251.enc
%%SITE_ARCH%%/XML/Parser/Encodings/windows-1252.enc