After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 778549 - Look for libxml2 via pkg-config first
Look for libxml2 via pkg-config first
Status: RESOLVED FIXED
Product: libxslt
Classification: Platform
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on: 787617
Blocks:
 
 
Reported: 2017-02-13 07:43 UTC by Elliott Sales de Andrade
Modified: 2017-09-13 09:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch libxml2 check to use pkg-config (1.91 KB, patch)
2017-02-13 07:43 UTC, Elliott Sales de Andrade
none Details | Review

Description Elliott Sales de Andrade 2017-02-13 07:43:05 UTC
Created attachment 345604 [details] [review]
Patch libxml2 check to use pkg-config

If no explicit path is specified, try pkg-config first, before xml2-config. The reason is that pkg-config knows the difference between static and shared dependencies and thus doesn't cause libxslt to be linked against a bunch of extra stuff.

Say for example that libxml2 is compiled --with-icu, then it will be linked against various libicu shared libraries. xml2-config will _also_ specify those libraries (because it doesn't know whether you are doing static or shared linking) and thus libxslt is also linked against libicu even though it does not use it.

On the other hand, pkg-config has Libs/Libs.private which separates shared&static dependencies and so you can get libxslt to link to _only_ libxml2 without any other things.
Comment 1 Nick Wellnhofer 2017-05-18 16:26:32 UTC
Fixed with the following commit:

https://git.gnome.org/browse/libxslt/commit/?id=abf537ebb2296cd3ae89989a17b0e1b5c79db107

Thanks for the patch.
Comment 2 Eli Schwartz 2017-09-13 01:17:09 UTC
This patch is a bashism and therefore only works when /bin/sh is a symlink to the bash shell.
(I'm sorry, but who actually uses "==" in either bash or sh??? This is incredibly ugly and serves no purpose other than to foment confusion.)

It also breaks xslt-config which admittedly is an ugly workaround for people who don't realize they should have used pkg-config.

See https://bugs.archlinux.org/task/55600 for details.