Ticket #15161 (closed enhancement: fixed)
depends_* should have more useful semantics
|Reported by:||jmr@…||Owned by:||macports-tickets@…|
The depends_lib, depends_build and depends_run dependency classes don't currently do what a typical new portfile author would expect. Presumably the different classes exist so that end users installing binaries can avoid installing ports that are only needed to build the port they are interested in, and not to run it. (Possibly also so that the build box that makes the binary can avoid installing ports that are only needed at runtime.) However, the actual behaviour is this (from the portfile(7) manual):
depends_build List of dependencies to check before build, destroot, install, and package targets. depends_run List of dependencies to check before destroot, install and package targets. depends_lib List of dependencies to check before configure, build, destroot, install, and package targets.
This seems to match up with what happens in mportdepends in macports.tcl. The Guide gives the dep classes some additional meanings, e.g. "Build dependencies are needed when software is compiled, but not needed at all once the software is compiled and installed," but there appears to be nothing to back this up in the code.
The way the system currently works means that you can't avoid installing build-time-only dependencies when you install from a binary package. Even if that part worked, you still couldn't have deps that are needed at configure time but not at runtime (e.g. pkgconfig), because depends_build is not checked before configure.
I would suggest changing the meanings to the following:
- depends_lib: these dependencies must be present for all phases of port building and installation (fetch through to activate).
- depends_build: these dependencies must be present for fetch through to destroot. (Note that this adds the ability to use software from dependencies in the fetch, extract and patch phases, as required by e.g. python23.)
- depends_run: these dependencies are only needed when the port is installed. (and also for test?)