Questions on dependencies

Joshua Root jmr at macports.org
Thu Oct 31 16:27:04 PDT 2013


On 2013-11-1 05:54 , Peter Danecek wrote:
> 
> Hi all,
> 
> I'm somewhat puzzled with the dependencies of some ports, and I realise the I lack some basic understanding.
> 
> (1) py-cython
> 
> From what I understand, build dependencies are required during the build, but can be removed later. Also they are not required for installation of prebuilt packages. But I have no clear idea if `py-cython` is a build dependency or a lib dependency. Looking through the existing ports, I find both. 
> 
> Is `py??-cython` required after the build?

A lot of software will use cython at build time only, but it's possible
that some uses it at runtime. You would have to check how it is used in
your specific case.

> (2) python package dependencies
> 
> Intuitively, I would say that most python package dependencies were lib dependencies. But they actually may install without, right? So is it okay to declare them lib dependencies or might it be better to make them runtime dependencies?

If they are needed at build time and runtime, use depends_lib. If they
are only needed at runtime, use depends_run.

> (3) What exactly makes a lib a dependency in Macports?

See above.

> I have the situation that some software depend on some library, its headers are included it is linked against it. Okay, here the situation is clear. But this lib may again depend on other libs, but my software does not directly reference/call these libraries. (It may need to link against it, not completely clear to me). Is this library a dependency for Macports or would I rely on the fact, that the library I am referencing directly, would have these other libraries as dependencies?

It's safest to have a port explicitly depend on everything that the
software installed by that port uses directly. That way, if the
dependencies change their dependencies at some point, you don't have the
possibility of something you need disappearing from your nominal
dependency tree.

For example, if the software calls libpng functions, you of course must
depend on libpng. Libpng internally calls zlib functions, but you don't
need to list a dependency on zlib unless the port also calls zlib
functions directly.

- Josh


More information about the macports-dev mailing list