The extension loop adds each extension's library dependencies with
LIB_DEPENDS+= ${PORT_OPTIONS:M${opt}:?${${opt}_LIB_DEPENDS}:}
The intent is "if this extension's option is selected, append its
<OPT>_LIB_DEPENDS", mirroring the two lines above it. Those work because
${PORT_OPTIONS:M${opt}:S/...} is empty-in-empty-out, but :? does not
behave the same way: per make(1), it evaluates the variable *name* -- not
the value the preceding modifiers produced -- as a conditional
expression. The condition here is therefore the bare word PORT_OPTIONS,
which is always true, so the true branch is always taken:
PORT_OPTIONS= FOO BAR
${PORT_OPTIONS:MAWS} -> ""
${PORT_OPTIONS:MAWS:?${AWS_LIB_DEPENDS}:} -> libaws.so:devel/aws
As a result AVRO_LIB_DEPENDS (avro-c, jansson, snappy), AWS_LIB_DEPENDS
(aws-sdk-cpp) and ODBC_SCANNER_LIB_DEPENDS (unixODBC) are added to every
build, even though all three options are marked BROKEN and are off by
default. Besides the needless dependencies, this makes the port
unbuildable in trees where devel/aws-sdk-cpp is unavailable ๐
and it takes
every consumer of databases/duckdb down with it.
The line is not needed in the first place: <OPT>_LIB_DEPENDS is a
standard options helper, and bsd.options.mk already applies it for the
selected options, group options included. Drop it and bump
PORTREVISION, since the dependency list of the default package changes.