GNOME Bugzilla – Bug 641638
Remove AM_PATH_GTK_3_0 macro
Last modified: 2018-01-16 22:24:15 UTC
It's not really used nowadays as we have the more generic PKG_CHECK_MODULES
Created attachment 180200 [details] [review] Remove AM_PATH_GTK_3_0
PKG_CHECK_MODULES checks for the presence of a pc file. This macro does quite a bit more.
AM_PATH_GTK_3_0, as does AM_PATH_GLIB_2_0, handle: • mis-installations of glib/gtk • wrong environment set up (LD_LIBRARY_PATH conflicting with PKG_CONFIG_PATH) so no: they are not the equivalent of PKG_CHECK_MODULES. now, the optional 4th argument ("modules") should be removed. and some handling of pkg-config could go away.
Comment on attachment 180200 [details] [review] Remove AM_PATH_GTK_3_0 Setting patch status as per last comments.
(In reply to comment #2) > PKG_CHECK_MODULES checks for the presence of a pc file. This macro does quite a > bit more. It does more, but not for anything that needs to be checked for. Nowadays software using a library (including nearly all GTK+ using software) does only do the PKG_CHECK_MODULES(), and not any additional checks for obscure errors. It is unfortunate that AM_PATH_GTK_3_0 was not dropped in 3.0, and it would be nice if it could be documented as deprecated now, and finally be dropped without replacement with GTK+ 4.0
With pkg-config 0.28, a construct like AM_PATH_GTK_3_0([3.4], [], [], [gthread]) is actively broken: it calls "pkg-config --atleast-version 3.4 gtk+-3.0 gthread", which is documented to check that both gtk+-3.0 and gthread are version >= 3.4. Earlier pkg-config versions didn't behave as documented, but 0.28 does. This is <https://bugs.debian.org/756476>.
Created attachment 282647 [details] [review] Avoid "pkg-config --atleast-version" AM_PATH_GTK_3_0([3.4], [], [], [gthread]) results in calling "pkg-config --atleast-version 3.4 gtk+-3.0 gthread-2.0". With pkg-config 0.28, that test fails, because the version of gthread-2.0 is smaller than 3.4. This appears to be a behaviour change since 0.26, but matches what the documentation said in 0.26.
Created attachment 282648 [details] [review] Deprecate AM_PATH_GTK_3_0 in favour of PKG_CHECK_MODULES That's what GNOME applications use.
Created attachment 282649 [details] [review] Deprecate GTK_CHECK_BACKEND in favour of PKG_CHECK_MODULES This is easy to do with pkg-config too. --- I'm less sure whether this one should be applied. Thoughts?
According to codesearch.debian.net, neither macro is commonly used: http://codesearch.debian.net/search?q=AM_PATH_GTK_3_0 http://codesearch.debian.net/search?q=GTK_CHECK_BACKEND
Review of attachment 282647 [details] [review]: ok
I think deprecating AM_PATH_GTK_3_0 and GTK_CHECK_BACKEND is fine, personally. Emmanuele, do you feel strongly about this ?
Comment on attachment 282647 [details] [review] Avoid "pkg-config --atleast-version" Applied, thanks. 82cf89de for 3.13.6, 3a2a1937 for 3.12.3
(In reply to comment #12) > I think deprecating AM_PATH_GTK_3_0 and GTK_CHECK_BACKEND is fine, personally. > Emmanuele, do you feel strongly about this ? I don't feel strongly about any of these macros. we added them because it was easier than doing the $PKG_CONFIG --blah gtk+-3.0 dance, and because of the overall "let's build stuff without jhbuild setting up the whole environment for us" approach, but deprecation seems fair at this point.
(In reply to comment #14) > we added them because it was > easier than doing the $PKG_CONFIG --blah gtk+-3.0 dance, and because of the > overall "let's build stuff without jhbuild setting up the whole environment for > us" approach For historical context, I assume that was before PKG_CHECK_MODULES was widespread? If you want to document something for non-jhbuild users, the rune I use is to export something like PKG_CONFIG_PATH=${my_prefix}/lib/pkgconfig:${my_prefix}/share/pkgconfig which should cover detection of most compile-time dependencies these days. The variable is already mentioned in "./configure --help".
Review of attachment 282648 [details] [review]: ok
Review of attachment 282649 [details] [review]: ok
(In reply to comment #13) > (From update of attachment 282647 [details] [review]) > Applied, thanks. 82cf89de for 3.13.6, 3a2a1937 for 3.12.3 I pushed to 3.12 but not master. Fixed now; so this is actually d329544 for 3.13.8, 3a2a1937 for 3.12.3.
Comment on attachment 282648 [details] [review] Deprecate AM_PATH_GTK_3_0 in favour of PKG_CHECK_MODULES commit 169f064 for 3.13.8
Comment on attachment 282649 [details] [review] Deprecate GTK_CHECK_BACKEND in favour of PKG_CHECK_MODULES commit d975cd5 for 3.13.8
Is this really resolved, without deleting those macros entirely (presumably a job for Gtk 4)?
Reopening and set target milestore to 4.0
We don't generally keep a bug open for every deprecated bit, but sure