Wednesday, July 26, 2023

Re: cmake/lua: fix lua autodetection

On Wed Jul 26, 2023 at 10:27:29AM +0200, Sebastien Marie wrote:
> Hi,
>
> tb@ signaled some build problems with geo/osrm-backend when lua5.4 was junked
> during the build, whereas osrm-backend is expected to use lua5.3.
>
> After looking a bit to the build, osrm-backend was using include files from
> lua5.3 and library from lua5.4: the configure stage using LUA_INCLUDE_DIR passed
> in CONFIGURE_ARGS and autodetecting the library (and picking 5.4).
>
> Passing both LUA_INCLUDE_DIR and LUA_LIBRARY in CONFIGURE_ARGS fix it.
>
> I built a set of ~50 ports on amd64 (based on ports using both devel/cmake and
> lang/lua MODULES) to ensure it creates no problem at build time.
>
> Comments or OK ?

Hmm, I can't find anything in the documentation about LUA_LIBRARY.
Otherwise I see that FreeBSD does the same with the devel/llvm*.

I think it helps more than it hurts. OK rsadowski

> --
> Sebastien Marie
>
>
> diff /data/semarie/repos/openbsd/ports
> commit - ad60a6a0d7b0467885ae2577b00a7cc55e5089c7
> path + /data/semarie/repos/openbsd/ports
> blob - 256d812ac7fa17abafdf46a3b0353240c63dbfbd
> file + devel/cmake/cmake.port.mk
> --- devel/cmake/cmake.port.mk
> +++ devel/cmake/cmake.port.mk
> @@ -88,6 +88,7 @@ CONFIGURE_ARGS += -DLUA_INCLUDE_DIR=${MODLUA_INCL_DIR}
> # Lua
> .if ${MODULES:Mlang/lua}
> CONFIGURE_ARGS += -DLUA_INCLUDE_DIR=${MODLUA_INCL_DIR}
> +CONFIGURE_ARGS += -DLUA_LIBRARY=${LOCALBASE}/lib/liblua${MODLUA_VERSION}.so.${MODLUA_VERSION}
> .endif
>
> # Ruby
>

No comments:

Post a Comment