Revamp #524 (actually, just cherry-pick the Autotools part on top of HEAD)
Closes #524. You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/1182
-- Commit Summary --
* autotools: Detect GTK version to use automatically
-- File Changes --
M configure.ac (29)
-- Patch Links --
https://github.com/geany/geany/pull/1182.patch https://github.com/geany/geany/pull/1182.diff
-AS_IF([test "x$enable_gtk3" = xyes],
[gtk_package=gtk+-3.0
gtk_min_version=3.0],
[gtk_package=gtk+-2.0
gtk_min_version=2.24])
-AM_CONDITIONAL([GTK3], [test "x$gtk_package" = "xgtk+-3.0"])
[enable_gtk3=auto])
+gtk2_package=gtk+-2.0 +gtk2_min_version=2.24 +gtk3_package=gtk+-3.0 +gtk3_min_version=3.0
+PKG_CHECK_EXISTS([$gtk2_package >= $gtk2_min_version], [have_gtk2=yes], [have_gtk2=no]) +PKG_CHECK_EXISTS([$gtk3_package >= $gtk3_min_version], [have_gtk3=yes], [have_gtk3=no]) +AS_IF([test "x$enable_gtk3" = xyes || (! test "x$enable_gtk3" = xno &&
Shouldn't it be an error if `--disable-gtk3` was passed and only GTK+ 3 is available? Also, how is `--enable-gtk3=auto` (the default) handled?
If this is going to flip the default for all distros, it might be worth discussing on the mailing lists. I personally will keep using GTK+ 2 build since GTK+ 3 gives me too many issues, but I've no problem passing `--disable-gtk3` to the configure script.
-AS_IF([test "x$enable_gtk3" = xyes],
[gtk_package=gtk+-3.0
gtk_min_version=3.0],
[gtk_package=gtk+-2.0
gtk_min_version=2.24])
-AM_CONDITIONAL([GTK3], [test "x$gtk_package" = "xgtk+-3.0"])
[enable_gtk3=auto])
+gtk2_package=gtk+-2.0 +gtk2_min_version=2.24 +gtk3_package=gtk+-3.0 +gtk3_min_version=3.0
+PKG_CHECK_EXISTS([$gtk2_package >= $gtk2_min_version], [have_gtk2=yes], [have_gtk2=no]) +PKG_CHECK_EXISTS([$gtk3_package >= $gtk3_min_version], [have_gtk3=yes], [have_gtk3=no]) +AS_IF([test "x$enable_gtk3" = xyes || (! test "x$enable_gtk3" = xno &&
`auto` is in `! test "x$enable_gtk3" = xno`
-AS_IF([test "x$enable_gtk3" = xyes],
[gtk_package=gtk+-3.0
gtk_min_version=3.0],
[gtk_package=gtk+-2.0
gtk_min_version=2.24])
-AM_CONDITIONAL([GTK3], [test "x$gtk_package" = "xgtk+-3.0"])
[enable_gtk3=auto])
+gtk2_package=gtk+-2.0 +gtk2_min_version=2.24 +gtk3_package=gtk+-3.0 +gtk3_min_version=3.0
+PKG_CHECK_EXISTS([$gtk2_package >= $gtk2_min_version], [have_gtk2=yes], [have_gtk2=no]) +PKG_CHECK_EXISTS([$gtk3_package >= $gtk3_min_version], [have_gtk3=yes], [have_gtk3=no]) +AS_IF([test "x$enable_gtk3" = xyes || (! test "x$enable_gtk3" = xno &&
I see. It's also in `test "x$enable_gtk3" != "xno"` which reads more normally (or does the `!` apply to the whole set of expressions in the parenthesis?).
-AS_IF([test "x$enable_gtk3" = xyes],
[gtk_package=gtk+-3.0
gtk_min_version=3.0],
[gtk_package=gtk+-2.0
gtk_min_version=2.24])
-AM_CONDITIONAL([GTK3], [test "x$gtk_package" = "xgtk+-3.0"])
[enable_gtk3=auto])
+gtk2_package=gtk+-2.0 +gtk2_min_version=2.24 +gtk3_package=gtk+-3.0 +gtk3_min_version=3.0
+PKG_CHECK_EXISTS([$gtk2_package >= $gtk2_min_version], [have_gtk2=yes], [have_gtk2=no]) +PKG_CHECK_EXISTS([$gtk3_package >= $gtk3_min_version], [have_gtk3=yes], [have_gtk3=no]) +AS_IF([test "x$enable_gtk3" = xyes || (! test "x$enable_gtk3" = xno &&
To the first test only according to my knowledge, but that is widely acknowledged as limited, so you better check it :)
This should probably wait until after #1181 to avoid a barrage of bug reports about missing VTE support.
@b4n @elextr @codebrainz what about this for 1.30?
@b4n @elextr @codebrainz this should be merged.
As GTK+ 3 is horrible (mainly broken theming on non-GNOME distros and user-hostile built-in smart phone dialogs and widgets), I won't be merging this myself.
On sensible distros like Mint the GTK3 version is fine, have been using it for ages. Since #1181 is not committed this could be too, it doesn't change the GTK2 support so distros that want to remain GTK2 can do so, but I am aware of some that already provide the GTK3 version and that hasn't caused a massive complaint flood and will probably work better on Wayland distros.
@b4n If I read it correctly it doesn't change the default, just select gtk3 automatically if its the ONLY GTK available?
Am 9. September 2017 01:58:23 MESZ schrieb elextr notifications@github.com:
On sensible distros like Mint the GTK3 version is fine, have been using it for ages. Since #1181 is not committed this could be too, it doesn't change the GTK2 support so distros that want to remain GTK2 can do so, but I am aware of some that already provide the GTK3 version and that hasn't caused a massive complaint flood and will probably work better on Wayland distros.
@b4n If I read it correctly it doesn't change the default, just select gtk3 automatically if its the ONLY GTK available?
-- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/pull/1182#issuecomment-328239451
It doesnt change the default, indeed
Merged #1182 into master.
b4n commented on this pull request.
-AS_IF([test "x$enable_gtk3" = xyes],
- [gtk_package=gtk+-3.0 - gtk_min_version=3.0], - [gtk_package=gtk+-2.0 - gtk_min_version=2.24]) -AM_CONDITIONAL([GTK3], [test "x$gtk_package" = "xgtk+-3.0"]) + [enable_gtk3=auto]) + +gtk2_package=gtk+-2.0 +gtk2_min_version=2.24 +gtk3_package=gtk+-3.0 +gtk3_min_version=3.0 + +PKG_CHECK_EXISTS([$gtk2_package >= $gtk2_min_version], [have_gtk2=yes], [have_gtk2=no]) +PKG_CHECK_EXISTS([$gtk3_package >= $gtk3_min_version], [have_gtk3=yes], [have_gtk3=no]) +AS_IF([test "x$enable_gtk3" = xyes || (! test "x$enable_gtk3" = xno &&
I see. It's also in `test "x$enable_gtk3" != "xno"` which reads more normally
Changed for clarity
github-comments@lists.geany.org