When told to install Lua bindings (USE=lua), at least version 5.2.0 of libprelude produces compiled Lua modules. This happens in both ebuilds depending directly on dev-lang/lua and those migrated to Lua eclasses. While I haven't got an appropriate link to official documentation at hand, having consulted Gentoo Lua experts during my work on Lua eclasses I am fairly confident compiled modules must not link against liblua. Indeed, that is what allows dev-lang/lua:5.1 and dev-lang/luajit to share module directories without causing massive cross-talk. With any luck this might be a simple matter of dropping unnecessary linker flags. Regardless of whether this is as simple as that or more radical changes are necessary, please notify upstream.
---------- AC_ARG_WITH(lua, AC_HELP_STRING(--with-lua-config@<:@=PATH@:>@, Enable support for lua binding @<:@default=auto@:>@), [lua_required=true; if test x$withval = xyes; then with_lua="lua-config"; fi], with_lua="lua-config") if test x$with_lua != xno; then lua_pkg_found=0 m4_foreach([lua_ver],[[lua],[lua5.1],[lua5.2]], [PKG_CHECK_MODULES(LUA, [lua_ver >= 5.1], [ AC_DEFINE([HAVE_LUA], [1], [liblua]) AC_DEFINE([HAVE_LUA_H], [1], [lua.h]) lua_pkg_found=1 ],[:])] ) if test x$lua_pkg_found = x0; then AC_MSG_WARN([*** lua >= 5.1 not found]) fi if test x$lua_pkg_found = x1; then AC_SUBST(LUA_CFLAGS) AC_SUBST(LUA_LIBS) old_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$LUA_CFLAGS" AC_CHECK_HEADERS([lua.h lauxlib.h], with_lua=yes, [with_lua=no; break]) CPPFLAGS="$old_CPPFLAGS" LUA_VERSION=$(lua -e "print(string.sub(_VERSION, 5))") AC_SUBST(LUA_VERSION) else dnl try lua 5.0 AC_PATH_PROG(LUA_CONFIG, `basename $with_lua`, no, `dirname $with_lua`:$PATH) if test x$LUA_CONFIG = xno; then if test x$lua_required = xtrue; then AC_MSG_ERROR([Could not find $with_lua binary]) fi with_lua=no else LUA_CFLAGS=`$LUA_CONFIG --include --vmonly` LUA_LIBS=`$LUA_CONFIG --libs --vmonly` AC_SUBST(LUA_CFLAGS) AC_SUBST(LUA_LIBS) old_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$LUA_CFLAGS" AC_CHECK_HEADERS([lua.h lauxlib.h], with_lua=yes, [with_lua=no; break]) CPPFLAGS="$old_CPPFLAGS" LUA_VERSION=$(lua -e "print(string.sub(_VERSION, 5))") AC_SUBST(LUA_VERSION) fi fi fi ... ... ... bindings/lua/Makefile ---------- I guess this is where we need to look at?
Okay, so having had a moment to spare I've just told the migrated ebuild to patch LUA_LIBS out of bindings/lua/Makefile.am. This seems to be sufficient, the compiled lua module still builds fine and can be loaded without errors by the corresponding Lua intepreter. I have not run the test suite though so if there are any Lua-related tests in there, you might want to try that as well. Moreover, I haven't touched the unmigrated ebuilds.
https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7cc9f60c84c4cb2ad8ffaf5407245f19e0a4b73b commit 7cc9f60c84c4cb2ad8ffaf5407245f19e0a4b73b Author: Marek Szuba <marecki@gentoo.org> AuthorDate: 2020-12-07 23:42:31 +0000 Commit: Marek Szuba <marecki@gentoo.org> CommitDate: 2020-12-07 23:44:45 +0000 dev-libs/libprelude-5.2.0-r10: do not link Lua bindings against liblua This is neither allowed for compiled Lua modules nor, as demonstrated by the fact simply dropping this from linker options works just fine, actually needed in this case. Signed-off-by: Marek Szuba <marecki@gentoo.org>
Seems to be fixed, so closing?