Saturday, November 30, 2019

Re: gettext-tools poisoning; allow LIB_DEPENDS

On Sat, Nov 30, 2019 at 11:18:51AM +0100, Jeremie Courreges-Anglas wrote:
> On Fri, Nov 29 2019, Stuart Henderson <stu@spacehopper.org> wrote:
> > Currently we require BUILD_DEPENDS to avoid tripping the (very useful)
> > poisoning that we have to detect ports with a missing dependency on
> > gettext-tools. This used to be fine, but now gettext-tools includes
> > libraries, a port may have LIB_DEPENDS instead of BUILD_DEPENDS.
> >
> > We could just require that those ports list a redundant BUILD_DEPENDS
> > as well as the LIB_DEPENDS, but it's easy enough to handle the simple
> > (i.e. not multi-packages) case.
> >
> > OK or is there a better idea?
>
> I like the "required in BUILD_DEPENDS" approach, it's a simple rule that
> doesn't introduce another subtle difference between multi-packages and
> non-multi-packages ports. Maybe making the error message more explicit
> would be enough?
>
> (Suggestion below, feel free to find a better wording.)
>
>
> Index: bsd.port.mk
> ===================================================================
> RCS file: /cvs/ports/infrastructure/mk/bsd.port.mk,v
> retrieving revision 1.1505
> diff -u -p -r1.1505 bsd.port.mk
> --- bsd.port.mk 26 Nov 2019 11:49:02 -0000 1.1505
> +++ bsd.port.mk 30 Nov 2019 10:14:44 -0000
> @@ -2608,7 +2608,7 @@ ${_WRKDIR_COOKIE}:
> .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\
> + echo "*** $$0 was called without gettext-tools dependency in BUILD_DEPENDS ***" >&2\n\
> exit 1\n' ${_PREDIR} ${WRKDIR}/bin/msgfmt
> @${_PBUILD} chmod 555 ${WRKDIR}/bin/msgfmt
> . for name in msgcat msginit autopoint xgettext gettextize
>

Or, since you're inside bsd.port.mk, you can use internals.

Specifically, what you're looking for is _BUILDLIB_DEPENDS

No comments:

Post a Comment