tech-pkg archive

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

Re: xgettext with UI files support



Hi,

From: Ryo ONODERA <ryo_on%yk.rim.or.jp@localhost>, Date: Tue, 16 Jun 2015 08:21:52 +0900 (JST)

> XGETTEXT_RED is too specific. GETTEXT_REQD is more general.
> 
> I will create patches for GETTEXT_REQD.
> 
> Any other opinion or suggestion?

Here is new patches, this introduces GETTEXT_REQD.

Index: mk/tools/gettext.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/tools/gettext.mk,v
retrieving revision 1.20
diff -u -r1.20 gettext.mk
--- mk/tools/gettext.mk	16 Feb 2015 10:40:40 -0000	1.20
+++ mk/tools/gettext.mk	16 Jun 2015 02:55:53 -0000
@@ -132,9 +132,56 @@
 .  endif
 .endif
 
+###
+### Get highest version of gettext from GETTEXT_REQD.
+###
+_GETTEXT_STRICTEST_REQD?=   none
+.for _version_ in ${GETTEXT_REQD}
+.  for _pkg_ in gettext-${_version_}
+.    if ${_GETTEXT_STRICTEST_REQD} == "none"
+_GETTEXT_PKG_SATISFIES_DEP=         YES
+.      for _vers_ in ${GETTEXT_REQD}
+.        if !empty(_GETTEXT_PKG_SATISFIES_DEP:M[yY][eE][sS])
+_GETTEXT_PKG_SATISFIES_DEP!=        \
+        if ${PKG_ADMIN} pmatch 'gettext>=${_vers_}' ${_pkg_} 		\
+		2>/dev/null; then					\
+		${ECHO} "YES";						\
+	else								\
+		${ECHO} "NO";						\
+	fi
+.        endif
+.      endfor
+.      if !empty(_GETTEXT_PKG_SATISFIES_DEP:M[yY][eE][sS])
+_GETTEXT_STRICTEST_REQD=	${_version_}
+.      endif
+.    endif
+.  endfor
+.endfor
+_GETTEXT_REQD=      ${_GETTEXT_STRICTEST_REQD}
+
+##
+## Use xgettext to determine gettext's version
+##
+_TOOLS_VERSION.xgettext!=	${TOOLS_PLATFORM.xgettext} --version |	\
+				${AWK} '{ print $$4; exit }'
+
+##
+## If non-base gettext is required, REQUIRE_GETTEXT is set as yes.
+##
+.if !defined(REQUIRE_GETTEXT)
+REQUIRE_GETTEXT!=						\
+	if ${PKG_ADMIN} pmatch "gettext>${_GETTEXT_STRICTEST_REQD}"	\
+			gettext-${_TOOLS_VERSION.xgettext:Q}; then	\
+		${ECHO} no;						\
+	else								\
+		${ECHO} yes;						\
+	fi
+.endif
+
 .for _t_ in ${_TOOLS.gettext-tools}
 .  if !defined(TOOLS_IGNORE.${_t_}) && !empty(USE_TOOLS:C/:.*//:M${_t_})
-.    if !empty(_TOOLS_USE_PKGSRC.msgfmt:M[yY][eE][sS])
+.    if !empty(_TOOLS_USE_PKGSRC.msgfmt:M[yY][eE][sS]) || \
+		!empty(REQUIRE_GETTEXT:M[Yy][Ee][Ss])
 _TOOLS_USE_PKGSRC.${_t_}=	yes
 .    elif defined(TOOLS_PLATFORM.${_t_}) && !empty(TOOLS_PLATFORM.${_t_})
 _TOOLS_USE_PKGSRC.${_t_}?=	no
Index: x11/gtk3/Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/x11/gtk3/Makefile,v
retrieving revision 1.64
diff -u -r1.64 Makefile
--- x11/gtk3/Makefile	15 Jun 2015 01:39:06 -0000	1.64
+++ x11/gtk3/Makefile	16 Jun 2015 02:55:53 -0000
@@ -13,12 +13,12 @@
 LICENSE=	gnu-lgpl-v2.1
 
 USE_PKGLOCALEDIR=	yes
-USE_TOOLS+=		gmake perl pkg-config bash
+USE_TOOLS+=		gmake perl pkg-config bash msgfmt xgettext
+GETTEXT_REQD+=		0.18.3
 USE_LANGUAGES=		c c++
 USE_LIBTOOL=		yes
 PTHREAD_AUTO_VARS=	yes
 BUILD_DEPENDS+=		gdbus-codegen-[0-9]*:../../devel/gdbus-codegen
-TOOL_DEPENDS+=		gettext-tools>=0.19.4nb1:../../devel/gettext-tools
 
 GNU_CONFIGURE=		yes
 # XXX there is a subtle bashism in "configure" or a bug in NetBSD's sh

--
Ryo ONODERA // ryo_on%yk.rim.or.jp@localhost
PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB  FD1B F404 27FA C7D1 15F3


Home | Main Index | Thread Index | Old Index