On Thu,  7 Jan 2021 17:13:09 -0600
William Hubbs <willi...@gentoo.org> wrote:

> Bug: https://bugs.gentoo.org/762769
> Signed-off-by: William Hubbs <willi...@gentoo.org>
> ---
>  eclass/lua-utils.eclass | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/eclass/lua-utils.eclass b/eclass/lua-utils.eclass
> index 100be14cb08..1e552da0848 100644
> --- a/eclass/lua-utils.eclass
> +++ b/eclass/lua-utils.eclass
> @@ -212,8 +212,10 @@ _lua_get_library_file() {
>                       die "Invalid implementation: ${impl}"
>                       ;;
>       esac
> -     libdir=$($(tc-getPKG_CONFIG) --variable libdir ${impl}) || die
>  
> +     libdir=$($(tc-getPKG_CONFIG) --variable libdir ${impl}) || die
> +     libdir="${libdir#${ESYSROOT#${SYSROOT}}}"
> +     
>       debug-print "${FUNCNAME}: libdir = ${libdir}, libname = ${libname}"
>       echo "${libdir}/${libname}"
>  }
> @@ -274,6 +276,7 @@ _lua_export() {
>                               local val
>  
>                               val=$($(tc-getPKG_CONFIG) --variable 
> INSTALL_CMOD ${impl}) || die
> +                             val="${val#${ESYSROOT#${SYSROOT}}}"
>  
>                               export LUA_CMOD_DIR=${val}
>                               debug-print "${FUNCNAME}: LUA_CMOD_DIR = 
> ${LUA_CMOD_DIR}"
> @@ -282,6 +285,7 @@ _lua_export() {
>                               local val
>  
>                               val=$($(tc-getPKG_CONFIG) --variable includedir 
> ${impl}) || die
> +                             val="${val#${ESYSROOT#${SYSROOT}}}"
>  
>                               export LUA_INCLUDE_DIR=${val}
>                               debug-print "${FUNCNAME}: LUA_INCLUDE_DIR = 
> ${LUA_INCLUDE_DIR}"
> @@ -298,6 +302,7 @@ _lua_export() {
>                               local val
>  
>                               val=$($(tc-getPKG_CONFIG) --variable 
> INSTALL_LMOD ${impl}) || die
> +                             val="${val#${ESYSROOT#${SYSROOT}}}"
>  
>                               export LUA_LMOD_DIR=${val}
>                               debug-print "${FUNCNAME}: LUA_LMOD_DIR = 
> ${LUA_LMOD_DIR}"

NACK.

The _lua_get_library_file() result is used for lua_get_shared_lib() and
this appears to be always used when building, not when installing. In
that case, you want it to return the prefixed (and sysrooted) path or
callers should always prepend ${ESYSROOT}.

Similarly, lua_get_include_dir() is often used for building but is
sometimes used for installing too. luaexpat uses it for both! If this
is returned unprefixed then luaexpat and similar should prepend
${ESYSROOT} when building and ${ED} when installing. 

I did suggest that you explicitly whether the paths are prefixed or not
in the function descriptions so please do that.

As discussed, I'll get back to you on the other sysroot issue.

-- 
James Le Cuirot (chewi)
Gentoo Linux Developer

Attachment: pgp2lt1tHBLfK.pgp
Description: OpenPGP digital signature

Reply via email to