Re: [Vala] vapigen and Autotools problem
I've finally generated all the .vapi files I needed. The error was in the call to vapigen itself. The library was uninstalled, so I had to tell vapigen where to look for the uninstalled .gir files. I didn't know I could use the --girdir option multiple times, and that's exactly what I needed. Thanks for your help! Regards, Alex ___ vala-list mailing list vala-list@gnome.org http://mail.gnome.org/mailman/listinfo/vala-list
[Vala] vapigen and Autotools problem
Hi, vala-list. Before anything else, I have to say I'm new to Vala and also to vapigen usage. I've been working on a library which uses GObject and GTK + and is written in C, now other developers are going to use this library to write an application, but they will do it using Vala, so I'm currently binding it using GObjectIntrospecton and vapigen, both integrated with the GNU Autotools. The directory structure of the library is composed by 4 directories, each of which contains an alredy generated .gir file. I've managed to integrate GObjectInstrospection in the project, and right now I'm dealing with vapigen (whose documentation about integration with Autotools doesn't exist, currently). The 4 directories have an horizontal dependency so the .gir of the first one is needed to generate the .gir (and .vapi) of the next one and so on with all of them, all being in the same level of the build tree. To generate the .girs I've used the --include-uninstalled option to include the previously generated .gir file of the project. Now, when the build system tries to run vapigen to generate a .vapi that depends on another part of the library, it fails. The call to vapigen is something like this: $(VAPIGEN) --pkg glib-2.0 --pkg gobject-2.0 --pkg gvn-0.1 -d $(vapidir) --vapidir=$(vapidir) --library foo-0.1 Foo-0.1.gir The .vapi file of the gvn package is alredy generated (and put in the directory specified via the --vapidir option) at this point, as well as the .gir of the current package. And this is the error it produces: error: Package `Gvn-0.1' not found in specified Vala API directories or GObject-Introspection GIR directories I guess it has something to do with the package not being installed, but I couldn't find a way to tell it to vapigen. However that's just a guess, so I don't really know what i'm doing wrong and/or how to solve this. Can anyone help me with it? Thanks in advance! Regards, Alex PS: sorry if my english is a mess, if something is not clear tell me and I'll try to rewrite it. ___ vala-list mailing list vala-list@gnome.org http://mail.gnome.org/mailman/listinfo/vala-list
Re: [Vala] vapigen and Autotools problem
August, I just didn't know that. Reading the documentation and looking at an official gnome project (GDA, that does the same thing I was trying to do) I though it was the only way to bind C to Vala. And the other developers I mentioned are using Vala by the first time, too. If I can do this that way I'll save some time! Can you give me some reference to that method? Thanks! Alex El 27 de marzo de 2012 16:48, august aug...@alien.mur.at escribió: Alejandro, Is there a reason to create a .vapi file? Couldn't your vala developers just use the .gir file? AFAIK, that is the preferred method for binding to vala if you are already writing gobject libs. -august. Hi, vala-list. Before anything else, I have to say I'm new to Vala and also to vapigen usage. I've been working on a library which uses GObject and GTK + and is written in C, now other developers are going to use this library to write an application, but they will do it using Vala, so I'm currently binding it using GObjectIntrospecton and vapigen, both integrated with the GNU Autotools. The directory structure of the library is composed by 4 directories, each of which contains an alredy generated .gir file. I've managed to integrate GObjectInstrospection in the project, and right now I'm dealing with vapigen (whose documentation about integration with Autotools doesn't exist, currently). The 4 directories have an horizontal dependency so the .gir of the first one is needed to generate the .gir (and .vapi) of the next one and so on with all of them, all being in the same level of the build tree. To generate the .girs I've used the --include-uninstalled option to include the previously generated .gir file of the project. Now, when the build system tries to run vapigen to generate a .vapi that depends on another part of the library, it fails. The call to vapigen is something like this: $(VAPIGEN) --pkg glib-2.0 --pkg gobject-2.0 --pkg gvn-0.1 -d $(vapidir) --vapidir=$(vapidir) --library foo-0.1 Foo-0.1.gir The .vapi file of the gvn package is alredy generated (and put in the directory specified via the --vapidir option) at this point, as well as the .gir of the current package. And this is the error it produces: error: Package `Gvn-0.1' not found in specified Vala API directories or GObject-Introspection GIR directories I guess it has something to do with the package not being installed, but I couldn't find a way to tell it to vapigen. However that's just a guess, so I don't really know what i'm doing wrong and/or how to solve this. Can anyone help me with it? Thanks in advance! Regards, Alex PS: sorry if my english is a mess, if something is not clear tell me and I'll try to rewrite it. ___ vala-list mailing list vala-list@gnome.org http://mail.gnome.org/mailman/listinfo/vala-list -- http://aug.ment.org GPG: 0A8D 2BC7 243D 57D0 469D 9736 C557 458F 003E 6952 ___ vala-list mailing list vala-list@gnome.org http://mail.gnome.org/mailman/listinfo/vala-list
Re: [Vala] vapigen and Autotools problem
Alejandro, Is there a reason to create a .vapi file? Couldn't your vala developers just use the .gir file? AFAIK, that is the preferred method for binding to vala if you are already writing gobject libs. -august. Hi, vala-list. Before anything else, I have to say I'm new to Vala and also to vapigen usage. I've been working on a library which uses GObject and GTK + and is written in C, now other developers are going to use this library to write an application, but they will do it using Vala, so I'm currently binding it using GObjectIntrospecton and vapigen, both integrated with the GNU Autotools. The directory structure of the library is composed by 4 directories, each of which contains an alredy generated .gir file. I've managed to integrate GObjectInstrospection in the project, and right now I'm dealing with vapigen (whose documentation about integration with Autotools doesn't exist, currently). The 4 directories have an horizontal dependency so the .gir of the first one is needed to generate the .gir (and .vapi) of the next one and so on with all of them, all being in the same level of the build tree. To generate the .girs I've used the --include-uninstalled option to include the previously generated .gir file of the project. Now, when the build system tries to run vapigen to generate a .vapi that depends on another part of the library, it fails. The call to vapigen is something like this: $(VAPIGEN) --pkg glib-2.0 --pkg gobject-2.0 --pkg gvn-0.1 -d $(vapidir) --vapidir=$(vapidir) --library foo-0.1 Foo-0.1.gir The .vapi file of the gvn package is alredy generated (and put in the directory specified via the --vapidir option) at this point, as well as the .gir of the current package. And this is the error it produces: error: Package `Gvn-0.1' not found in specified Vala API directories or GObject-Introspection GIR directories I guess it has something to do with the package not being installed, but I couldn't find a way to tell it to vapigen. However that's just a guess, so I don't really know what i'm doing wrong and/or how to solve this. Can anyone help me with it? Thanks in advance! Regards, Alex PS: sorry if my english is a mess, if something is not clear tell me and I'll try to rewrite it. ___ vala-list mailing list vala-list@gnome.org http://mail.gnome.org/mailman/listinfo/vala-list -- http://aug.ment.org GPG: 0A8D 2BC7 243D 57D0 469D 9736 C557 458F 003E 6952 ___ vala-list mailing list vala-list@gnome.org http://mail.gnome.org/mailman/listinfo/vala-list
Re: [Vala] vapigen and Autotools problem
Abderrahim, I did. In fact I needed to, in order to generate the Sql-0.1.gir and the subsequent .girs'. I noted that the name the error gives to the package is not the same I gave it when exporting it. I called it gvn-0.1 and the error talks about Gvn-0.1, which is not a correct package name. I thought vapigen parsed the name from the .gir and lower the case. May be the name the error gives to the package has no relevance, I don't know. As you can see, I'm kind of lost right now in all this .vapi generation thing (it's the first time I use a mailing list!), but I guess this is the funniest part of programming. Thanks for the link, I'll give it a look. Thanks! Regards, Alex. El 27 de marzo de 2012 18:07, Abderrahim Kitouni a.kito...@gmail.comescribió: في ث، 27-03-2012 عند 17:05 +0200 ، كتب Alejandro T Colombini Gómez: August, I just didn't know that. Reading the documentation and looking at an official gnome project (GDA, that does the same thing I was trying to do) I though it was the only way to bind C to Vala. And the other developers I mentioned are using Vala by the first time, too. If I can do this that way I'll save some time! Can you give me some reference to that method? Actually, the recommended way to use a gobject library from Vala is to generate the vapi from the GIR. It's actually possible to use the GIR directly, but I'm not sure whether it's a good idea. Anyway, in case you didn't already see it, look at this: http://live.gnome.org/Vala/UpstreamGuide As for your question: To generate the .girs I've used the --include-uninstalled option to include the previously generated .gir file of the project. Now, when the build system tries to run vapigen to generate a .vapi that depends on another part of the library, it fails. The call to vapigen is something like this: $(VAPIGEN) --pkg glib-2.0 --pkg gobject-2.0 --pkg gvn-0.1 -d $(vapidir) --vapidir=$(vapidir) --library foo-0.1 Foo-0.1.gir The .vapi file of the gvn package is alredy generated (and put in the directory specified via the --vapidir option) at this point, as well as the .gir of the current package. And this is the error it produces: error: Package `Gvn-0.1' not found in specified Vala API directories or GObject-Introspection GIR directories Just a guess, but I think the problem is that your gir file doesn't reference the package, and so valac doesn't know that gvn-0.1.vapi and Gvn-0.1.gir are the same. You have to add --pkg-export=gvn-0.1 to your g-ir-scanner flags. HTH, Abderrahim ___ vala-list mailing list vala-list@gnome.org http://mail.gnome.org/mailman/listinfo/vala-list
Re: [Vala] vapigen and Autotools problem
August, I just didn't know that. Reading the documentation and looking at an official gnome project (GDA, that does the same thing I was trying to do) I though it was the only way to bind C to Vala. And the other developers I mentioned are using Vala by the first time, too. If I can do this that way I'll save some time! Can you give me some reference to that method? If you have already created the .gir file and installed it in the proper location (with other gir files), then you should be able to use it directly in vala code. For example, if you are writing a gobject lib called Mylib, you create a Mylib-1.0.gir file and then a typelib file with something like: g-ir-compiler --includedir $(PREFIX)/share/gir-1.0/ Mylib-1.0.gir -o Mylib-1.0.typelib and put the .gir file under $(PREFIX)/share/gir-1.0/ and put the .typelib file under $(PREFIX)/lib/girepository-1.0/ then, vala users _should_ be able to call your api with: using Mylib-1.0; Since you are creating a GObject lib, I _thought_ the preferred method was through .gir and not .vapia. But, I could be wrong. I remember getting advised to do it this way on IRC. Of course, I am writing my gobject C lib in VALA, so that may have been why I was given that advice. If any of this is wrong, I would also love to know the proper methodwith or without autotools. thanks, best, suerte -august. -- http://aug.ment.org GPG: 0A8D 2BC7 243D 57D0 469D 9736 C557 458F 003E 6952 ___ vala-list mailing list vala-list@gnome.org http://mail.gnome.org/mailman/listinfo/vala-list