pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk/tools Rename MSGFMT_STRIP_MSGCTX to MSGFMT_STRIP_MS...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/47e6df093815
branches:  trunk
changeset: 556545:47e6df093815
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Sun Mar 22 17:57:58 2009 +0000

description:
Rename MSGFMT_STRIP_MSGCTX to MSGFMT_STRIP_MSGCTXT to reflect what is
stripped. Allow the script to be used for pkgsrc msgfmt as well. Set
MSGFMT_STRIP_MSGCTXT automatically for msgfmt before 0.15.

diffstat:

 mk/tools/gettext.mk |  40 +++++++++++++++++++++++++---------------
 mk/tools/msgfmt.sh  |   6 +++---
 2 files changed, 28 insertions(+), 18 deletions(-)

diffs (99 lines):

diff -r 6b2e3151de6f -r 47e6df093815 mk/tools/gettext.mk
--- a/mk/tools/gettext.mk       Sun Mar 22 17:51:48 2009 +0000
+++ b/mk/tools/gettext.mk       Sun Mar 22 17:57:58 2009 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: gettext.mk,v 1.10 2009/03/20 20:17:30 joerg Exp $
+# $NetBSD: gettext.mk,v 1.11 2009/03/22 17:57:58 joerg Exp $
 #
 # Copyright (c) 2006 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -60,7 +60,7 @@
 _TOOLS_USE_PKGSRC.msgfmt?=     no
 #
 # MSGFMT_STRIP_MSGID_PLURAL: Yes for msgfmt < 0.10.36
-# MSGFMT_STRIP_MSGCTX: To be set by packages
+# MSGFMT_STRIP_MSGCTXT: Yes for msgfmt < 0.15
 #
 # Determine if the platform-supplied msgfmt is new enough to support
 # the msgid_plural statement.  We need at least 0.10.36 for GNU msgfmt.
@@ -81,12 +81,22 @@
        fi
 .          endif
 .      endif
+.          if !defined(MSGFMT_STRIP_MSGCTXT)
+MSGFMT_STRIP_MSGCTXT!=                                                 \
+       if ${PKG_ADMIN} pmatch "gettext>=0.15"                          \
+                       gettext-${_TOOLS_VERSION.msgfmt:Q}; then        \
+               ${ECHO} no;                                             \
+       else                                                            \
+               ${ECHO} yes;                                            \
+       fi
+.          endif
+.      endif
 .    else
 _TOOLS_USE_PKGSRC.msgfmt=      yes
 .    endif
 MSGFMT_STRIP_MSGID_PLURAL?=    no
-MSGFMT_STRIP_MSGCTX?=          no
-.if ${MSGFMT_STRIP_MSGID_PLURAL} == "yes" || ${MSGFMT_STRIP_MSGCTX} == "yes"
+MSGFMT_STRIP_MSGCTXT?=         yes # pkgsrc version is too old
+.if ${MSGFMT_STRIP_MSGID_PLURAL} == "yes" || ${MSGFMT_STRIP_MSGCTXT} == "yes"
 _TOOLS_USE_MSGFMT_SH=          yes
 .else
 _TOOLS_USE_MSGFMT_SH=          no
@@ -103,22 +113,22 @@
 _TOOLS_USE_PKGSRC.msgfmt=      yes
 .    endif
 
-.    if defined(_TOOLS_USE_MSGFMT_SH) && \
-          !empty(_TOOLS_USE_MSGFMT_SH:M[yY][eE][sS])
-USE_TOOLS+=            awk sh
-TOOLS_PATH.msgfmt=     ${PKGSRCDIR}/mk/tools/msgfmt.sh
-TOOLS_SCRIPT.msgfmt=   AWK=${TOOLS_AWK:Q} CAT=${TOOLS_CAT:Q}           \
-                       MSGFMT=${TOOLS_PLATFORM.msgfmt:Q}               \
-                       PKGSRCDIR=${PKGSRCDIR:Q}                        \
-                       MSGFMT_STRIP_MSGID_PLURAL=${MSGFMT_STRIP_MSGID_PLURAL} \
-                       MSGFMT_STRIP_MSGCTX=${MSGFMT_STRIP_MSGCTX} \
-                       ${TOOLS_SH} ${TOOLS_PATH.msgfmt} "$$@"
-.    elif !empty(_TOOLS_USE_PKGSRC.msgfmt:M[yY][eE][sS])
+.    if !empty(_TOOLS_USE_PKGSRC.msgfmt:M[yY][eE][sS])
 TOOLS_CREATE+=         msgfmt
 TOOLS_DEPENDS.msgfmt?= ${_TOOLS_DEP.gettext-tools}:../../devel/gettext-tools
 TOOLS_FIND_PREFIX+=    TOOLS_PREFIX.msgfmt=${TOOLS_DEPENDS.msgfmt:C/:.*//}
 TOOLS_PATH.msgfmt=     ${TOOLS_PREFIX.msgfmt}/bin/msgfmt
 .    endif
+
+.    if !empty(_TOOLS_USE_MSGFMT_SH:M[yY][eE][sS])
+USE_TOOLS+=            awk sh
+TOOLS_SCRIPT.msgfmt=   AWK=${TOOLS_AWK:Q} CAT=${TOOLS_CAT:Q}           \
+                       MSGFMT=${TOOLS_PATH.msgfmt:Q}           \
+                       PKGSRCDIR=${PKGSRCDIR:Q}                        \
+                       MSGFMT_STRIP_MSGID_PLURAL=${MSGFMT_STRIP_MSGID_PLURAL} \
+                       MSGFMT_STRIP_MSGCTXT=${MSGFMT_STRIP_MSGCTXT} \
+                       ${TOOLS_SH} ${PKGSRCDIR}/mk/tools/msgfmt.sh "$$@"
+.    endif
 .  endif
 .endif
 
diff -r 6b2e3151de6f -r 47e6df093815 mk/tools/msgfmt.sh
--- a/mk/tools/msgfmt.sh        Sun Mar 22 17:51:48 2009 +0000
+++ b/mk/tools/msgfmt.sh        Sun Mar 22 17:57:58 2009 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: msgfmt.sh,v 1.30 2009/03/20 16:13:02 joerg Exp $
+# $NetBSD: msgfmt.sh,v 1.31 2009/03/22 17:57:58 joerg Exp $
 #
 # Copyright (c) 2006 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -159,8 +159,8 @@
 fi
 
 ${CAT} $pofile | \
-if test "${MSGFMT_STRIP_MSGCTX}" = "yes"; then
-       ${AWK} -f ${PKGSRCDIR}/mk/tools/msgfmt-msgctx.awk
+if test "${MSGFMT_STRIP_MSGCTXT}" = "yes"; then
+       ${AWK} -f ${PKGSRCDIR}/mk/tools/msgfmt-msgctxt.awk
 else
        ${CAT}
 fi | if test "$MSGFMT_STRIP_MSGID_PLURAL" = "yes"; then



Home | Main Index | Thread Index | Old Index