NetBSD-Users archive

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

Re: ports

On Fri, Aug 31, 2012 at 11:55:13AM -0400, Martin S. Weber wrote:
> Probably that manually including PHP_VERSION_DEFAULT=54 after explicitly
> going to $PKGSRCDIR/lang/php54 and typing 'make install and get me some 
> coffee'
> is not intuitive, it could, and maybe should, be done automatically. At least
> that's what I'm taking away from this tale.

Let's explore the problem here.  We're looking to convey the simple fact
"I prefer PHP 5.4 among the many PHP versions you have available" to the
pkgsrc system when it goes about its business.  That fact has to live

The first option is to explicitly declare this fact on the given system
in a known place.  In the case of pkgsrc, this is /etc/mk.conf.  (The
really entertaining bit is that /etc/mk.conf isn't even at all pkgsrc
specific, but simply something that bmake looks at all the time.  If you
were to ever inspect the /etc/mk.conf I ship around to my systems, you'd
see all the pkgsrc specific things cowering in a block of '.ifdef

The second option is to try to imply this fact from the state of the
system on which the build is being conducted.  How?  Looking for a magic
file that gets touched someplace?  Executing something like 'php
--version'?  Some goofy thing like pkg-config?  There's a myriad
possibilities, none of them consistent -- and all of which will no doubt
be explored by a variety of packages.  I.e. a maintenance nightmare.

Which says nothing for completely obliterating the possibility of easily
allowing things like: the build of binary packages without intent of
installation, e.g. pbulk; shipping around a single, consistent
configuration among multiple systems; the future possibility of
cross-building, etc..

A hybrid option, such that making php54 edits the /etc/mk.conf file?  Or
perhaps a /etc/ which is maintained dynamically?  Could,
sure.  And then deal with reconciling them.  Could even symlink it to
/dev/null if you don't want to use that functionality.

Or, you could just explicitly declare your preference in /etc/mk.conf.

All that aside: I'm no apologist for pkgsrc.  I frankly think it's
pretty awful and not a little embarrassing.  But this isn't one of the
things it gets entirely wrong.

. ___ ___  .   .  ___
.  \    /  |\  |\ \
.  _\_ /__ |-\ |-\ \__

Home | Main Index | Thread Index | Old Index