On Sun, Nov 3, 2019, at 01:05, Stuart Henderson wrote: > On 2019/10/21 13:12, Stuart Henderson wrote: > > Reviewing libluv/luv again as asked by Edd, I got rather confused that > > it installed libluv.so.0.0 in /usr/local/lib which isn't usable from Lua > > (which would expect luv.so in /usr/local/lib/lua/5.x aka MODLUA_LIBDIR). > > Of course running one of the test programs shown in upstream's docs fails > > because Lua can't find it. > > > > After a while I figured out that this is the "Build as shared library" > > option from https://github.com/luvit/luv/ and isn't usable from Lua > > so I think at least the DESCR and COMMENT are misleading, and the > > package name is a bit confusing too, "libluv" would be better. > > It's also a bit fiddly because the lib uses functions from the Lua > > shared library, so depends on a particular Lua version, but this isn't > > recorded in libluv.so NEEDED section. > > ^^^ this is the main reason why I didn't like the libluv port. > How would you propose to handle it if some other ports uses libluv but > needs a different Lua version? >
Thanks, I understand what you were saying now. I went to look at what others were doing to solve this. It looks like FreeBSD and Arch don't do it in a way that addresses your concerns. Debian has a package with 3 different luv.so files, one each for Lua 5.1, 5.2, and 5.3. Fedora has two packages, one for Lua 5.1 and one for Lua 5.3. Debian and Fedora put them in lua/5.x, similar to your suggestion. I found this: https://github.com/neovim/neovim/wiki/Building-Neovim#third-party-dependencies And then went and looked harder at just using the bundled luv dep, and I got it to work. How does this look? It will also require the updated unibilium and libvterm that I'd previously provided. diff --git Makefile Makefile index e9b174a..368a5df 100644 --- Makefile +++ Makefile @@ -4,7 +4,7 @@ COMMENT = continuation and extension of Vim GH_ACCOUNT = neovim GH_PROJECT = neovim -GH_TAGNAME = v0.3.8 +GH_TAGNAME = v0.4.2 CATEGORIES = editors devel HOMEPAGE = https://neovim.io @@ -14,7 +14,7 @@ MAINTAINER = Edd Barrett <[email protected]> PERMIT_PACKAGE = Yes WANTLIB += c iconv intl ${MODLUA_WANTLIB} m msgpackc pthread termkey -WANTLIB += unibilium util uv vterm +WANTLIB += unibilium>=1.0 util uv vterm>=0.1 COMPILER = base-clang ports-gcc base-gcc @@ -38,10 +38,21 @@ RUN_DEPENDS += devel/libmpack/lua \ devel/libmpack/main \ devel/desktop-file-utils -MAKE_FLAGS += USE_BUNDLED_DEPS=OFF +MAKE_FLAGS += USE_BUNDLED=OFF CONFIGURE_ARGS += -DLUA_PRG=${MODLUA_BIN} \ -DLUA_INCLUDE_DIR=${MODLUA_INCL_DIR} \ -DLUA_LIBRARIES=${MODLUA_LIB} \ + -DUSE_BUNDLED_GPERF=Off \ + -DUSE_BUNDLED_UNIBILIUM=Off \ + -DUSE_BUNDLED_LIBTERMKEY=Off \ + -DUSE_BUNDLED_LIBVTERM=Off \ + -DUSE_BUNDLED_LIBUV=Off \ + -DUSE_BUNDLED_MSGPACK=Off \ + -DUSE_BUNDLED_LUAJIT=Off \ + -DUSE_BUNDLED_LUAROCKS=Off \ + -DUSE_BUNDLED_LUV=On \ + -DLIBLUV_INCLUDE_DIR=${WRKBUILD}/.deps/usr/include \ + -DLIBLUV_LIBRARY=${WRKBUILD}/.deps/usr/lib/libluv.a \ -DPREFER_LUA=ON # disables LuaJIT # Tests need gmake @@ -51,6 +62,13 @@ TEST_DEPENDS = shells/bash \ editors/py-neovim \ editors/py-neovim,python3 +# Build third-party dependencies first. This is necessary because we require +# the bundled libluv. +pre-configure: + mkdir -p ${WRKBUILD}/.deps + cd ${WRKBUILD}/.deps && cmake ${CONFIGURE_ARGS} ${WRKSRC}/third-party && \ + ${MAKE_PROGRAM} + # These are the "old tests". There is also a new suite, but we would need the # "busted" test suite for Lua, which is not yet ported. #
