After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 626030 - Add --with-gtk=2.0|3.0 configure flag
Add --with-gtk=2.0|3.0 configure flag
Status: RESOLVED FIXED
Product: evince
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Evince Maintainers
Evince Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-08-04 15:35 UTC by Vincent Untz
Modified: 2010-09-30 08:08 UTC
See Also:
GNOME target: 3.0
GNOME version: ---


Attachments
[build] Add --with-gtk=2.0|3.0 configure flag (5.17 KB, patch)
2010-08-04 15:35 UTC, Vincent Untz
committed Details | Review
[build] Add --with-gtk=2.0|3.0 configure flag (5.17 KB, patch)
2010-08-04 15:47 UTC, Vincent Untz
committed Details | Review
Also update pkg-config files (790 bytes, patch)
2010-08-05 23:22 UTC, Vincent Untz
committed Details | Review

Description Vincent Untz 2010-08-04 15:35:13 UTC
This patch adds a --with-gtk=2.0|3.0 configure flag so evince 2.32 can be used for GNOME 2.32, with GTK+ 2.
Comment 1 Vincent Untz 2010-08-04 15:35:14 UTC
Created attachment 167121 [details] [review]
[build] Add --with-gtk=2.0|3.0 configure flag
Comment 2 Carlos Garcia Campos 2010-08-04 15:41:18 UTC
Patch looks good to me, please commit.
Comment 3 Vincent Untz 2010-08-04 15:47:28 UTC
The following fix has been pushed:
fda9745 [build] Add --with-gtk=2.0|3.0 configure flag
Comment 4 Vincent Untz 2010-08-04 15:47:34 UTC
Created attachment 167122 [details] [review]
[build] Add --with-gtk=2.0|3.0 configure flag
Comment 5 Christian Persch 2010-08-04 20:33:29 UTC
This isn't enough. You also need to vary EV_API_VERSION, EV_BINARY_VERSION, and the libevdocument and libevview libtool versions between gtk 2.0 and 3.0.
Comment 6 Vincent Untz 2010-08-05 07:34:26 UTC
(In reply to comment #5)
> This isn't enough. You also need to vary EV_API_VERSION, EV_BINARY_VERSION, and
> the libevdocument and libevview libtool versions between gtk 2.0 and 3.0.

I just checked, and those were not changed when switching to GTK+ 3 as far as I can tell (they are the same on the gnome-2-30 branch). That's why I didn't notice them, I guess.

We probably want to bump at least EV_BINARY_VERSION and the libtool versions for GTK+ 3, though, indeed.

Carlos, what's your preferred way to handle this?
Comment 7 Carlos Garcia Campos 2010-08-05 07:41:17 UTC
Yes, I forgot to bump api versions when switched to gtk3, we should definitely do that in both cases (using different version numbers) because the libview and libdocument apis have changed during this cycle. I tend to change library version once per major release when api changes, that's why I hadn't changed it yet.
Comment 8 Vincent Untz 2010-08-05 23:22:14 UTC
Created attachment 167224 [details] [review]
Also update pkg-config files

Gah, I just discovered I forgot to update the .pc files for this. Sorry :/
Comment 9 Carlos Garcia Campos 2010-08-06 07:03:44 UTC
Review of attachment 167224 [details] [review]:

Push it. Thanks!
Comment 10 Christian Persch 2010-08-06 09:29:30 UTC
(In reply to comment #6)
> We probably want to bump at least EV_BINARY_VERSION and the libtool versions
> for GTK+ 3, though, indeed.

An alternative for the libtool versions would be to rename the libraries on gtk3, e.g libevdocument3, libevview3. The API and binary versions still need bumping, of course.
Comment 11 Carlos Garcia Campos 2010-08-19 08:45:41 UTC
I've just branched for gnome-2-32 and renamed libraries in master, making gtk3 the default option (not sure even if just removing gtk2 support), and bumping sonames too.
Comment 12 Dennis Sheil 2010-09-27 13:45:22 UTC
I only have stable GTK+ libraries (GTK+ 2), and the August 19th, 2010 commit ( 9ee4ac855898e9eb17d6f560e2711224329fc827 ) is now breaking my build.  I clone the latest git, do an ./autogen.sh and fail on

$ ./autogen.sh 
/usr/bin/gnome-autogen.sh
checking for autoconf >= 2.53...
[...]
checking pkg-config is at least version 0.16... yes
checking for which platform to build... gnome
checking which gtk+ version to compile against... 3.0
checking for LIBDOCUMENT... no
configure: error: Package requirements (gtk+-3.0 >= 2.90.5 gio-2.0 >= 2.25.11) were not met:

No package 'gtk+-3.0' found

This was working on the prior commit to 9ee4...c827, evince compiled with the stable gtk+ libraries without problem.  Undoing this character change in the commit, from 2 to 3 in configure.ac...

-  [with_gtk=2.0])
+  [with_gtk=3.0])

...allows me to compile normally.

There are a few problems with this 9ee4...c827 change.  One is this:

$ grep with-gtk configure.ac 
  [AS_HELP_STRING([--with-gtk=2.0|3.0],[which gtk+ version to compile against (default: 2.0)])],

A ./configure --help tells people that the default gtk+ people are compiling against is 2.0 by default.  But this is no longer true.  It is now compiling 3.0 by default.  So the information given is wrong.

Beyond this, I see nothing wrong with the new autotools giving preference to gtk+ 3.0 over gtk+ 2.0.  But if evince is still allowing compilation with gtk+ 2.0, I don't know why there can't be logic in configure.ac that can't test for gtk+ 3.0 and use that, but if it fails, fall back to gtk+ 2.0.

I am not sure what would be thought of such a change in configure.ac's logic.
Comment 13 Vincent Untz 2010-09-27 13:51:39 UTC
Dennis: you should just use the gnome-2-32 branch. The master branch is aimed at GNOME 3, and I guess GTK+ 2 support there will be removed.
Comment 14 Dennis Sheil 2010-09-30 00:45:40 UTC
(In reply to comment #13)
> Dennis: you should just use the gnome-2-32 branch. The master branch is aimed
> at GNOME 3, and I guess GTK+ 2 support there will be removed.

OK.  The master branch still has configure saying it defaults to 2.0 though, whereas not only is evince master defaulting to 3.0, but you're saying GTK+ 2.0 support may even removed.  The line below in master which says 2.0 is still the default causes confusion and it should be changed.

$ grep with-gtk configure.ac
 [AS_HELP_STRING([--with-gtk=2.0|3.0],[which gtk+ version to compile
against (default: 2.0)])],
Comment 15 Carlos Garcia Campos 2010-09-30 08:08:55 UTC
Fixed in git master, thanks.