GNOME Bugzilla – Bug 572075
Make the scanner work with static and convenience libraries
Last modified: 2015-02-07 17:02:29 UTC
We need to reference the get_type() functions we are going to dlsym or otherwise the linker may not include them in the introspection binary. giscanner/dumper.py: Accept a list of _get_type() functions and write an array referencing them into the introspection binary. giscanner/glibtransformer.py: Break parsing into too stages - the stage where we compute the _get_type() functions and the stage where we invoke the introspection binary. tools/g-ir-scanner: Pass _get_type() functions from the scanner when creating the introspection binary.
Created attachment 128870 [details] [review] Make the scanner work with static and convenience libraries
I wrote this patch so I could generate a separate .gir for a part of Clutter (ClutterJson) that is compiled as a convenience library in a subdir and then linked into the main library. There's a definite caveat here - the gir generated by g-ir-scanner will have: shared-library="clutter-json" And g-ir-compiler will die. While the right thing is to have something like: shared-library="libclutter-glx-0.9.so.0" But that library hasn't even been built yet (and will be built one level up) And I'm not really sure how to work around that short of some really gross hacks. (I'm going to try and see if I can get those hacks to work.) So, while I think this patch is clean and the right thing to do, most practical uses will have similar problems.
Got the hacks to work successfully: http://bugzilla.openedhand.com/show_bug.cgi?id=1450 See how clutter/Makefile.am creates ClutterJson.gir by munging the ClutterJson.gir in the subdir with the shared-library="" from Clutter.gir.
Looks good to me.
Pushed
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]