On 2016/10/17 17:54, Antoine Jacoutot wrote:
> On Mon, Oct 17, 2016 at 04:03:16PM +0100, Stuart Henderson wrote:
> > On 2016/10/17 16:41, Antoine Jacoutot wrote:
> > > On Mon, Oct 17, 2016 at 03:20:37PM +0100, Stuart Henderson wrote:
> > > > On 2016/10/17 13:49, Jeremie Courreges-Anglas wrote:
> > > > > Stuart Henderson <[email protected]> writes:
> > > > > 
> > > > > > I'm going to do a bulk build with this to see if it shakes anything 
> > > > > > out.
> > > > > > Any comments on whether it's worth committing?
> > > > > 
> > > > > I like the idea, but it currently doesn't behave as one would expect.
> > > > > See for example x11/xpad, which has
> > > > > 
> > > > >   MODULES=        textproc/intltool
> > > > > 
> > > > > The patch shouldn't change anything since intltool brings in
> > > > > gettext-tools, but:
> > > > 
> > > > Thanks - Antoine pointed out that this will apply to GNOME as well.
> > > > 
> > > > We could check for multiple alternative ports in BUILD_DEPENDS, but
> > > > this wouldn't fit nicely with Marc's suggestion to make the framework
> > > > more general, so how about adding gettext-tools to intltool.port.mk?
> > > 
> > > If there is no other way...
> > 
> > The two options are
> > 
> > +.if !defined(BUILD_DEPENDS) || !${BUILD_DEPENDS:Mdevel/gettext-tools} && \
> > +           !${BUILD_DEPENDS:Mtextproc/intltool}
> 
> This has my vote.
> Less magic imho.

So, this has survived a dpb run (actually several runs as I had temporarily
forgotten about it) - OK?

Index: bsd.port.mk
===================================================================
RCS file: /cvs/ports/infrastructure/mk/bsd.port.mk,v
retrieving revision 1.1322
diff -u -p -r1.1322 bsd.port.mk
--- bsd.port.mk 6 Sep 2016 10:31:12 -0000       1.1322
+++ bsd.port.mk 18 Oct 2016 13:56:03 -0000
@@ -2469,6 +2469,17 @@ ${_WRKDIR_COOKIE}:
 .if !empty(WRKDIR_LINKNAME)
        @ln -sf ${WRKDIR} ${.CURDIR}/${WRKDIR_LINKNAME}
 .endif
+# poison some common gettext-tools binaries
+.if !defined(BUILD_DEPENDS) || !${BUILD_DEPENDS:Mdevel/gettext-tools} && \
+               !${BUILD_DEPENDS:M*textproc/intltool}
+       printf '#!/bin/sh\n\
+               echo "*** $$0 was called without gettext-tools dependency ***" 
>&2\n\
+               exit 1\n' > ${WRKDIR}/bin/msgfmt
+       chmod 555 ${WRKDIR}/bin/msgfmt
+.  for name in msgcat msginit
+       @ln -sf msgfmt ${WRKDIR}/bin/${name}
+.  endfor
+.endif
        @${_MAKE_COOKIE} $@
 
 ${_EXTRACT_COOKIE}: ${_WRKDIR_COOKIE}

Reply via email to