public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH] eclass/lua-utils.eclass: remove EPREFIX from exported module paths
@ 2021-01-11 17:01 William Hubbs
  2021-01-13 22:51 ` James Le Cuirot
  0 siblings, 1 reply; 2+ messages in thread
From: William Hubbs @ 2021-01-11 17:01 UTC (permalink / raw
  To: gentoo-dev; +Cc: William Hubbs

Bug: https://bugs.gentoo.org/762769
Signed-off-by: William Hubbs <williamh@gentoo.org>
---
 eclass/lua-utils.eclass | 23 ++++++++++++++++++-----
 1 file changed, 18 insertions(+), 5 deletions(-)

diff --git a/eclass/lua-utils.eclass b/eclass/lua-utils.eclass
index 100be14cb08..9fe4d22e93f 100644
--- a/eclass/lua-utils.eclass
+++ b/eclass/lua-utils.eclass
@@ -212,8 +212,9 @@ _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
+	
 	debug-print "${FUNCNAME}: libdir = ${libdir}, libname = ${libname}"
 	echo "${libdir}/${libname}"
 }
@@ -274,6 +275,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 +284,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 +301,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}"
@@ -364,11 +368,14 @@ lua_get_CFLAGS() {
 # @USAGE: [<impl>]
 # @DESCRIPTION:
 # Obtain and print the name of the directory into which compiled Lua
-# modules are installed, for the given implementation. If no implementation
+# modules are installed for the given implementation. If no implementation
 # is provided, ${ELUA} will be used.
 #
-# Please note that this function requires Lua and pkg-config installed,
-# and therefore proper build-time dependencies need be added to the ebuild.
+# Please note that this function requires Lua and pkg-config to be installed,
+# and therefore proper build-time dependencies need to be added to the ebuild.
+#
+# For prefix installations, this function does not include the offset in
+# the path.
 lua_get_cmod_dir() {
 	debug-print-function ${FUNCNAME} "${@}"
 
@@ -385,6 +392,9 @@ lua_get_cmod_dir() {
 #
 # Please note that this function requires Lua and pkg-config installed,
 # and therefore proper build-time dependencies need be added to the ebuild.
+#
+# For prefix installations, this function does not include the offset in
+# the path.
 lua_get_include_dir() {
 	debug-print-function ${FUNCNAME} "${@}"
 
@@ -412,11 +422,14 @@ lua_get_LIBS() {
 # @USAGE: [<impl>]
 # @DESCRIPTION:
 # Obtain and print the name of the directory into which native-Lua
-# modules are installed, for the given implementation. If no implementation
+# modules are installed for the given implementation. If no implementation
 # is provided, ${ELUA} will be used.
 #
 # Please note that this function requires Lua and pkg-config installed,
 # and therefore proper build-time dependencies need be added to the ebuild.
+#
+# For prefix installations, this function does not include the offset in
+# the path.
 lua_get_lmod_dir() {
 	debug-print-function ${FUNCNAME} "${@}"
 
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [gentoo-dev] [PATCH] eclass/lua-utils.eclass: remove EPREFIX from exported module paths
  2021-01-11 17:01 [gentoo-dev] [PATCH] eclass/lua-utils.eclass: remove EPREFIX from exported module paths William Hubbs
@ 2021-01-13 22:51 ` James Le Cuirot
  0 siblings, 0 replies; 2+ messages in thread
From: James Le Cuirot @ 2021-01-13 22:51 UTC (permalink / raw
  To: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 4531 bytes --]

On Mon, 11 Jan 2021 11:01:33 -0600
William Hubbs <williamh@gentoo.org> wrote:

> Bug: https://bugs.gentoo.org/762769
> Signed-off-by: William Hubbs <williamh@gentoo.org>
> ---
>  eclass/lua-utils.eclass | 23 ++++++++++++++++++-----
>  1 file changed, 18 insertions(+), 5 deletions(-)
> 
> diff --git a/eclass/lua-utils.eclass b/eclass/lua-utils.eclass
> index 100be14cb08..9fe4d22e93f 100644
> --- a/eclass/lua-utils.eclass
> +++ b/eclass/lua-utils.eclass
> @@ -212,8 +212,9 @@ _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
> +	
>  	debug-print "${FUNCNAME}: libdir = ${libdir}, libname = ${libname}"
>  	echo "${libdir}/${libname}"
>  }
> @@ -274,6 +275,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 +284,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 +301,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}"
> @@ -364,11 +368,14 @@ lua_get_CFLAGS() {
>  # @USAGE: [<impl>]
>  # @DESCRIPTION:
>  # Obtain and print the name of the directory into which compiled Lua
> -# modules are installed, for the given implementation. If no implementation
> +# modules are installed for the given implementation. If no implementation
>  # is provided, ${ELUA} will be used.
>  #
> -# Please note that this function requires Lua and pkg-config installed,
> -# and therefore proper build-time dependencies need be added to the ebuild.
> +# Please note that this function requires Lua and pkg-config to be installed,
> +# and therefore proper build-time dependencies need to be added to the ebuild.
> +#
> +# For prefix installations, this function does not include the offset in
> +# the path.
>  lua_get_cmod_dir() {
>  	debug-print-function ${FUNCNAME} "${@}"
>  
> @@ -385,6 +392,9 @@ lua_get_cmod_dir() {
>  #
>  # Please note that this function requires Lua and pkg-config installed,
>  # and therefore proper build-time dependencies need be added to the ebuild.
> +#
> +# For prefix installations, this function does not include the offset in
> +# the path.
>  lua_get_include_dir() {
>  	debug-print-function ${FUNCNAME} "${@}"
>  
> @@ -412,11 +422,14 @@ lua_get_LIBS() {
>  # @USAGE: [<impl>]
>  # @DESCRIPTION:
>  # Obtain and print the name of the directory into which native-Lua
> -# modules are installed, for the given implementation. If no implementation
> +# modules are installed for the given implementation. If no implementation
>  # is provided, ${ELUA} will be used.
>  #
>  # Please note that this function requires Lua and pkg-config installed,
>  # and therefore proper build-time dependencies need be added to the ebuild.
> +#
> +# For prefix installations, this function does not include the offset in
> +# the path.
>  lua_get_lmod_dir() {
>  	debug-print-function ${FUNCNAME} "${@}"
>  

That's better, thanks. I would go a step further though and add a note
to lua_get_shared_lib() to say that this *does* include the SYSROOT and
prefix. It is slightly odd that this differs from lua_get_include_dir()
but I cannot find any examples where lua_get_shared_lib() is used in an
install phase.

Can you confirm that following this, you will go around and correct all
the ebuilds that use lua_get_include_dir() ? I count around 21 of them.
As I said, ${ESYSROOT} should be prepended when it is used in a build
phase. luaexpat is a good example of it being used in both a build and
an install phase.

Note that all of this is still slightly broken by the difference
between dev-util/pkgconfig and dev-util/pkgconf but I'll resolve that
as soon as I can. Most users, including most prefix users, won't notice.

-- 
James Le Cuirot (chewi)
Gentoo Linux Developer

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-13 22:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-11 17:01 [gentoo-dev] [PATCH] eclass/lua-utils.eclass: remove EPREFIX from exported module paths William Hubbs
2021-01-13 22:51 ` James Le Cuirot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox