[Pkg-vala-maintainers] Bug#564088: Name of lua.vapi does not match pkg-config name
Enrico Zini
enrico at debian.org
Thu Jan 7 16:21:37 UTC 2010
Package: valac
Version: 0.7.8-2
Severity: normal
Hello, and thank you for maintaning Vala.
Given this test.vala:
static int main (string[] args) {
Lua.LuaVM lua = new Lua.LuaVM();
return 0;
}
It cannot be linked because "pkg-config --cflags lua" does not work:
$ valac --pkg lua test.vala
test.vala:2.15-2.35: warning: local variable `lua' declared but never used
Lua.LuaVM lua = new Lua.LuaVM();
^^^^^^^^^^^^^^^^^^^^^
/tmp/test.vala.c:7:17: error: lua.h: No such file or directory
/tmp/test.vala.c: In function ‘_main’:
/tmp/test.vala.c:21: error: ‘lua_State’ undeclared (first use in this function)
/tmp/test.vala.c:21: error: (Each undeclared identifier is reported only once
/tmp/test.vala.c:21: error: for each function it appears in.)
/tmp/test.vala.c:21: error: ‘lua’ undeclared (first use in this function)
/tmp/test.vala.c:22: error: expected expression before ‘)’ token
error: cc exited with status 256
Compilation failed: 1 error(s), 1 warning(s)
$ pkg-config --cflags lua
Package lua was not found in the pkg-config search path.
Perhaps you should add the directory containing `lua.pc'
to the PKG_CONFIG_PATH environment variable
No package 'lua' found
However, this can be worked around by giving the .vapi file a name that
matches pkg-config:
$ pkg-config --cflags lua5.1
-I/usr/include/lua5.1
$ ln -s /usr/share/vala/vapi/lua.vapi lua5.1.vapi
$ valac --vapidir . --pkg lua5.1 test.vala
test.vala:2.15-2.35: warning: local variable `lua' declared but never used
Lua.LuaVM lua = new Lua.LuaVM();
^^^^^^^^^^^^^^^^^^^^^
/tmp/test.vala.c: In function ‘_main’:
/tmp/test.vala.c:22: warning: cast to pointer from integer of different size
Compilation succeeded - 1 warning(s)
Ideally, different Lua API versions should have different .vapis
matching their differences, if any. But if there are not may
differences, maybe just shipping the symlinks to the various
api-specific pkg-config names will do.
Cheers,
Enrico
-- System Information:
Debian Release: squeeze/sid
APT prefers testing
APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.30-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages valac depends on:
ii libc6 2.10.2-2 GNU C Library: Shared libraries
ii libglib2.0-0 2.22.3-1 The GLib library of C routines
ii libglib2.0-dev 2.22.3-1 Development files for the GLib lib
ii libvala0 0.7.8-2 C# like language for the GObject s
valac recommends no packages.
valac suggests no packages.
-- no debconf information
More information about the Pkg-vala-maintainers
mailing list