Bug 41253 - [GTK] Add support for GTK+3
Summary: [GTK] Add support for GTK+3
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-26 11:19 PDT by Xan Lopez
Modified: 2010-07-01 00:36 PDT (History)
3 users (show)

See Also:


Attachments
gtk3.diff (23.33 KB, patch)
2010-06-26 11:31 PDT, Xan Lopez
no flags Details | Formatted Diff | Diff
2010-06-30 Diego Escalante Urrelo <descalante@igalia.com> (1.65 KB, patch)
2010-06-30 21:59 PDT, Diego Escalante Urrelo
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Xan Lopez 2010-06-26 11:19:45 PDT
We need to add support for the upcoming GTK+ 3.x series. Here's an overwiew of the changes the patch brings:

- A new --with-gtk parameter, with options '2.0' or '3.0'. The default for now is '2.0', to keep the same behavior than we have now.
- The library version in the GTK+ 3.x mode is bumped to 3, to be in sync with GTK+. For the 2.x mode we keep it in 1 for compatibility reasons.
- The library is renamed to libwebkitgtk in both 2.x and 3.x support options. This is an ABI break, so the library version numbers are all reset to 0:0:0. The reason for the name change is that there's potentially many webkit versions in one given system, so being named just "webkit" is pretentious.
- The .pc file is renamed to webkitgtk, with webkitgtk-3.0.pc being the file for the 3.x version. For the 2.x version we keep webkit-1.0.pc, again for compatibility reasons.
Comment 1 Xan Lopez 2010-06-26 11:31:41 PDT
Created attachment 59842 [details]
gtk3.diff

Patch.
Comment 2 Gustavo Noronha (kov) 2010-06-28 05:32:22 PDT
Comment on attachment 59842 [details]
gtk3.diff

 439 JSCORE_GIRSOURCES += JSCore-@WEBKITGTK_API_VERSION@.gir

We should split libjscore later this cycle, too, btw. That would make distributions happy.

 440 WEBKIT_GIRSOURCES += WebKit-@WEBKITGTK_API_VERSION@.gir

I think we should also rename the gir/typelib files to WebKitGtk, for consistency.

8         Adapt build system to 3.x support.

s/to/for/? =)

All looks good to me otherwise.
Comment 3 Xan Lopez 2010-06-28 07:30:23 PDT
Comment on attachment 59842 [details]
gtk3.diff

Landed is r62001.
Comment 4 Xan Lopez 2010-06-28 07:30:37 PDT
All patches landed, closing.
Comment 5 Diego Escalante Urrelo 2010-06-30 21:31:02 PDT
Xan, I get a FTBFS with gtk3 on master:

  CXX    DerivedSources/webkit/WebKitDOMCSSRule.lo
In file included from ./WebCore/platform/graphics/FloatQuad.h:35,
                 from ./WebCore/dom/Range.h:29,
                 from ./WebCore/platform/gtk/DataObjectGtk.h:26,
                 from ./WebKit/gtk/webkit/webkitprivate.h:51,
                 from DerivedSources/webkit/WebKitDOMCSSRule.cpp:38:
./WebCore/platform/graphics/IntRect.h:51: error: conflicting declaration ‘typedef struct _GdkRectangle GdkRectangle’
/home/diego/gnome/build/include/gtk-3.0/gdk/gdktypes.h:77: error: ‘GdkRectangle’ has a previous declaration as ‘typedef struct cairo_rectangle_int_t GdkRectangle’
make[1]: *** [DerivedSources/webkit/WebKitDOMCSSRule.lo] Error 1
make[1]: se sale del directorio `/home/diego/gnome/WebKit'
make: *** [all] Error 2
*** Error during phase build of WebKit: ########## Error running make   *** [1/1]

The problem is the typedef for GdkRectangle, iirc a small neat trick to avoid headers:

WebCore/platform/graphics/IntRect.h:
#if PLATFORM(WIN)
typedef struct tagRECT RECT;
#elif PLATFORM(QT)
QT_BEGIN_NAMESPACE
class QRect;
QT_END_NAMESPACE
#elif PLATFORM(GTK)
typedef struct _GdkRectangle GdkRectangle;

I fooled around trying to fix it but I failed epically. Changing the typedef to cairo_rectangle_int_t GdkRectangle doesn't help.
Comment 6 Diego Escalante Urrelo 2010-06-30 21:59:56 PDT
Created attachment 60194 [details]
2010-06-30  Diego Escalante Urrelo  <descalante@igalia.com>

Reviewed by NOBODY (OOPS!).

        [GTK] Add support for GTK+3
        https://bugs.webkit.org/show_bug.cgi?id=41253

        Fix FTBFS caused by an outdated GdkRectangle declaration.

        * platform/graphics/IntRect.h:
Comment 7 Diego Escalante Urrelo 2010-06-30 22:00:40 PDT
Although my webkit is still building, I think this solves the problem I just ranted about.
Comment 8 Xan Lopez 2010-07-01 00:36:07 PDT
Comment on attachment 60194 [details]
2010-06-30  Diego Escalante Urrelo  <descalante@igalia.com>

You need #ifdefs and keep the old version around for GTK+ 2.x...

Also, do you really need to do it in two steps?