Bug#756476: AM_PATH_GTK_3_0 fails if gthread is in 4th argument

Simon McVittie smcv at debian.org
Wed Aug 6 10:35:30 UTC 2014


retitle 756476 AM_PATH_GTK_3_0 fails if gthread is in 4th argument
forwarded 756476 https://bugzilla.gnome.org/show_bug.cgi?id=641638
tags 756476 + patch upstream
thanks

On Wed, 06 Aug 2014 at 01:49:05 +0300, Yavor Doganov wrote:
> The problem is due to changed behavior of pkg-config, most probably
> occurred in version 0.28.  "pkg-config --atleast-version N libA libB"
> now checks if both libraries are >= N (which will always return false
> for gtk+-3.0 if the last macro argument is used because the
> gthread-2.0 version is 2.40.x).

Retitling bug, thanks for this analysis.

I don't think this should be considered RC: AM_PATH_GTK_3_0 is rarely-used
and there are much better ways to achieve the same thing (pkg-config).
Gtk maintainers' opinions?

gtk-3.0.m4 should be considered deprecated: it's far too complicated
for the value it provides. All packages that use AM_PATH_GTK_3_0 should simply
replace it with an equivalent PKG_CHECK_MODULES call, something like:

    AM_PATH_GTK_3_0([3.4]) -> PKG_CHECK_MODULES([GTK], [gtk+-3.0 >= 3.4])

    AM_PATH_GTK_3_0([3.4], [], [], [gthread]) ->
        PKG_CHECK_MODULES([GTK], [gtk+-3.0 >= 3.4, gthread-2.0])

(PKG_CHECK_MODULES can also take ACTION-IF-FOUND and ACTION-IF-NOT-FOUND
arguments if you really need them.)

> Trivial patch attached.  I can't reproduce this with pkg-config/0.26-1
> on wheezy which makes me think that this is new behavior as of 0.28.
> I am not sure it was intended though, seems unnatural/incorrect to me.

"pkg-config --atleast-version V pkg1 pkg2" is documented to be equivalent
to pkg1 >= V, pkg2 >= V. It looks as though the documented behaviour was
not actually implemented until recently.

I think all uses of pkg-config --atleast-version should be replaced by
explicit ">=" version specifiers. I attach a patch which does that;
I think that's better than deleting the gthread check entirely, but
not as good as adapting packages that use AM_PATH_GTK_3_0 to stop
doing so.

For packages that do not already use autoreconf at build time, a sourceful
upload will be needed to pick up the new gtk-3.0.m4, and if you're
doing a sourceful upload anyway, please just fix your configure.ac to not
do this. It'll make your build quicker, too.

Regards,
    S
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Avoid-pkg-config-atleast-version.patch
Type: text/x-diff
Size: 2175 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-gnome-maintainers/attachments/20140806/269e65c9/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Deprecate-AM_PATH_GTK_3_0-in-favour-of-PKG_CHECK_MOD.patch
Type: text/x-diff
Size: 935 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-gnome-maintainers/attachments/20140806/269e65c9/attachment-0001.patch>


More information about the pkg-gnome-maintainers mailing list