Skip to content

Commit

Permalink
Add a dependency on zck to librepo.pc if zchunk support is enabled
Browse files Browse the repository at this point in the history
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 adds the dependency on zck to librepo.pc.

A drawback is that then pkg-config adds -lzck to "pkg-config --libs
lirepo" and leads to 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
  • Loading branch information
ppisar committed Apr 5, 2024
1 parent 4ff11d8 commit bbc4a56
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions librepo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ ENDIF (USE_GPGME)

IF (WITH_ZCHUNK)
TARGET_LINK_LIBRARIES(librepo ${ZCHUNKLIB_LIBRARIES})
SET(PKGCONF_DEPENDENCY_ZCK "zck")
ENDIF (WITH_ZCHUNK)

SET_TARGET_PROPERTIES(librepo PROPERTIES OUTPUT_NAME "repo")
Expand Down
2 changes: 1 addition & 1 deletion librepo/librepo.pc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
Name: librepo
Description: Repodata downloading library.
Version: @VERSION@
Requires: glib-2.0
Requires: glib-2.0 @PKGCONF_DEPENDENCY_ZCK@
Requires.private: libcurl openssl libxml-2.0
Libs: -L${libdir} -lrepo
Libs.private: -lgpgme -lgpg-error
Expand Down

0 comments on commit bbc4a56

Please sign in to comment.