summaryrefslogtreecommitdiff
path: root/devel/gettext-lib
diff options
context:
space:
mode:
authorjmmv <jmmv@pkgsrc.org>2005-08-20 12:04:09 +0000
committerjmmv <jmmv@pkgsrc.org>2005-08-20 12:04:09 +0000
commit5774296b7abdb50dc9d7c39519c332b61ab12d5e (patch)
treedec41866383a4800320dac566a9c18f44f228965 /devel/gettext-lib
parent756716bbec3ca1665c6762b7fa08c26514cd2901 (diff)
downloadpkgsrc-5774296b7abdb50dc9d7c39519c332b61ab12d5e.tar.gz
Fix the msgfmt.pl script to deal with messages with plurals whose strings
are identical (e.g., msgid == msgid_plural) by ignoring the duplicates. In fact, this is a rewrite of the script, since I couldn't understand the old one (ew). Also change the way we use it to only pull it in the build if the real msgfmt does not support plurals (i.e., it's older than 0.10.36). Fixes PR pkg/30596 and PR pkg/30938 (both related to epiphany). It also fixes the build of evolution-data-server and probably others.
Diffstat (limited to 'devel/gettext-lib')
-rw-r--r--devel/gettext-lib/builtin.mk27
1 files changed, 20 insertions, 7 deletions
diff --git a/devel/gettext-lib/builtin.mk b/devel/gettext-lib/builtin.mk
index 75042ba7c37..defc6ccfeef 100644
--- a/devel/gettext-lib/builtin.mk
+++ b/devel/gettext-lib/builtin.mk
@@ -1,4 +1,4 @@
-# $NetBSD: builtin.mk,v 1.26 2005/07/16 01:19:08 jlam Exp $
+# $NetBSD: builtin.mk,v 1.27 2005/08/20 12:04:09 jmmv Exp $
BUILTIN_PKG:= gettext
@@ -222,12 +222,25 @@ BUILDLINK_TARGETS+= buildlink-msgfmt
buildlink-msgfmt: ${BUILDLINK_DIR}/bin/msgfmt
${BUILDLINK_DIR}/bin/msgfmt: ${.CURDIR}/../../devel/gettext/files/msgfmt.pl
- @${MKDIR} ${.TARGET:H}
- @${CAT} ${.ALLSRC} | \
- ${SED} -e "s|@PERL@|"${PERL5:Q}"|g" \
- -e "s|@MSGFMT@|"${BUILDLINK_PREFIX.gettext:Q}/bin/msgfmt"|g" \
- > ${.TARGET}
- @${CHMOD} +x ${.TARGET}
+ @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