devel/lua-stdlib installs docs in doc/stdlib, which is (a) rather too generic a name and (b) doesn't include the Lua version, so it conflicts if you try and install the module for multiple Lua versions.
Do we support multiple lua versions now? I think only the default lua version is chosen.
(In reply to Sunpoet Po-Chuan Hsieh from comment #1) We certainly support installing multiple versions of the language itself, and each version gets its own module directories. The module itself works fine if you build it multiple times for different versions, but unless you turn off the DOCS option the resulting packages conflict on the docs files. With 5.4 coming out soon this is only becoming more of an issue. The Lua language port for 5.3 is likely to be updated soon for 5.3.5 (see https://reviews.freebsd.org/D13690 ) and it will install its own docs under doc/lua53/lua, intentionally leaving open the possibility for lua libraries to install docs in doc/lua53/${PORTNAME} or similar. I have also proposed adding FLAVOR support to lua.mk (see https://reviews.freebsd.org/D16494 ) which would simplify handling of this.
Close as fixed by addition of flavor support in r531700.