Both running install.sh and installing luaver with homebrew installs an old version of luaver. This basically makes the function __luaver_get_platform() outdated. In MacOSX systems this means that luaver thinks it’s running on linux, and compilation obviously fails.
Revisions were a bit overloaded, and I was speaking from outdated information, my bad : https://github.com/Homebrew/brew/issues/38
I’m pretty sure there’s still a way to do this via git commit and version number. If I have time, I’ll try it out.