The ebuild contains some slashes in paths that are not needed. Particularly, there is a double slash for most systems in the line: > RPATH="${ROOT}/usr/$(get_libdir)/" \ as ${ROOT} expands in most times to /, yielding a preceding double slash. This is ugly as this double slash spreads throughout the system, because libtool adapts the path for other programs that link against lua (and then not only for the path of the lua library, but also for other libraries in the same directory). I will attach a patch for the dev-lang/lua-5.1.4-r6 ebuild, removing this and other slashes that I think are not needed. Also a typo in a comment is fixed. btw: there are some patches in ${FILESDIR}/5.1.3 - can they be deleted?
Created attachment 256311 [details, diff] patch removing slashes and fixing a typo typo: Not that -> Note that
Created attachment 256390 [details, diff] does the same thing, but is more careful
Why not simply use ${ROOT:-/}? That would simplify the patch rather much.
I don't understand what exactly your expression does. However, you are right: it is possible to make things more simple. I guess RPATH="${ROOT%/}/usr/$(get_libdir)/" \ should do the trick.
I've comitted lua-5.1.4-r7, which should fix this. ${ROOT} wasn't allowed there, anyway.