[pkg-gnupg-maint] Bug#1023601: libgpgme-dev: removal of gpgme-config breaks the build of software relying on it

Vincent Lefevre vincent at vinc17.net
Fri Nov 11 18:28:45 GMT 2022


Hi Andreas,

On 2022-11-11 18:31:40 +0100, Andreas Metzler wrote:
> We were aware that some breakage was to be expected (a little bit late,
> though), and will provide help/assistance (quoting Daniel 1023601: "this
> might cause knock-on effects for projects that themselves think they
> should be dependent on gpgme-config, but i'll try to sort those through
> as well.")
> 
> I do not think the bug severity is correct. It does not break any binary
> packages, i.e. it fits "a bug which has a major effect on the usability
> of a package, without rendering it completely unusable to everyone."

Well, for anyone that follows the official GPGME documentation, the
libgpgme-dev package (only needed to build GPGME-based software) is
unusable. Something needs to be done before the release. See below.

> One might argue that the combination of this gpgme version with
> unbuildable packages is not releaseable and up with serious.

Remember that libgpgme-dev is not just useful to build Debian
packages, but also to build software that is not part of Debian.

In any case, a decision has to be made: either consider that the
change is too early, and the next Debian release should have this file
(in this case, the RC bug is justified), or consider that it is up to
other software to be updated (or users to find a workaround), in which
case, things should at least properly documented: the GPGME manual
currently says:

------------------------------------------------------------------------
2.2 Building the Source
=======================

If you want to compile a source file including the ‘gpgme.h’ header
file, you must make sure that the compiler can find it in the directory
hierarchy.  This is accomplished by adding the path to the directory in
which the header file is located to the compilers include file search
path (via the ‘-I’ option).

   However, the path to the include file is determined at the time the
source is configured.  To solve this problem, gpgme ships with a small
helper program ‘gpgme-config’ that knows about the path to the include
file and other configuration options.  The options that need to be added
to the compiler invocation at compile time are output by the ‘--cflags’
option to ‘gpgme-config’.  The following example shows how it can be
used at the command line:

     gcc -c foo.c `gpgme-config --cflags`

   Adding the output of ‘gpgme-config --cflags’ to the compiler command
line will ensure that the compiler can find the GPGME header file.

   A similar problem occurs when linking the program with the library.
Again, the compiler has to find the library files.  For this to work,
the path to the library files has to be added to the library search path
(via the ‘-L’ option).  For this, the option ‘--libs’ to ‘gpgme-config’
can be used.  For convenience, this option also outputs all other
options that are required to link the program with GPGME (in particular,
the ‘-lgpgme’ option).  The example shows how to link ‘foo.o’ with the
GPGME library to a program ‘foo’.

     gcc -o foo foo.o `gpgme-config --libs`

   Of course you can also combine both examples to a single command by
specifying both options to ‘gpgme-config’:

     gcc -o foo foo.c `gpgme-config --cflags --libs`

   If you need to detect the installed language bindings you can use
list them using:

     gpgme-config --print-lang

   or test for the availability using

     gpgme-config --have-lang=python && echo 'Bindings for Pythons available'
------------------------------------------------------------------------

But in Debian, where gpgme-config is currently missing, this
will *not* work at all.

BTW, after all, the use of gpgrt-config might not be user-friendly
in an interactive shell (as opposed to a configure.ac file). An
alternative solution would be to consider a small gpgme-config script
that will call gpgrt-config with the right arguments. For instance,
on x86_64, I suppose that this could be

  exec gpgrt-config --libdir=/usr/lib/x86_64-linux-gnu gpgme "$@"

-- 
Vincent Lefèvre <vincent at vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)



More information about the pkg-gnupg-maint mailing list