Source: tpm2-abrmd
Version: 1.3.1-1
Severity: serious
Tags: patch upstream
Justification: fails to build from source
Control: block 909846 by -1
tmp2-abrmd has this pattern in configure.ac:
AC_PATH_PROG([GDBUS_CODEGEN], [`$PKG_CONFIG --variable=gdbus_codegen
gio-2.0`])
This doesn't work with recent versions of GLib, in which the pkg-config
call produces an absolute path. AC_PATH_PROG only accepts a basename for
its second argument.
There is some debate over whether the recommended way to check for tools
like these is to search the PATH:
AC_PATH_PROG([GDBUS_CODEGEN], [gdbus-codegen])
or to ask pkg-config:
PKG_CHECK_VAR([GDBUS_CODEGEN], [gio-2.0], [gdbus_codegen])
but combining AC_PATH_PROG with pkg-config certainly doesn't seem to be
what's intended. Either of those macro invocations would allow the location
to be overridden with "./configure GDBUS_CODEGEN=..." if required.
The upstream developer of tpm2-abrmd already applied a
patch to use AC_PATH_PROG([GDBUS_CODEGEN], [gdbus-codegen]):
https://github.com/tpm2-software/tpm2-abrmd/commit/b4036908dd067f8eadc9d53b1a2a39032aed109d
so I would suggest applying that (attached). I can confirm that applying
that patch fixes the build in sbuild.
smcv
From: Jonas Witschel <[email protected]>
Date: Tue, 11 Sep 2018 13:14:36 +0200
Subject: Fix gdbus-codegen lookup for recent versions of GLib
If GLib is built using Meson, the gdbus_codegen variable contains the
whole path to the binary instead of just the binary name. This cannot be
parsed by AC_PATH_PROG and leads to an error in the configure script.
According to https://gitlab.gnome.org/GNOME/glib/issues/1521#note_313402,
the recommended way to solve this is to look up gdbus-codegen directly
without using the pkg-config variable.
Origin: upstream, 2.0.3, commit:b4036908dd067f8eadc9d53b1a2a39032aed109d
---
configure.ac | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index fe278e3..d1ea91b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -32,7 +32,7 @@ PKG_CHECK_MODULES([GLIB], [glib-2.0])
PKG_CHECK_MODULES([GOBJECT], [gobject-2.0])
PKG_CHECK_MODULES([SAPI],[sapi < 2.0.0])
AC_ARG_VAR([GDBUS_CODEGEN],[The gdbus-codegen executable.])
-AC_PATH_PROG([GDBUS_CODEGEN], [`$PKG_CONFIG --variable=gdbus_codegen gio-2.0`])
+AC_PATH_PROG([GDBUS_CODEGEN], [gdbus-codegen])
if test -z "$GDBUS_CODEGEN"; then
AC_MSG_ERROR([*** gdbus-codegen is required to build tpm2-abrmd])
fi