ports include /etc/src.conf? i.e. graphics/libfpx

Peter Pentchev roam at ringlet.net
Thu Feb 14 14:34:55 UTC 2013

On Thu, Feb 14, 2013 at 01:55:58PM +0000, Tom Evans wrote:
> On Thu, Feb 14, 2013 at 1:12 PM, Mikhail T. <mi+thun at aldan.algebra.com> wrote:
> > I may sound defensive here, but I'll still repeat, that "this singular port"
> > (and I do, in fact, have other ones like it) started using bsd.lib.mk 5
> > years before src.conf (and its man-page) was added to the tree.
> >
> > -mi
> This is true. But what is the bug, that the port's Makefile.bsd was
> not updated on the introduction of src.conf to DTRT (and no-one
> noticed for 7 years), or that the purpose of src.conf has been
> mistakenly documented for 7 years?

To be brutally honest, and at some cost to myself, I would have to say
"both" :(

There are some people - and some of them are well-respected long-term
Free-and-other-BSD developers - who are of the opinion that the
/usr/share/mk/bsd.*.mk infrastructure is meant for the base system build
only.  I do indeed understand this point of view - and from this point
of view, the port's Makefile.bsd is buggy because it allegedly abuses
internal parts of the base system.

At the same time (see the last paragraph) I do quite understand the
other point of view - that FreeBSD is not merely an operating system or
a combination of an operating system and third-party software adapted to
work on it consistently, but that it is a software distribution (what,
after all, does "BSD" mean? :).  Hence, its source code is meant to be
adopted, adapted and used in everyone's software projects when everyone
feels like it (under the conditions of the respective licenses, of
course).  If this is taken to mean that "if we have bsd.*.mk, we are
free to use it", then it will turn out that bsd.*.mk is not really an
internal part of the base system, and that the documentation for
src.conf maybe ought to mention that the settings there may affect the
build of third-party programs that use the bsd.*.mk infrastructure (and
of course there would be no way to list all such programs).  However...

However, there is then the argument of "well, if you want to use the
bsd.*.mk infrastructure, then why don't you just copy it into your
project and include it from there - just like many, many projects do
with, say, the sys/queue.h header, or parts of libc, or whatever?"
And it is, indeed, a very good argument, since this is how a software
distribution's parts are supposed to be used - you copy them into your
project and use them even when they are not available on the host
system.  So one might argue that the port is, indeed, buggy, that the
src.conf documentation is, indeed, correct, and that the proper way for
people to use the bsd.*.mk infrastructure in their own projects is to
"take a snapshot", remove the "include /etc/rc.conf" part, change the
include statements to be relative to the current directory or something,
and then include the bsd.*.mk files from their own project's source
directory.  I'm not sure if there are any projects that actually do
that, but IMHO this is the correct way to do it :)

Now, in this particular case, we have a slightly different situation
when the code that uses the bsd.*.mk infrastructure is not part of the
upstream software source code, but is part of the FreeBSD port - that
is, it is supposed to work mostly on FreeBSD, and the port is supposed
to "keep up with the times" and work around any incompatible bsd.*.mk
changes.  So... with all due respect to Mikhail, I do believe that in
this case the port's Makefile.bsd ought to add the "without src.conf"
definition before including the bsd.*.mk parts.

The "at some cost to myself" part at the start of this message is
because some of my released software uses the bsd.prog.mk/bsd.lib.mk
infrastructure, with the unspoken assumption that I'll update it when
the bsd.*.mk infrastructure changes in incompatible ways (this has not
really happened for the past twelve years, mostly because my Makefiles
do not try to use NO_MAN or similar options - they define everything
they need, and it is not a whole lot :)  So... yeah, I've been lazy, and
yeah, some weird src.conf settings might confuse the build of some of my
software on FreeBSD.  And, of course, my software might very well not
build at all on other BSD-like host platforms.  But... yeah, well, I've
been lazy ;)

...thanks for reading so far, I guess :)


Peter Pentchev	roam at ringlet.net roam at FreeBSD.org p.penchev at storpool.com
PGP key:	http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint 2EE7 A7A5 17FC 124C F115  C354 651E EFB0 2527 DF13
When you are not looking at it, this sentence is in Spanish.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-current/attachments/20130214/90f9c109/attachment.sig>

More information about the freebsd-current mailing list