Closed kloczek closed 3 months ago
The ABI change was a mistake fixed with a subsequent e2abd5dd2c1bf3a644de3bcb08c874185a0bd1e9 commit.
The dependency on
Your report is a genuine bug in librepo/librepo.pc.cmake file which has been there since the beginning. Thanks for finding it. I will fix it.
Problem is that if I add zck among Requires into librepo.pc, then your application will needlessly link to zck because "pkg-config --libs librepo" will produce "-lrepo -lzck" instead of "-lrepo".
I do not want the overlinking. I don't think pkg-config supports no-library dependencies. Clean solution would be zchunk project to deliver zck-headers.pc which would not define "Libs". Then librepo could "Require: zck-headers". However, I do not believe that zchunk would be happy and add a pkg-config file like that only for the sake of librepo.
I'm keen not fixing this issue with the claim the pkg-config does not support a dependency like that. I will open a feature request at pkgconf because this issue is no specific to zck/librepo. But my hopes are low.
I opened #307 as an example how the fix in pkg-config file would look like.
Another approach is not to add zck to Requires. Instead only add zck include path to librepo's pkg-config and document the dependency by words in README. We already declare the dependncy in librepo.spec.
I also open #308 which mostly improves a documentation instead of adding the dependency. We will need to pick one of the pull requests.
We will go with #307 which uses a not-well-known pkgconf feature that Requires.private are effective for non-static cflags.
Do you know that "not-well-known feature" comes from rpm bug which I've even reported? From https://github.com/rpm-software-management/rpm/blob/b96abccec8cd3c466be2f901136587b13b2f9906/scripts/pkgconfigdeps.sh#L42-L58
-R|--requires)
while read filename ; do
case "${filename}" in
*.pc)
i="`expr $i + 1`"
[ $i -eq 1 ] && echo "$pkgconfig"
DIR="`dirname ${filename}`"
export PKG_CONFIG_PATH="$DIR:$DIR/../../share/pkgconfig"
$pkgconfig --print-requires --print-requires-private "$filename" 2> /dev/null | while read n r v ; do # <<<< HERE
[ -n "$n" ] || continue
echo -n "pkgconfig($n) "
[ -n "$r" ] && [ -n "$v" ] && echo -n "$r" "$v"
echo
done
esac
done
;;
rpm forced --print-requires --print-requires-private
as same as --print-requires
IIRC I've reported that is issue few years ago and it was refused as bug.
Yeah .. I've even proposed PR to fix that https://github.com/rpm-software-management/rpm/pull/411 In mean time I've managed to spread all necessary changes across all affected packages with pkgconfig files to trim results of that bug. In other words currently if that PR would be merged quite possible that nothing will be affected.
With 66c99da1 has been changed ABI and when librepo is build with zchunk support
<librepo/downloadtarget.h>
header needs<zck.h>
. Issue is that if librepo is build that way content of the installed librepo.pc has nozchunk
inRequires:
field. This as result causes that for example PackageKit build fails with