#1025065 pkgconf should support packages in generating dependencies

Package:
pkgconf
Source:
pkgconf
Description:
manage compile and link flags for libraries
Submitter:
Helmut Grohne
Date:
2024-07-20 11:15:02 UTC
Severity:
normal
#1025065#5
Date:
2022-11-29 10:46:31 UTC
From:
To:
Hi,

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:

libdevmapper-dev
libargon2-dev
uuid-dev
libjson-c-dev
libssl-dev
libblkid-dev

to libcryptsetup-dev's Depends field. Thanks!

Kind regards,
Luca Boccassi

#1025065#10
Date:
2022-11-29 12:54:20 UTC
From:
To:
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 !

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

#1025065#27
Date:
2024-07-20 10:52:11 UTC
From:
To: