depends_lib, depends_build, depends_run, oh my

Ryan Schmidt ryandesign at macports.org
Tue Aug 7 00:56:47 PDT 2007


On Aug 6, 2007, at 17:37, Mark Duling wrote:

> Kevin Van Vechten writes:
>
>>>> Why do we have depends_lib, depends_build and depends_run? Why not
>>>> just a single "depends"? Why does it matter which phase requires  
>>>> the
>>>> other software? Isn't it enough to know that the other software is
>>>> required at some point, and so MacPorts should install that other
>>>> software first?
>>
>> Depends_build dependencies are only needed if you're actually
>> building the software.  They're not needed at all once the software
>> is built and installed.  (Think of gcc).
>>
>> Depends_run dependencies are needed when the software is run, but not
>> necessarily to build the software.  (Think of a program that does a
>> fork/exec of /usr/bin/foo at runtime).
>>
>> Depends_lib dependencies are needed both at build time (for headers
>> and libraries to link against) and at run time (to provide necessary
>> code).
>>
>> For binary packages, you'd only need to consider depends_lib +
>> depends_run.  Even for those building their own software, it makes
>> sense to distinguish since it gives a better sense of what uninstalls
>> might break (i.e. gcc is a depends_build for most projects, but
>> uninstalling it wouldn't interfere with many ports operation).
>
> Thanks, Kevin.  I'll review this more closely in a bit and document  
> it in
> the new guide.

Curiously, even though I fixed the four ports I had installed that  
required pkgconfig to list it as a build dependency instead of a  
library, "port uninstall" still won't let me uninstall pkgconfig,  
saying those four ports depend on it.

Oh, I see, I have to reinstall those four ports first.

So, for the documentation, another consequence is: if you try to  
"port uninstall" something, it will prevent you from doing so if any  
port depends on it via depends_lib, but doesn't complain if a port  
depends on it via depends_build (and I don't know about depends_run).





More information about the macports-dev mailing list