From https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=949521: your package is using `xml2-config` to detect and use libxml2. I'm
removing that script, so please update your build system to use pkg-config instead.
Additionally, your package is not failing to build, so it's creating
binaries that are not linked against libxml2 anymore:
Anyone knowing if pkg-config for libxml2 available on all common distros, so we can remove its usage completely, or just go and try first pkg-config and let xml2-config as a fallback?
I will go for try first pkg-config and let xml2-config as a fallback since that change is going to be just in newer versions.
This dist already have `pkg-config` 1. CentOS 1. RHEL 1. Fedora 1. OpenSUSE 1. Oracle Linux 1. Alpine Linux
So we can leave only pkg-config case.
@sergey-safarov - also older versions, not only current stable?
I see that 26 modules use it in Makefile.
On the other hand, on macos, the output of xml2-config and pkg-config are different:
``` $ xml2-config --libs -L/opt/local/lib -lxml2 -L/opt/local/lib -lz -L/opt/local/lib -llzma -lpthread -liconv -L/opt/local/lib -licui18n -licuuc -licudata -lm
$ which xml2-config /opt/local/bin/xml2-config
$ pkg-config --libs libxml-2.0 -L/opt/local/lib -lxml2
$ which pkg-config /opt/local/bin/pkg-config ```
On debian 10 is the same.
Oldest `RHEL-6` based dist (CentOS-6, Oracle Linux 6) is have `pkgconfig-0.23-9` and `libxml2-2.7.6` ``` [root@8760520b12b8 /]# cat /usr/lib64/pkgconfig/libxml-2.0.pc prefix=/usr exec_prefix=/usr libdir=/usr/lib64 includedir=/usr/include modules=1
Name: libXML Version: 2.7.6 Description: libXML library version2. Requires: Libs: -L${libdir} -lxml2 Libs.private: -lz -lm Cflags: -I${includedir}/libxml2 ```
For oldest OpenSUSE `pkg-config-0.28-11` and `libxml2-devel-2.9.4` ``` 52640dd1687d:/ # cat /usr/lib64/pkgconfig/libxml-2.0.pc prefix=/usr exec_prefix=/usr libdir=/usr/lib64 includedir=/usr/include modules=1
Name: libXML Version: 2.9.4 Description: libXML library version2. Requires: Libs: -L${libdir} -lxml2 Libs.private: -L/lib64 -lz -llzma -lm Cflags: -I${includedir}/libxml2 ```
Do we have any conclusion here, should we go this way:
I will go for try first pkg-config and let xml2-config as a fallback since that change is going to be just in newer versions.
and about the MacOS - maybe the compilation will also work with the fewer flags, I can't test it though.
I think the best would be to figure out first if `xml2-config` exists and if yes, use it, otherwise look for `pkg-config`. I expect `xml2-config` comes from developers of the project, while `pkg-config` is more a distro/packager variant, but the main argument would be that currently it works fine with `xml2-config`. If some distro has no longer `xml2-config`, then `pkg-config` will be used anyhow.
Master should have all the mods updated. If someone prefers a different way, let's discuss further.
Closed #2199.
can We backport this changes to 5.3?
Sure