This was brought up in https://bugs.gentoo.org/show_bug.cgi?id=534150 by Dennis Schridde. We need a lua.eclass to handle installation of dev-lua packages for different lua implementations, because using usex hacks to install for different versions isn't ideal. I believe it should support at least the following: LUA_TARGETS="lua5_1 lua5_2 lua5_3 luajit"
Hello. Current lua maintainers not interested in multislotted lua implementation (https://github.com/gentoo/gentoo/pull/2264). In other side, they not provide solution for universal compatibility between lua 5.* and their modules.
Multislotted Lua is now live, so closing here :-)