|Summary:||Problems with implicit library dependencies introduced by gnome ports|
|Product:||Ports & Packages||Reporter:||Dmitry Marakasov <amdmi3>|
|Component:||Individual Port(s)||Assignee:||freebsd-gnome mailing list <gnome>|
|Severity:||Affects Many People||CC:||emaste, gnome, portmgr, tijl, w.schwarzenfeld|
Description Dmitry Marakasov 2016-05-28 15:13:54 UTC
Gnome libraries add a lot of implicit library dependencies via their pkg-config files: % pkg-config --libs gtk+-2.0 -L/usr/local/lib -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lpthread -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lintl -lfontconfig -lfreetype These libraries are now detected as unlisted dependencies: Error: /usr/local/lib/libgoocanvas.so.3.5.0 is linked to /usr/local/lib/libgdk_pixbuf-2.0.so.0 from graphics/gdk-pixbuf2 but it is not declared as a dependency Warning: you need USE_GNOME+=gdkpixbuf2 Error: /usr/local/lib/libgoocanvas.so.3.5.0 is linked to /usr/local/lib/libfontconfig.so.1 from x11-fonts/fontconfig but it is not declared as a dependency Warning: you need LIB_DEPENDS+=libfontconfig.so:x11-fonts/fontconfig Error: /usr/local/lib/libgoocanvas.so.3.5.0 is linked to /usr/local/lib/libfreetype.so.6 from print/freetype2 but it is not declared as a dependency Warning: you need LIB_DEPENDS+=libfreetype.so:print/freetype2 Error: /usr/local/lib/libgoocanvas.so.3.5.0 is linked to /usr/local/lib/libcairo.so.2 from graphics/cairo but it is not declared as a dependency Warning: you need USE_GNOME+=cairo Error: /usr/local/lib/libgoocanvas.so.3.5.0 is linked to /usr/local/lib/libintl.so.8 from devel/gettext-runtime but it is not declared as a dependency Warning: you need USES+=gettext This should be fixed ASAP if we don't want many ports to be polluted with these bogus dependencies. Instead, these additional dependencies should be added implicitly by USE_GNOME parts.
Comment 1 Tijl Coosemans 2016-05-30 19:48:50 UTC
Yes they should be added via USE_GNOME, but please look at the .pc file to determine the dependencies instead of using "pkg-config --libs".
Comment 2 Dmitry Marakasov 2016-05-30 20:47:26 UTC
(In reply to Tijl Coosemans from comment #1) > Yes they should be added via USE_GNOME, but please look at the .pc file to > determine the dependencies instead of using "pkg-config --libs". You mean Requires line? It's incomplete. gettext is not listed, for instance.
Comment 3 Tijl Coosemans 2016-05-30 21:17:12 UTC
Requires and Libs. -lintl is added by glib-2.0.pc so it can be added to glib20_LIB_DEPENDS.
Comment 4 Mathieu Arnold 2016-05-31 10:38:56 UTC
Mmm, might this be a case of overlinking ?
Comment 5 Baptiste Daroussin 2016-05-31 12:38:17 UTC
yes this is overlinking, it is known that lots of the gnome '.pc' files lead to overlinking and are badly formatted :(
Comment 6 Tijl Coosemans 2016-05-31 13:15:06 UTC
As far as I know upstream is very well aware of this and it's all intentional. The dependencies are added by the headers. Some glib headers include libintl.h and then use gettext in some macros. Programs that use this API (directly or indirectly) can end up with calls to gettext and need to be linked with libintl.so. These programs shouldn't have to care about how the API is implemented (with gettext or something else) so the reasoning is that it's pkg-config's job to add -lintl. This means -lintl is always added even when it isn't strictly necessary, but there isn't any more fine-grained method. It would be nice if library requirements could be expressed in headers (and object files) so the compiler (and linker) know exactly what libraries are needed.
Comment 7 Antoine Brodin 2016-12-18 09:53:23 UTC
Created attachment 178045 [details] Add libintl.so to glib20_LIB_DEPENDS Attached patch adds libintl.so to glib20_LIB_DEPENDS. It should fix a very small part of the issue but this small part affects around 1800 ports.
Comment 8 commit-hook 2017-03-12 08:26:23 UTC
A commit references this bug: Author: antoine Date: Sun Mar 12 08:25:23 UTC 2017 New revision: 435977 URL: https://svnweb.freebsd.org/changeset/ports/435977 Log: Add libintl.so to glib20_LIB_DEPENDS As noted in PR 209813, some glib headers include libintl.h and then use gettext in some macros. Programs that use this API (directly or indirectly) can end up with calls to gettext and need to be linked with libintl.so. glib-2.0.pc has -lintl in its Libs too. PR: 209813 With hat: portmgr Changes: head/Mk/Uses/gnome.mk
Comment 9 Walter Schwarzenfeld 2018-02-07 23:07:51 UTC
Forgotten to close?
Comment 10 Tijl Coosemans 2018-02-08 21:43:12 UTC
No, libintl was just one case.