Depending on which dev-lang/lua is eselected, dev-lua/lgi installs differently: With 5.2, it installs the relevant files into /usr/share/lua/, notably /usr/share/lua/lgi.lua . With 5.1 selected, it installs into /usr/share/lua/5.1/, including /usr/share/lua/5.1/lgi.lua . It should probably install both, and then (a newer version of?) lua.eselect should set a default one symlinked at /usr/share/lua/lgi.lua, maybe?
The eselect module is terrible crap, please don't support it. I hope it will be removed from the tree.
Please see bug #534150 for a draft of how dev-lua/* packages could be build against multiple versions of Lua.
bug #657722 should be helpful for this
This should be fixed in future, when slotted lua will be unmasked. robbat2 was so kind and added support for slotted lua. -> https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0e95c6e912a781a82fa7394ca5a4aa0dc92b2b8b