Control: clone -1 -2 Control: retitle -2 pkgconf should support packages in generating dependencies Control: severity -2 wishlist Control: reassign -2 pkgconf Control: submitter -2 !
On Tue, Nov 29, 2022 at 10:46:31AM +0000, Luca Boccassi wrote: > cryptsetup's pkgconfig ini 4.6.0 includes new Requires.private, but > the corresponding dependencies were not added to libcryptsetup-dev, so > reverse deps are failing to build: > > ../meson.build:1308:8: ERROR: Dependency lookup for libcryptsetup with > method 'pkgconfig' failed: Could not generate cargs for libcryptsetup: > 4857Package devmapper was not found in the pkg-config search path. > 4858Perhaps you should add the directory containing `devmapper.pc' > 4859to the PKG_CONFIG_PATH environment variable > 4860Package 'devmapper', required by 'libcryptsetup', not found > 4861Package 'libargon2', required by 'libcryptsetup', not found > > In an ideal world dpkg would just understand pkg-config natively like > rpm does, and fill these in automatically, but alas we are where we > are. Please add: I think this is none of dpkg's business. It's much like shared library dependencies, python dependencies and lots of other kinds. The usual way to do this is to have some tool that generates a substitution variables and debian/control uses it. Let me sketch something realistic. The pkgconf binary package gains a new script dh_pkgconf. This should be run after dh_auto_install and dh_install. It goes through all per-package installation directories and collects all installed .pc files from the usual paths (usr/lib/pkgconfig, usr/lib/<triplet>/pkgconfig and usr/share/pkgconfig). Then it locates all direct Requires and Requires.private and looks up the corresponding .pc files in the directories mentioned above and looks up the owning packages using dpkg -S. It then issues a per-package substitution variable ${pkgconf:Depends} to debian/<package>.substvars containing the located packages. For convenience, pkgconf also provides a debhelper sequence and Provides: dh-sequence-pkgconf. To use this new functionality, e.g. cryptsetup would have to add the build dependency on the sequence and add ${pkgconf:Depends} to libcryptsetup-dev's Depends. Andrej, does that make sense to you? I was also briefly looking into implementing this. Iterating over the packages and the .pc files is relatively simple, but figuring the direct Requires and Requires.private seems non-trivial. pkgconf --print-requires-private performs a recursive search and that's not what we want here to allow dependencies to modify their Depends without affecting us. So it seems like we'd have to write a .pc file parser. Is that correct? Helmut