Re: [Vala] Difference between setting "vapidir" and adding a .vapi file (was "Global key shortcuts")



On Sun, 2016-08-21 at 01:35 +0200, rastersoft wrote:
Hi:

Mmmmm... So your system has keybinder.vapi installed systemwide? I
use
debian sid and it isn't installed...

No, I was testing with a different package.  There is a keybinder3-
devel package on Fedora which contains the relevant pkg-config file,
but it doesn't seem to include a VAPI; I guess they want you to use the
GIR.  Or, of course, you can generate a VAPI yourself.

I'm not saying you shouldn't use --vapidir, just that you shouldn't use
both --pkg and the full path to the VAPI.  In other words, use either

    --pkg keybinder-3.0

Or

    path/to/vapis/keybinder-3.0.vapi

But not both.  You used both in your example.

If you need to use --vapidir that's fine.  All it does is tell Vala
where to look for VAPIs if you're using --pkg.




El 21/08/16 a las 00:53, Evan Nemerson escribió:

On Sat, 2016-08-20 at 11:09 +0200, rastersoft wrote:

Hi:

Finally I found the library "keybinder". It doesn't work no
wayland,
but
at least allows me to do what I need in X.

But now I have a problem: the VAPI file isn't available in my
system,
so
I'm adding it manually. But here comes the odd thing: if I
specify
the
VAPI file in the command line, it doesn't compile:

    valac -C captura.vala --pkg=gtk+-3.0 --pkg=keybinder-3.0
keybinder-3.0.vapi
    error: Package `keybinder-3.0' not found in specified Vala
API
directories or GObject-Introspection GIR directories
    Compilation failed: 1 error(s), 0 warning(s)

But if I just set a "vapidir" with the folder that contains the
.vapi
file, everything works fine.

    valac -C captura.vala --pkg=gtk+-3.0 --pkg=keybinder-3.0 --
vapidir=.

But with other projects, just adding the .vapi files worked fine
(like
the Autovala plugin for Gedit or Scratch, or a plugin for
GnomeBuilder
that I'm writing). In both cases the libraries are available
system-
wide.

So... why does this happen? And what is the difference between
just
specifying a .vapi file or putting a --vapidir parameter?
Don't provide both the full path to the vapi and a --pkg argument
(with
--vapidir if necessary).  Use one or the other.

That said, I can't actually reproduce this; I just get a bunch of
errors about all the symbols having already been declared (since
valac
tries to load the same vapi twice).  Maybe you're running an older
version of valac, or those aren't really the commands you're using?


-Evan

Attachment: signature.asc
Description: This is a digitally signed message part



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