summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2005-05-19 20:08:44 +0000
committerjlam <jlam@pkgsrc.org>2005-05-19 20:08:44 +0000
commit28e2995cd1b13973f4e1767f964ab008c4d69e36 (patch)
tree5251820a7214b238db9522067d4dec7cdc97fe12
parent9e067ec9bc7a6dce393da906b3fc4798f0fa0082 (diff)
downloadpkgsrc-28e2995cd1b13973f4e1767f964ab008c4d69e36.tar.gz
We can only use the subst.mk framework if the files are relative to
${WRKSRC}. Just directly create the msgfmt wrapper in the proper target. Also, note that the msgfmt handling should eventually migrate to the tools framework so that build dependencies and binary paths are correct.
-rw-r--r--devel/gettext-lib/builtin.mk26
-rw-r--r--mk/tools/replace.mk9
2 files changed, 22 insertions, 13 deletions
diff --git a/devel/gettext-lib/builtin.mk b/devel/gettext-lib/builtin.mk
index 266a7536ae8..4c645c5b32c 100644
--- a/devel/gettext-lib/builtin.mk
+++ b/devel/gettext-lib/builtin.mk
@@ -1,4 +1,4 @@
-# $NetBSD: builtin.mk,v 1.18 2005/04/19 14:55:30 epg Exp $
+# $NetBSD: builtin.mk,v 1.19 2005/05/19 20:08:44 jlam Exp $
.for _lib_ in intl
. if !defined(_BLNK_LIB_FOUND.${_lib_})
@@ -173,19 +173,21 @@ CONFIGURE_ARGS+= --without-libintl-prefix
USE_PERL5?= build
CONFIGURE_ENV+= MSGFMT=${BUILDLINK_DIR}/bin/msgfmt
-SUBST_CLASSES+= fix-msgfmt
-SUBST_STAGE.fix-msgfmt= post-wrapper
-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'
-
+# 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:
- @${MKDIR} -p ${BUILDLINK_DIR}/bin
- @${CP} ../../devel/gettext/files/msgfmt.pl ${BUILDLINK_DIR}/bin/msgfmt
- @${CHMOD} +x ${BUILDLINK_DIR}/bin/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}
.endif
.endif # CHECK_BUILTIN.gettext
diff --git a/mk/tools/replace.mk b/mk/tools/replace.mk
index 5518b22f2b9..6e7288ed22b 100644
--- a/mk/tools/replace.mk
+++ b/mk/tools/replace.mk
@@ -1,4 +1,4 @@
-# $NetBSD: replace.mk,v 1.86 2005/05/19 05:27:25 jlam Exp $
+# $NetBSD: replace.mk,v 1.87 2005/05/19 20:08:44 jlam Exp $
#
# This Makefile fragment handles "replacements" of system-supplied
# tools with pkgsrc versions.
@@ -59,6 +59,13 @@ TOOLS_DEPMETHOD.perl?= DEPENDS
. endif
.endif
+# XXX Keep this hack here until the day that msgfmt and msgfmt-plurals
+# XXX is handled directly by the tools framework.
+# XXX
+.if defined(USE_MSGFMT_PLURALS) && !empty(USE_MSGFMT_PLURALS:M[yY][eE][sS])
+USE_TOOLS+= perl
+.endif
+
# bison implies "bison-yacc"
.if !empty(USE_TOOLS:Mbison)
USE_TOOLS+= bison-yacc