GNOME Bugzilla – Bug 648161
Add GObject Introspection Support
Last modified: 2011-04-26 17:02:49 UTC
Created attachment 186241 [details] [review] Add GObject Introspection Support (after apply this patch need manually remove folks/libfolks_la_vala.stamp)
Review of attachment 186241 [details] [review]: +api_version = $(FOLKS_MAJOR_MINOR_VERSION) +libfolks_la_VALAFLAGS = \ + --gir=Folks-$(api_version).gir \ + --library=Folks-$(api_version) \ api_version should correspond to the next stable branch (eg, it should be 0.6 now, since we're working on the unstable 0.5.x branch). I think this is missing the part where it generates the Folks-0.5.gir file: make[3]: Entering directory `/home/treitter/checkout/gnome/folks/folks' /opt/gnome/bin/g-ir-compiler --includedir=. Folks-0.5.gir -o Folks-0.5.typelib error parsing file Folks-0.5.gir: Failed to open file 'Folks-0.5.gir': No such file or directory
Raul, do you have any other feedback, since you did some work along these lines?
Review of attachment 186241 [details] [review]: Maybe the following lines + --gir=Folks-$(api_version).gir \ + --library=Folks-$(api_version) \ should be conditionally included based on the presence of HAVE_INTROSPECTION ? The GIR generated by valac didn't work for me at first. I had to manually add the following attributes to <namespace ..> : shared-library="libfolks.so.22" c:identifier-prefixes="Folks" c:symbol-prefixes="folks" We should find a way to hint valac how to get these attribs right.
(In reply to comment #3) > Review of attachment 186241 [details] [review]: > > Maybe the following lines > > + --gir=Folks-$(api_version).gir \ > + --library=Folks-$(api_version) \ > > should be conditionally included based on the presence > of HAVE_INTROSPECTION ? This gets defined in configure.ac: # this will set HAVE_INTROSPECTION GOBJECT_INTROSPECTION_REQUIRE([0.9.12]) I think part of the reason I wasn't getting Folks-0.5.gir was because my libfolks.la.stamp file was preventing the library from being re-built (thus preventing the .gir file from being generated). > The GIR generated by valac didn't work for me at first. I had > to manually add the following attributes to <namespace ..> : > > shared-library="libfolks.so.22" c:identifier-prefixes="Folks" > c:symbol-prefixes="folks" > > We should find a way to hint valac how to get these attribs right. Maxim, could you please figure out this bit?
> api_version should correspond to the next stable branch (eg, it should be 0.6 > now, since we're working on the unstable 0.5.x branch). done > should be conditionally included based on the presence > of HAVE_INTROSPECTION ? No. It doesn't depend on it. > shared-library="libfolks.so.22" c:identifier-prefixes="Folks" > c:symbol-prefixes="folks" > We should find a way to hint valac how to get these attribs right. It work fine on my machine (gobject-introspection 0.10.7). In this patch, shared-library set in gir compilation phase. c:identifier-prefixes/c:symbol-prefixes is useless. (not used in current gobject-introspection)
Created attachment 186393 [details] [review] Add GObject Introspection Support
Review of attachment 186393 [details] [review]: This looks generally good to me, but valac 0.12.0 silently failed to generate the Folks-0.6.gir file until I added this: libfolks_la_VALAFLAGS = \ + --library=folks \ I had to dig into the valac code a little to figure this out, so I've filed bug #648429 Could you please apply this change locally and check that it all works properly for you? Please run "make maintainer-clean" after applying the patch and before building. Which version of vala are you using?
Created attachment 186465 [details] [review] Add GObject Introspection Support > but valac 0.12.0 silently failed to generate the Folks-0.6.gir file until I added this: Sorry, I remove this line and check that all build fine and result, but forgot remove folks/libfolks_la_vala.stamp or make "maintainer-clean" before build. >or at least exit with an error that it must be specified. valac definitely should do this in such cases.
Merged! Sorry for the delay. commit ce07382fe7eb1bd44858c1d925caed5d2bbd16e8 Author: Maxim Ermilov <zaspire@rambler.ru> Date: Fri Apr 22 03:06:51 2011 +0400 Add GObject Introspection Support Closes: bgo#648161 NEWS | 1 + configure.ac | 8 ++++++-- folks/Makefile.am | 21 +++++++++++++++++++++ 3 files changed, 28 insertions(+), 2 deletions(-)