Opened 4 years ago

Closed 2 years ago

#60455 closed defect (fixed)

rtmpdump: librtmp.pc makes others link with libz, libgnutls, libgmp, libnettle, libhogweed

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.6.2
Keywords: Cc:
Port: rtmpdump

Description

Anything that asks pkg-config how to link to librtmp will be told that it also needs to link with libz, libgnutls, libgmp, libnettle, and nettle's libhogweed:

$ pkg-config librtmp --libs
-L/opt/local/lib -lrtmp -lz -lgmp -lgnutls -lhogweed -lnettle

From the MacPorts perspective, it means that for every port where we declare a library dependency on rtmpdump, we also need to declare a dependency on zlib, gmp, gnutls, and nettle. And we need to revbump the port anytime one of those ports' libraries change. For example, nettle's library versions recently changed, so my ffmpeg broke, because I had it installed with its +librtmp variant, but that variant does not mention a dependency on nettle.

Is this all really necessary? librtmp is itself linked with libz, libgnutls, libgmp, libnettle, and libhogweed, but don't the ports that want to link with librtmp only need to link with librtmp? Isn't forcing other ports to link with those other libraries overlinking?

$ cat   /opt/local/lib/pkgconfig/librtmp.pc
prefix=/opt/local
exec_prefix=${prefix}
libdir=/opt/local/lib
incdir=${prefix}/include

Name: librtmp
Description: RTMP implementation
Version: 2.4
Requires: gnutls,hogweed,nettle
URL: http://rtmpdump.mplayerhq.hu
Libs: -L${libdir} -lrtmp -lz -lgmp
Libs.private:
Cflags: -I${incdir}

Change History (2)

comment:1 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

I had already added a comment about a related issue to the rtmpdump port last year:

# The Makefile explicitly links with these additional libraries when
# gnutls is used. This may be a case of overlinking; the correct thing
# to do may be to fix the Makefile not to link to those libraries,
# instead of adding these dependencies.
depends_lib-append  port:gmp \
                    port:nettle \
                    port:zlib

comment:2 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: set to ryandesign
Resolution: fixed
Status: newclosed

In 300260f7db93cea663b821ca2f9e5f495c9a666d/macports-ports (master):

rtmpdump: Update to 2.4-20210219; fix overlinking

Closes: #60455

Note: See TracTickets for help on using tickets.