summaryrefslogtreecommitdiff
path: root/devel/gettext-lib
diff options
context:
space:
mode:
authorjlam <jlam>2006-04-13 16:35:57 +0000
committerjlam <jlam>2006-04-13 16:35:57 +0000
commitd065f9a8442fe522404bb2be2e1547b54ae46821 (patch)
tree05edb3a0d35814dcd46fc6d587c479a7a041b561 /devel/gettext-lib
parente7f6ab298c22340dca574f8d0349b24c9b80c59b (diff)
downloadpkgsrc-d065f9a8442fe522404bb2be2e1547b54ae46821.tar.gz
Overhaul the way packages can ask for "msgfmt". If a package needs
msgfmt, then it should set the following in the package Makefile: USE_TOOLS+= msgfmt To deal with message files that use the "msgid_plural" statement, which isn't supported in NetBSD<=3.x and also in gettext<=0.10.35, we determine if the built-in "msgfmt" is sufficiently new enough to understand "msgid_plural". If it isn't, then we use the msgfmt.sh script to transform the msgid_plural statements to an equivalent construct that's understood by older msgfmt tools. The msgfmt.sh script is a straightforward translation of the original perl script msgfmt.pl script by Julio M. Merino Vidal into shell and awk, which are more lightweight dependencies than perl. We remove the USE_MSGFMT_PLURALS bits in gettext-lib/builtin.mk as they are made obsolete by the new code in mk/tools/msgfmt.mk. BUILD_USE_MSGFMT is still supported but will be removed in a separate commit.
Diffstat (limited to 'devel/gettext-lib')
-rw-r--r--devel/gettext-lib/builtin.mk36
1 files changed, 1 insertions, 35 deletions
diff --git a/devel/gettext-lib/builtin.mk b/devel/gettext-lib/builtin.mk
index 8503d268d27..781b69613be 100644
--- a/devel/gettext-lib/builtin.mk
+++ b/devel/gettext-lib/builtin.mk
@@ -1,4 +1,4 @@
-# $NetBSD: builtin.mk,v 1.31 2006/04/06 06:21:49 reed Exp $
+# $NetBSD: builtin.mk,v 1.32 2006/04/13 16:35:58 jlam Exp $
BUILTIN_PKG:= gettext
@@ -206,38 +206,4 @@ CONFIGURE_ARGS+= --without-libintl-prefix
. endif
. endif
-. if defined(USE_MSGFMT_PLURALS) && !empty(USE_MSGFMT_PLURALS:M[Yy][Ee][Ss])
-USE_TOOLS+= perl
-CONFIGURE_ENV+= MSGFMT=${BUILDLINK_DIR}/bin/msgfmt
-
-# XXX _USE_NEW_TOOLS=yes should make "msgfmt" and "msgfmt-plural" into
-# XXX tools that can be specified via USE_TOOLS. They would replace
-# XXX BUILD_USES_MSGFMT and USE_MSGFMT_PLURALS.
-# XXX
-BUILDLINK_TARGETS+= buildlink-msgfmt
-
-buildlink-msgfmt: ${BUILDLINK_DIR}/bin/msgfmt
-
-${BUILDLINK_DIR}/bin/msgfmt: ${.CURDIR}/../../devel/gettext/files/msgfmt.pl
- @ver=`${BUILDLINK_PREFIX.gettext:Q}/bin/msgfmt --version | \
- ${HEAD} -n 1 | ${CUT} -d ' ' -f 4`; \
- ${MKDIR} ${.TARGET:H}; \
- case $${ver} in \
- 0.10.[1-3][0-5]|0.[0-9].*) \
- ${ECHO} "=> Creating msgfmt wrapper to work-around" \
- "plurals"; \
- ${CAT} ${.ALLSRC} | \
- ${SED} -e "s|@PERL@|"${PERL5:Q}"|g" \
- -e "s|@MSGFMT@|"${BUILDLINK_PREFIX.gettext:Q}/bin/msgfmt"|g" \
- > ${.TARGET}; \
- ;; \
- *) \
- ${ECHO} "#! ${SH}" >${.TARGET}; \
- ${ECHO} "${BUILDLINK_PREFIX.gettext:Q}/bin/msgfmt" \
- '"$$@"' >>${.TARGET}; \
- ;; \
- esac; \
- ${CHMOD} +x ${.TARGET}
-. endif
-
.endif # CHECK_BUILTIN.gettext