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 656893 - Include-the-name-of-the-created-file-in-the-gir
Include-the-name-of-the-created-file-in-the-gir
Status: RESOLVED DUPLICATE of bug 642576
Product: vala
Classification: Core
Component: Code Generator
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2011-08-19 10:45 UTC by Fabian Deutsch
Modified: 2011-08-21 17:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
The proposed patch to pass the name of the output to the girwriter. (2.25 KB, patch)
2011-08-19 10:45 UTC, Fabian Deutsch
none Details | Review

Description Fabian Deutsch 2011-08-19 10:45:11 UTC
Created attachment 194214 [details] [review]
The proposed patch to pass the name of the output to the girwriter.

Sometimes it is helpful if the name of a shared-object corresponding to a gir file is named in the namespace tag of the gir file using the shared-library-attribute.
With this patch it is a straight forward way to created introspectable libraries in two lines:

# valac --pkg gio-2.0 --library=Atest --gir=Atest-0.1.gir -o libAtest.so --Xcc="-shared" --Xcc="-fPIC" A.vala
# g-ir-compiler Atest-0.1.gir > Atest-0.1.typelib
# ls
Atest-0.1.gir
Atest-0.1.typelib
Atest.vapi
A.vala
Comment 1 Luca Bruno 2011-08-19 11:28:41 UTC
We need another option switch for passing the libfoo.so to gir because:
1) it might happen to have multiple .so
2) you can generate a gir but the .so using gcc directly, not necessarily with -o and -X -shared

Something like --gir-library or such.
Comment 2 Fabian Deutsch 2011-08-19 12:56:43 UTC
(In reply to comment #1)
> We need another option switch for passing the libfoo.so to gir because:
> 1) it might happen to have multiple .so

But you can't have multiple .so files with stock valac, or can you?
What about adding a real "create library" functionality to the ccompiler, so valac is able to build shared objects.
Would this make sense?

> 2) you can generate a gir but the .so using gcc directly, not necessarily with
> -o and -X -shared
> 
> Something like --gir-library or such.

I'd suggest --gir-shared-library to match the corresponding tag.
Comment 3 Fabian Deutsch 2011-08-19 14:32:40 UTC
Looking at the source of gobject-introspection [1], it seems that we need to pass the libraries, otherwise shared libraries won't be found.

--
1: http://git.gnome.org/browse/gobject-introspection/tree/girepository/gitypelib.c#n2142
Comment 4 Fabian Deutsch 2011-08-21 17:38:53 UTC
On IRC was pointed out, that the shared-library can also be passed to gircompiler, so closing this.

*** This bug has been marked as a duplicate of bug 642576 ***