Library numbers in LIB_DEPENDS considered harmful (Re: recent portrevision bump for libvpx)

Zhihao Yuan lichray at gmail.com
Sat Feb 18 01:35:22 UTC 2012


On Feb 17, 2012 5:41 PM, "Mikhail T." <mi+thun at aldan.algebra.com> wrote:
>
> On 17.02.2012 17:05, Zhihao Yuan wrote:
>>
>> LIB_DEPENDS= png.6: or =png: does not affect how the lib got linked.
>
> Allow me to rephrase my argument from a different perspective...
>
> The language used in our ports' Makefiles is, largely, declarative --
various things are declared and then bsd.port.mk (and friends) interpret
them to do the right thing.
>
> Each declaration is meant to say something, so let's examine, what a
LIB_DEPENDS entry declares:
>>
>> LIB_DEPENDS=    foo.V:${PORTSDIR}/cat/libfoo
>
> The above line says, that this port needs a shared library libfoo.so.V to
be installed. It also says, how to install it, if it is not already present
at build-time.
>
> If, in fact, the current port does not care, which version of libfoo is
uses -- and most software does not -- then declaring an explicit V is
wrong: it gratuitously tightens the build-time requirements. Unless a
particular version is, indeed, required, the above line should read simply:
>>
>> LIB_DEPENDS=    foo:${PORTSDIR}/cat/libfoo
>
> Let's say, you sent someone to buy a bottle of dry red wine in a store.
Wouldn't you be (unpleasantly) surprised, if he returned empty-handed,
because the store did not have any Californian Pinot Noir of the 2003
vintage? Huh? You did not ask for Pinot Noir. You did not specify the
origin nor the year either -- why did not he get something else that
matched your much wider and easier-to-satisfy requirement: "dry red wine"?

So what, I come to your bar and say "10 year red wine" in1998, you give me
a 1988 one. And I went your place again in 2008, and say "same wine", and
you give me a 1998 one?

>
> A similar thing happens here: if the, say, vlc software needs libx264 to
be available at build time, the FreeBSD port of vlc should not add a
requirement of a particular version to that.
>>
>> -mi


More information about the freebsd-ports mailing list