ports/116078: bsd.port.mk - Handling of PREFIX doesn't work as documented

Markus Hitter mah at jump-ing.de
Tue Sep 4 07:23:11 PDT 2007


Pav,

I took the freedom to put this onto the list for a broader  
participation.


Gentlemen,

it looks like the ports mechanism is incapable of building it's  
dependencies in some situations, especially if PREFIX is set.

I've already filed a bug about this topic at <http://www.freebsd.org/ 
cgi/query-pr.cgi?pr=116078>

After setting up a fresh (virtual) FreeBSD installation, I attempted  
to build some ports in a non-standard location for later inclusion  
into a tinybsd build script.

The experience is, if you build ports with PREFIX set, as described  
in the handbook, section 4.5.2.1, many builds fail because a port  
can't build it's own dependencies. More precisely, it builds all  
needed dependencies, but in the wrong place.

Jeremy Messenger, the libinconv maintainer confirmed this odd  
behavior and sees room for improvement as well.

While there are a few workarounds, like setting LOCALBASE as well or  
doing a "make depends" without PREFIX first, I sat down, investigated  
the issue and fixed it.


The patch is two lines only and works like a charme. The port it's  
self goes into $PREFIX, dependencies go into $LOCALBASE.

Obviously, the maintainers are unhappy with such an enhancement and  
strongly recommend to use one of the undocumented workarounds.

Please read on yourself, I'm eager to read your opinions:


Am 04.09.2007 um 15:17 schrieb Pav Lucistnik:

> The system works as designed

Then the design is needlessly limited.

> - when installing port with dependencies,
> you are supposed to define LOCALBASE to point to the place where
> dependencies are. Does not matter if they are currently installed or
> not.

So why is the mechanism building a dependency at all in this  
situation? Clearly, it only makes sense to build a dependency in a  
place where the port would find it later.

This is why I set "make PREFIX=${LOCALBASE} ..." for building  
dependencies. This small patch makes ports work as described in the  
makefile, removes the need for some extra actions and extra thoughts  
and I can't think of a situation where this leads to misbehavior. You  
still can set LOCALBASE to whatever you want getting the documented  
and expected results.

Another possible fix would be to disable dependency building at all  
in the case of PREFIX != LOCALBASE. Then, Dependencies exist already  
or the installation fails a lot earlier. Building useless  
dependencies is just a waste of resources.


Cheers,
Markus

- - - - - - - - - - - - - - - - - - -
Dipl. Ing. Markus Hitter
http://www.jump-ing.de/






More information about the freebsd-ports mailing list