pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc We can only use the subst.mk framework if the files ar...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/d4c2f146e039
branches:  trunk
changeset: 494139:d4c2f146e039
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Thu May 19 20:08:44 2005 +0000

description:
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.

diffstat:

 devel/gettext-lib/builtin.mk |  26 ++++++++++++++------------
 mk/tools/replace.mk          |   9 ++++++++-
 2 files changed, 22 insertions(+), 13 deletions(-)

diffs (65 lines):

diff -r 24b44892ae74 -r d4c2f146e039 devel/gettext-lib/builtin.mk
--- a/devel/gettext-lib/builtin.mk      Thu May 19 19:55:30 2005 +0000
+++ b/devel/gettext-lib/builtin.mk      Thu May 19 20:08:44 2005 +0000
@@ -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 @@
 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 -r 24b44892ae74 -r d4c2f146e039 mk/tools/replace.mk
--- a/mk/tools/replace.mk       Thu May 19 19:55:30 2005 +0000
+++ b/mk/tools/replace.mk       Thu May 19 20:08:44 2005 +0000
@@ -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 @@
 .  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



Home | Main Index | Thread Index | Old Index