Re: To DEPEND on indirect dependencies or not to DEPEND

Bugs Beastie <[email protected]> Sun, 14 Jun 2026 16:32:16 +0200
Newsgroups gmane.os.freebsd.devel.ports
Message-ID <[email protected]>
Jun 14, 2026 06:07:18 Mark Millard <[email protected]>:

> On 6/13/26 20:21, Bugs Beastie wrote:
>> Hi ports@!
>>
>> Most probably the question was discussed a lot of times, but I have not found a definitive answer.
>>
>> If an app depends on libfoo that depends on libbar:
>> app -> libfoo -> libbar
>> Should the port of app add LIB_DEPENDS only on libfoo or on both libfoo and libbar?
>>
>> Simple example (outdated, but the first thing you see in Porter's Handbook): games/oneko is linked with the command
>>
>> cc -o oneko -L/usr/local/lib oneko.o -lXext -lX11 -lm -Wl,-rpath,/usr/local/lib
>>
>> suggesting direct dependencies libXext and libX11. However, ldd oneko gives
>>
>> libXext.so.6
>> libX11.so.6
>> libm.so.5
>> libc.so.7
>> libxcb.so.1
>> libthr.so.3
>> libsys.so.7
>> libXau.so.6
>> libXdmcp.so.6
>>
>> Of course, libXau, libXdmcp, and libxcb are coming from libX11. The port
>>
>> USES= imake xorg
>>
>> Additionally, should it just depend on direct dependencies
>>
>> USE_XORG= x11 xext
>>
>> or the full dependency list?
>>
>> USE_XORG= x11 xau xcb xdmcp xext
>>
>> More complicated example: cad/freecad depends on cad/opencascade that depends on multimedia/ffmpeg4 with default options (can be switched off).
>>
>> Should freecad port LIB_DEPENDS on ffmpeg4, as it is now, or should it track opencascade options, or should it not depend on ffmpeg4 at all?
>>
>> Thank you in advance,
>> Alexey
>>
>>
>
> In other words(?): Where does the responsibility for handling the
> transitive closure of the dependencies reside?
>
Yes! More in the sense what is the current policy for the newly created ports?

I have a feeling that the answer changes over the time as the available infrastructure changes. I also think that both the current ports framework and pkg(-ng) can handle this transitive closure without manually unfolding the dependency tree in each port.

But let's wait for the answer of ports gurus!