summaryrefslogtreecommitdiff
path: root/devel/gettext-lib
diff options
context:
space:
mode:
authorjmmv <jmmv>2004-04-01 18:33:20 +0000
committerjmmv <jmmv>2004-04-01 18:33:20 +0000
commit8feb7b03c115902dc576f0ec1a84be3d4d5a1789 (patch)
tree9c68cc626010ac302231b9bd0006027c64e2424a /devel/gettext-lib
parent78f904a17b4a9d85f86a6b3bd53cedb04e55ba97 (diff)
downloadpkgsrc-8feb7b03c115902dc576f0ec1a84be3d4d5a1789.tar.gz
Add a script to workaround uses of msgid_plural, which is not yet supported
by our native libintl. While it is not implemented, this allows us to build programs against the native libintl, loosing very few functionality (some translations of plural messages on few languages), and avoiding runtime conflicts between native libintl and the gnu one (coming from the gettext package). Packages including .po files with uses of msgid_plural should define the USE_MSGFMT_PLURALS variable to 'yes', so that the msgfmt wrapper is used. (Do not use it when not really needed, as it will pull in perl5 as a build dependancy).
Diffstat (limited to 'devel/gettext-lib')
-rw-r--r--devel/gettext-lib/buildlink2.mk20
-rw-r--r--devel/gettext-lib/builtin.mk20
2 files changed, 38 insertions, 2 deletions
diff --git a/devel/gettext-lib/buildlink2.mk b/devel/gettext-lib/buildlink2.mk
index 8fad68305e4..1df0973f1a3 100644
--- a/devel/gettext-lib/buildlink2.mk
+++ b/devel/gettext-lib/buildlink2.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink2.mk,v 1.31 2004/03/29 05:05:34 jlam Exp $
+# $NetBSD: buildlink2.mk,v 1.32 2004/04/01 18:33:20 jmmv Exp $
.if !defined(GETTEXT_BUILDLINK2_MK)
GETTEXT_BUILDLINK2_MK= # defined
@@ -165,4 +165,22 @@ gettext-libintl-la:
libpattern="${BUILDLINK_PREFIX.gettext}/lib/libintl.*"; \
${BUILDLINK_FAKE_LA}
+.if defined(USE_MSGFMT_PLURALS) && !empty(USE_MSGFMT_PLURALS:M[Yy][Ee][Ss])
+USE_PERL5?= build
+CONFIGURE_ENV+= MSGFMT=${BUILDLINK_DIR}/bin/msgfmt
+
+SUBST_CLASSES+= fix-msgfmt
+SUBST_STAGE.fix-msgfmt= post-buildlink
+SUBST_MESSAGE.fix-msgfmt= "Fixing paths in msgfmt wrapper."
+SUBST_FILES.fix-msgfmt= ${BUILDLINK_DIR}/bin/msgfmt
+SUBST_SED.fix-msgfmt= -e 's|@PERL@|${PERL5}|g'
+SUBST_SED.fix-msgfmt+= -e 's|@MSGFMT@|${BUILDLINK_PREFIX.gettext}/bin/msgfmt|g'
+
+BUILDLINK_TARGETS+= buildlink-msgfmt
+
+buildlink-msgfmt:
+ @${CP} ../../devel/gettext/files/msgfmt.pl ${BUILDLINK_DIR}/bin/msgfmt
+ @${CHMOD} +x ${BUILDLINK_DIR}/bin/msgfmt
+.endif
+
.endif # GETTEXT_BUILDLINK2_MK
diff --git a/devel/gettext-lib/builtin.mk b/devel/gettext-lib/builtin.mk
index 3576d21ce69..a0127d3ec5d 100644
--- a/devel/gettext-lib/builtin.mk
+++ b/devel/gettext-lib/builtin.mk
@@ -1,4 +1,4 @@
-# $NetBSD: builtin.mk,v 1.4 2004/03/29 05:43:30 jlam Exp $
+# $NetBSD: builtin.mk,v 1.5 2004/04/01 18:33:20 jmmv Exp $
.if !defined(_BLNK_LIBINTL_FOUND)
_BLNK_LIBINTL_FOUND!= \
@@ -150,4 +150,22 @@ CONFIGURE_ARGS+= --without-libintl-prefix
. endif
.endif
+.if defined(USE_MSGFMT_PLURALS) && !empty(USE_MSGFMT_PLURALS:M[Yy][Ee][Ss])
+USE_PERL5?= build
+CONFIGURE_ENV+= MSGFMT=${BUILDLINK_DIR}/bin/msgfmt
+
+SUBST_CLASSES+= fix-msgfmt
+SUBST_STAGE.fix-msgfmt= post-buildlink
+SUBST_MESSAGE.fix-msgfmt= "Fixing paths in msgfmt wrapper."
+SUBST_FILES.fix-msgfmt= ${BUILDLINK_DIR}/bin/msgfmt
+SUBST_SED.fix-msgfmt= -e 's|@PERL@|${PERL5}|g'
+SUBST_SED.fix-msgfmt+= -e 's|@MSGFMT@|${BUILDLINK_PREFIX.gettext}/bin/msgfmt|g'
+
+BUILDLINK_TARGETS+= buildlink-msgfmt
+
+buildlink-msgfmt:
+ @${CP} ../../devel/gettext/files/msgfmt.pl ${BUILDLINK_DIR}/bin/msgfmt
+ @${CHMOD} +x ${BUILDLINK_DIR}/bin/msgfmt
+.endif
+
.endif # CHECK_BUILTIN.gettext