GNOME Bugzilla – Bug 734327
Build against webkit2gtk-4.0
Last modified: 2014-08-14 17:11:03 UTC
gitg is broken in jhbuild because it builds against webkit2gtk-3.0, which has been superseded by webkit2gtk-4.0. There's new Vala bindings available in the Vala repo. Fortunately the changes are pretty minimal....
It would be great to have some help here. I want gitg to be able to compile against both 3.0 and 4.0, but I don't want to build webkit2gtk manually on my machine (I think it might even not have enough RAM to complete it). Would you be interested in providing a patch?
I keep meaning to get around to this, sorry. :(
Created attachment 283114 [details] [review] Support both webkit2gtk-3.0 and webkit2gtk-4.0
Review of attachment 283114 [details] [review]: ::: Makefile.am @@ +123,2 @@ %.typelib: %.gir + $(INTROSPECTION_COMPILER) $(INTROSPECTION_COMPILER_ARGS) --includedir=$(top_srcdir) --includedir=$(datadir)/webkitgtk-4.0/gir-1.0 -o $@ $< Couldn't figure out any nicer way to make this work. I think the extra include path should not cause any problems for webkit2gtk-3.0 users.
Created attachment 283115 [details] [review] Support both webkit2gtk-3.0 and webkit2gtk-4.0 Removed some cruft I accidentally left in configure.ac
Review of attachment 283115 [details] [review]: Only minor nitpicks. Additionally, does this mean that we didn't use any of the API that changed? ::: Makefile.am @@ +123,2 @@ %.typelib: %.gir + $(INTROSPECTION_COMPILER) $(INTROSPECTION_COMPILER_ARGS) --includedir=$(top_srcdir) --includedir=$(datadir)/webkitgtk-4.0/gir-1.0 -o $@ $< This is probably not harmful, but at the same time it is easy to just export additional introspection args from configure.ac. You can create a new var in configure.ac and set it to --includedir=... etc. in the case of webkit2gtk-4.0, AC_SUBST it and use that variable here. ::: configure.ac @@ +275,3 @@ --pkg json-glib-1.0 \ --pkg libsoup-2.4 \ + --pkg \$(WEBKIT_PKGCONFIG) \ No need to not directly substitute in the pkg.
(In reply to comment #6) > Review of attachment 283115 [details] [review]: > > Only minor nitpicks. Additionally, does this mean that we didn't use any of the > API that changed? Yup. There are very few differences, discussed at [1]. [1] http://blogs.igalia.com/carlosgc/2014/08/01/webkitgtk-2-5-1-good-bye-webkit1/
Created attachment 283245 [details] [review] Support both webkit2gtk-3.0 and webkit2gtk-4.0
Review of attachment 283245 [details] [review]: ::: configure.ac @@ +89,3 @@ +PKG_CHECK_EXISTS([webkit2gtk-4.0], [ + WEBKIT_PKGCONFIG=webkit2gtk-4.0 + WEBKIT_INTROSPECTION_COMPILER_ARGS='--includedir=\$(datadir)/webkitgtk-4.0/gir-1.0' This doesn't work when installing gitg in a different prefix than webkit. The way to do this is to obtain the datadir for webkit from pkgconfig.
(In reply to comment #9) > This doesn't work when installing gitg in a different prefix than webkit. The > way to do this is to obtain the datadir for webkit from pkgconfig. Bleh, that variable doesn't exist in the pkgconfig. Carlos, is it OK if I add it? I don't think there's a better way to determine where the gir is installed to? I'm also confused why manually adding the includedir was not previously necessary....
Relevant stubs: _gir_get_pkgconfig_var(INTROSPECTION_INSTALL_GIRDIR "girdir" "--define-variable=datadir=${DATA_INSTALL_DIR}") at https://github.com/WebKit/webkit/blob/18330d0fee077c9b8d35d0178d01f56e46d4e517/Source/cmake/FindGObjectIntrospection.cmake#L47. I'm not sure why datadir is explicitly overridden there. As a temporary solution, you can obtain the prefix variable from pkg-config and append /share to it to make the datadir. But I agree, it looks like this is an issue to be sorted out at the webkit level. (In reply to comment #10) > (In reply to comment #9) > I'm also confused why manually adding the includedir was not previously > necessary.... Because I guess before the gir file was installed in the system-wide girdir.
(In reply to comment #11) > Relevant stubs: > > _gir_get_pkgconfig_var(INTROSPECTION_INSTALL_GIRDIR "girdir" > "--define-variable=datadir=${DATA_INSTALL_DIR}") > > at > https://github.com/WebKit/webkit/blob/18330d0fee077c9b8d35d0178d01f56e46d4e517/Source/cmake/FindGObjectIntrospection.cmake#L47. > I'm not sure why datadir is explicitly overridden there. As a temporary > solution, you can obtain the prefix variable from pkg-config and append /share > to it to make the datadir. But I agree, it looks like this is an issue to be > sorted out at the webkit level. > > (In reply to comment #10) > > (In reply to comment #9) > > I'm also confused why manually adding the includedir was not previously > > necessary.... > > Because I guess before the gir file was installed in the system-wide girdir. I think it's a bug in WebKit, we didn't want to change the path where the gir files are installed. It sounds like yet another regression of the cmake switch.
(In reply to comment #11) > Relevant stubs: > > _gir_get_pkgconfig_var(INTROSPECTION_INSTALL_GIRDIR "girdir" > "--define-variable=datadir=${DATA_INSTALL_DIR}") > > at > https://github.com/WebKit/webkit/blob/18330d0fee077c9b8d35d0178d01f56e46d4e517/Source/cmake/FindGObjectIntrospection.cmake#L47. > I'm not sure why datadir is explicitly overridden there. As a temporary > solution, you can obtain the prefix variable from pkg-config and append /share > to it to make the datadir. But I agree, it looks like this is an issue to be > sorted out at the webkit level. Yes, definitely a bug, it was not our intention to override that variable. Please file a bug in WebKit and I'll make sure it's fixed for 2.5.3.
@Michael: if you file it at the webkit tracker, could you please add a reference here?
Created attachment 283318 [details] [review] Support both webkit2gtk-3.0 and webkit2gtk-4.0 (Doesn't work, pending WebKit fix.)
(In reply to comment #13) > Yes, definitely a bug, it was not our intention to override that variable. > Please file a bug in WebKit and I'll make sure it's fixed for 2.5.3. Oh lovely, I'm the one who broke this, in https://bugs.webkit.org/show_bug.cgi?id=135288 I think we should just revert that commit. The use case was kind of bogus; Martin was trying to help me build WebKit without jhbuild and install it into my jhbuild install prefix, but I'm pretty sure that will never realistically work. If I had been using jhbuild to build WebKit then the pkgconfig would have found the right location automatically. (In reply to comment #12) > > Because I guess before the gir file was installed in the system-wide girdir. > > I think it's a bug in WebKit, we didn't want to change the path where the gir > files are installed. It sounds like yet another regression of the cmake switch. Actually yes, that's true, they used to be installed in the system-wide girdir. I thought I had checked that and concluded otherwise.... Anyway, if we fix that in WebKit, then we don't need to mess with include paths in gitg.
If you want to keep installing in a separate prefix work well, you can do what we do in libgit2-glib, which is simply installing the gir in $(datadir)/gir-1.0 (note, not pkgdatadir). This has worked out well for us, although it would theoretically be possible that some distro's would change the gir installation dir. In practice it's not an issue.
(In reply to comment #17) > If you want to keep installing in a separate prefix work well, you can do what > we do in libgit2-glib, which is simply installing the gir in $(datadir)/gir-1.0 > (note, not pkgdatadir). This has worked out well for us, although it would > theoretically be possible that some distro's would change the gir installation > dir. In practice it's not an issue. Carlos has pushed a patch that does exactly that.
OK, I guess it's fine to push the gitg patch.
Attachment 283318 [details] pushed as a1cdc51 - Support both webkit2gtk-3.0 and webkit2gtk-4.0