On 2019/10/01 22:01, Travis Cole wrote:
> > I notice that the source tarball bundles some dependencies in `deps/` and
> > uses them once during the build:
> > ---8<---
> > ===> Building for libluv-1.30.1.1
> > [1/3] /usr/local/pobj/libluv-1.30.1.1/bin/cc -DLUA_USE_DLOPEN -Dluv_EXPORTS
> > -I/usr/local/include -I/usr/local/include/lua-5.1
> > -I/usr/local/pobj/libluv-1.30.1.1/luv-1.30.1-1/deps/lua-compat-5.3 -O2
> > -pipe -g -DNDEBUG -fPIC -MD -MT CMakeFile
> > s/luv.dir/src/luv.c.o -MF CMakeFiles/luv.dir/src/luv.c.o.d -o
> > CMakeFiles/luv.dir/src/luv.c.o -c /usr/local/pobj/liblu
> > v-1.30.1.1/luv-1.30.1-1/src/luv.c
> > --->8---
> >
> > So it's using `deps/lua-compat-5.3`. I notice we have a port
> > devel/lua-compat53
> > already. It'd be best if you can make your port use it. Perhaps we should
> > `rm
> > -rf` the `deps/` directory in `pre-build:` so as to avoid accidental usage
> > of
> > bundled deps?
>
> This one I'm not totally sure what to do about. I tried your advice and it it
> breaks the build with:
>
> /usr/obj/ports/luv-1.30.1.1/luv-1.30.1-1/src/luv.c:20:10: fatal error:
> 'c-api/compat-5.3.h' file not found
> #include "c-api/compat-5.3.h"
> ^~~~~~~~~~~~~~~~~~~~
>
> lua-compat-5.3 doesn't install any headers, and no other PLIST file in ports
> has it either.
>
> I'm not sure if it's best to keep the deps dir? or are we talking about
> modifying lua-compat53 to install
> those headers?
Yes that would need lua-compat53 to install the header (and it should also
install the C file I think), but it will need to avoid adding a conflict
between the packages for the two supported Lua versions (lua-compat53 and
lua52-compat53).
> Or is there a simpler option that I'm missing?
The simpler option is to use the bundled one.
I've CC'd lua-compat53 maintainer - fcambus, do you think it's worth
complicating the lua-compat53 port to add this?
Here's a diff on top of yours. I haven't touched the lua-compat53 parts
yet but otherwise:
- zap stray <space> on PKGNAME line
- put WANTLIB in the right place
- don't BUILD_DEPENDS on cmake or set SEPARATE_BUILD, the cmake module
already does this
- standard case for NO_TEST is Yes not YES
diff -uNp -r luv-/Makefile luv/Makefile
--- luv-/Makefile Wed Oct 2 04:39:41 2019
+++ luv/Makefile Wed Oct 2 09:00:36 2019
@@ -4,7 +4,7 @@ COMMENT = libuv bindings for LuaJIT and Lua
VER = 1.30.1-1
DISTNAME = luv-${VER}
-PKGNAME = luv-${VER:S/-/./g}
+PKGNAME = luv-${VER:S/-/./g}
SHARED_LIBS += luv 0.0
@@ -15,16 +15,15 @@ HOMEPAGE = https://github.com/luvit/luv
# Apache 2.0
PERMIT_PACKAGE = Yes
+WANTLIB += uv
+
MASTER_SITES = ${HOMEPAGE}/releases/download/${VER}/
MODULES += devel/cmake \
lang/lua
-WANTLIB += uv
+BUILD_DEPENDS = devel/lua-compat53
-BUILD_DEPENDS = devel/cmake \
- devel/lua-compat53
-
LIB_DEPENDS = devel/libuv
CONFIGURE_ARGS = -DWITH_SHARED_LIBUV=ON \
@@ -33,7 +32,6 @@ CONFIGURE_ARGS = -DWITH_SHARED_LIBUV=ON \
-DBUILD_MODULE=OFF \
-DBUILD_SHARED_LIBS=ON \
-NO_TEST = YES
-SEPARATE_BUILD = YES
+NO_TEST = Yes
.include <bsd.port.mk>