Re: [Vala] vapigen and Autotools problem



في ث، 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




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]