Currently media-libs/libquvi-0.4.1-r1 depends on >=dev-lang/lua-5.1, but does not compiles with lua:5.2
Dependency must be adjusted to lua:5.1 or <lua-5.2
I hit this problem too (at least, I guess it's the same problem; OP didn't provide many details). In my case I not only had to have lua-5.1 installed, but also selected with 'eselect lua' before libquvi would compile.
The case where lua-5.1 is not installed manifests as a configure error because pkgconfig can't find the right version. The case where it's not selected manifests as a compile-time missing header error because the header isn't symlinked to the expected place.
Sorry, I didn't catch the exact error messages to paste here.
Trivial patch for current stable libquvi-0.4.1-r1.ebuild:
Author: nE0sIghT <email@example.com>
Date: Tue Jan 6 18:33:46 2015 +0300
Fixed lua dependency - https://bugs.gentoo.org/show_bug.cgi?id=517500
diff --git a/media-libs/libquvi/libquvi-0.4.1-r1.ebuild b/media-libs/libquvi/libquvi-0.4.1-r1.ebuild
index 3f5f873..a46b11e 100644
@@ -18,7 +18,7 @@ IUSE="examples static-libs"