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 648161 - Add GObject Introspection Support
Add GObject Introspection Support
Status: RESOLVED FIXED
Product: folks
Classification: Platform
Component: libfolks
git master
Other Linux
: Normal normal
: folks-0.5.1
Assigned To: folks-maint
folks-maint
Depends on:
Blocks:
 
 
Reported: 2011-04-18 22:18 UTC by Maxim Ermilov
Modified: 2011-04-26 17:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add GObject Introspection Support (1.82 KB, patch)
2011-04-18 22:18 UTC, Maxim Ermilov
needs-work Details | Review
Add GObject Introspection Support (2.07 KB, patch)
2011-04-20 20:42 UTC, Maxim Ermilov
needs-work Details | Review
Add GObject Introspection Support (2.09 KB, patch)
2011-04-21 23:08 UTC, Maxim Ermilov
none Details | Review

Description Maxim Ermilov 2011-04-18 22:18:41 UTC
Created attachment 186241 [details] [review]
Add GObject Introspection Support

(after apply this patch need manually remove folks/libfolks_la_vala.stamp)
Comment 1 Travis Reitter 2011-04-19 23:10:46 UTC
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
Comment 2 Travis Reitter 2011-04-19 23:11:17 UTC
Raul, do you have any other feedback, since you did some work along these lines?
Comment 3 Raul Gutierrez Segales 2011-04-20 08:52:06 UTC
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.
Comment 4 Travis Reitter 2011-04-20 16:29:11 UTC
(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?
Comment 5 Maxim Ermilov 2011-04-20 20:39:12 UTC
> 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)
Comment 6 Maxim Ermilov 2011-04-20 20:42:22 UTC
Created attachment 186393 [details] [review]
Add GObject Introspection Support
Comment 7 Travis Reitter 2011-04-21 22:37:32 UTC
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?
Comment 8 Maxim Ermilov 2011-04-21 23:08:16 UTC
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.
Comment 9 Travis Reitter 2011-04-26 17:02:49 UTC
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(-)