What I would like propose is that upstream Lua provides the concept of vendor_prefix and site_prefix so we could have a clean way to specify the vendor and site search paths.
Maybe something like:
# define LUA_VENDOR_ROOT "/usr/"
# define LUA_VENDOR_LDIR LUA_VENDOR_ROOT "share/lua" LUA_VDIR
# define LUA_VENDOR_CDIR LUA_VENDOR_ROOT "lib/lua" LUA_VDIR
# define LUA_SITE_ROOT "/usr/local/"
# define LUA_SITE_LDIR LUA_SITE_ROOT "share/lua" LUA_VDIR
# define LUA_SITE_CDIR LUA_SITE_ROOT "lib/lua" LUA_VDIR
It would also be awesome if this could be detected at runtime:
lua -e 'print(package.vendor_path)'
lua -e 'print(package.site_path)'
Some variables for those in lua-<version>.pc would also be nice.
That way we packages could install things in the vendor_path without worrying that we conflict with locally, manually built/managed modules.