How can I determine if a function is available?

Daniel J. Luke dluke at
Tue Apr 10 06:20:33 PDT 2007

On Apr 10, 2007, at 2:48 AM, Ryan Schmidt wrote:
> If I do that, how can I avoid each port (php5-apache2, php5- 
> fastcgi, etc.) having to download the php5 source again?

By setting distname and dist_subdir

(like the apr port used to do to share the apache2 distfile: 


> I'm not sure that making separate ports is the best strategy. The  
> FastCGI version of PHP is not a separate software package. Rather,  
> it's just one of the many ways in which PHP can be installed. It's  
> a variation, a variant. And it seems most logical that it be  
> implemented in MacPorts in that way, as a variant.

of course, the downside of variants is that nothing can depend on  
them being there (which is why, for instance, the various subversion  
bindings ports are not implemented as variants, even though the  
current setup requires lots of extra build time which is otherwise  

> Isn't there a way in tcl to detect if a certain function exists?

I'm not sure if there is ... I would have to look it up.

... but even if there was, the point Landon was trying to make (I  
think) was that that was private/internal API that ports shouldn't be  
using. If there's really no good way to do what needs to be done some  
other way with the portfile, then we should enhance base/ to provide  
hooks for it instead of using command_exec.

> I note, by the way, that there are several other ports already  
> using the "command" command, which will break when MacPorts 1.5 (or  
> whatever version) is released which removes the "command" command:
> dports $ grep '\[command' */*/Portfile
> aqua/radassist/Portfile:        system "[command patch] < \"$ 
> {workpath}/patch-darwinports\""
> devel/curlhandle/Portfile:      system "[command build]"
> devel/libsdl-framework/Portfile:           system "[command build]"
> net/nefu/Portfile:      system "[command build]"
> textproc/gpsbabel/Portfile:                     system "[command  
> build]"

These should probably be fixed.

Daniel J. Luke
| *---------------- dluke at ----------------* |
| *-------------- -------------* |
|   Opinions expressed are mine and do not necessarily   |
|          reflect the opinions of my employer.          |

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url :

More information about the macports-dev mailing list