Subject: Re: TOOLS_PREFIX and tools framework and missing tool
To: Jeremy C. Reed <>
From: Johnny C. Lam <>
List: tech-pkg
Date: 12/28/2005 09:00:53
Jeremy C. Reed wrote:
> Two questions:
> 1) I was looking at pkgsrc/mk/tools/ (and in revision 1.133) 
> and the line for x11-clients has "imake"
> .      if defined(X11_TYPE) && !empty(X11_TYPE:MXFree86)
> TOOLS_DEPENDS.${_t_}?=  XFree86-clients>=4.4.0:../../x11/XFree86-clients
> TOOLS_PATH.${_t_}=      ${TOOLS_PREFIX.${_t_}}/${X11ROOT_PREFIX}/bin/${_t_}
> (The following lines have xorg-clients.)
> May I change the line above to:
> TOOLS_FIND_PREFIX+=    TOOLS_PREFIX.${_t_}=XFree86-clients
> I am not sure if this is a copy-and-paste error or if it is meant to be 
> "imake".

Please commit your suggested change.  We will probably need to request a 

> 2) Also what should happen if a tool is missing? I added a bogus entry 
> to end of _TOOLS.x11-clients and then added it to USE_TOOLS in a 
> package. Nothing failed, although TOOLS_PATH.jcrtest was properly defined.
> Should the tools framework check if TOOLS_PATH.jcrtest exists?

No, I don't believe testing for existence is necessarily desired.  There 
are some values that you want to have set to the correct value even 
before the tools themselves are installed by pkgsrc (if they are 
installed via pkgsrc).  We could restrict the checks to a particular 
phase of the build to avoid running stat() for each tool for each 
invocation of make, but I haven't found a pressing need for this extra 
code yet.

> I am looking at this because I am about to commit the one addition of 
> "makepsres" to that _TOOLS.x11-clients. It may be useful for the package 
> build to fail when the TOOLS_PATH.makepsres is missing (when 
> USE_TOOLS+=makepsres and X11_TYPE is native) instead of failing later 
> during or after build.

Should the package fail if "makepsres" isn't present?  If so, then that 
is some secondary condition outside of the tools framework that you will 
have to impose on your package.  The tools framework gives a way to 
express which package can provide a tool that may be missing from the 
base system.  If X11_TYPE is "native", is there a way to get a makepsres 
tool from pkgsrc?  If not, then the tools framework as it's currently 
designed it isn't applicable here.  Can you be more specific about how 
your package uses makepsres?


	-- Johnny Lam <>