rpm-software-management / librepo

A library providing C and Python (libcURL like) API for downloading packages and linux repository metadata in rpm-md format
http://rpm-software-management.github.io/librepo/
GNU Lesser General Public License v2.1
74 stars 91 forks source link

RFC: Add zchunk header path to librepo.pc if zchunk support is enabled #308

Closed ppisar closed 6 months ago

ppisar commented 6 months ago

This patch is a request for comments. It improves https://github.com/rpm-software-management/librepo/issues/305, but does not do a naive fix by adding a pkg-config dependency because of overlinking. Cf. #307 with overlinking.

If librepo is built with zchunk support, zchunk's zck.h header file is included from librepo public header files, thus applications building against librepo needs zchunk header files available at build time. Those who only use pkg-config for tracking dependencies, reported build failures:

/usr/include/librepo/downloadtarget.h:27:10: fatal error: zck.h: No such file or directory

This patch does not adds the dependency on zck to librepo.pc. Instead it adds zchunk header path the librepo.pc and documenta the dependency in README.md.

Reason for not adding the explicit dependency is that "pkg-config --libs lirepo" would return unnecessay -lzck and lead to an overlinking. There is no non-library kind of dependency in pkg-config. (Ideal solution would be if pkg-config supported those dependencies, or if zck provided a non-library pkg-config file in addition to zck.pc.)

Fixes: #305

ppisar commented 6 months ago

I found a better fix, implemented in #307.