HAVE_GNOME vs. bsd.ports.options.mk

Michael Gmelin freebsd at grem.de
Wed Oct 10 15:52:50 UTC 2012

On Wed, 10 Oct 2012 16:40:39 +0100
Chris Rees <utisoft at gmail.com> wrote:

> On 10 Oct 2012 11:19, "Michael Gmelin" <freebsd at grem.de> wrote:
> >
> > Hi
> >
> > I noticed that HAVE_GNOME doesn't work properly with
> > bsd.ports.options.mk yet, so
> >
> > .include <bsd.port.options.mk>
> > .if ${HAVE_GNOME:Mgnomelibs}!=""
> > # ...
> > .endif
> > .include <bsd.port.mk>
> >
> > won't work, while this
> >
> > .include <bsd.port.pre.mk>
> > .if ${HAVE_GNOME:Mgnomelibs}!=""
> > # ...
> > .endif
> > .include <bsd.port.post.mk>
> >
> > does.
> >
> > AFAIK bsd.port.pre.mk/bsd.port.post.mk should be replaced by
> > bsd.port.options.mk/bsd.port.mk in the long term, so having this
> > work or documenting a workaround would help port maintainers who are
> > in the process of updating the port structure.
> No. They are two separate methods with two different reasons for
> using them.
> You have discovered a case of pre.mk being the correct one to use,
> which is unusual :)
> Chris
> _______________________________________________
> freebsd-ports at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-ports
> To unsubscribe, send any mail to
> "freebsd-ports-unsubscribe at freebsd.org"

In which case the Porter's Handbook gives little to no advice what the
actual differences are.

The only time bsd.port.options.mk is mentioned is in the context of
OptionsNG ( where it says:

"OPTIONS definitions must appear before the inclusion of
bsd.port.options.mk. The PORT_OPTIONS variable can only be tested after
the inclusion of bsd.port.options.mk. Inclusion of bsd.port.pre.mk can
be used instead, too, and is still widely used in ports written before
the introduction of bsd.port.options.mk. But be aware that some
variables will not work as expected after the inclusion of
bsd.port.pre.mk, typically some USE_* flags."

Which sounds to me like: "Yes, you can still use bsd.port.pre.mk, but
it's the old way of doing things and expect bad things to happen."

It would probably make sense to refine that section in the Porter's
Handbook - I know that this is a moving target right now, but since it
is it either needs to be adapted or at least fact that this is the case
should be stated somewhere (potentially with a link to the wiki).

I would be willing to propose a refined version of this section in the
Porter's Handbook - might take me a while though since I'm pretty busy
at the moment. But if nobody else has the resources I would do it myself
for the sake of making things easier for maintainers.


Michael Gmelin

More information about the freebsd-ports mailing list