Gentoo Archives: gentoo-dev

From: James Le Cuirot <chewi@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [PATCH] eclass/lua-utils.eclass: remove EPREFIX from exported module paths
Date: Wed, 13 Jan 2021 22:51:40
Message-Id: 20210113225119.420da02c@symphony.aura-online.co.uk
In Reply to: [gentoo-dev] [PATCH] eclass/lua-utils.eclass: remove EPREFIX from exported module paths by William Hubbs
1 On Mon, 11 Jan 2021 11:01:33 -0600
2 William Hubbs <williamh@g.o> wrote:
3
4 > Bug: https://bugs.gentoo.org/762769
5 > Signed-off-by: William Hubbs <williamh@g.o>
6 > ---
7 > eclass/lua-utils.eclass | 23 ++++++++++++++++++-----
8 > 1 file changed, 18 insertions(+), 5 deletions(-)
9 >
10 > diff --git a/eclass/lua-utils.eclass b/eclass/lua-utils.eclass
11 > index 100be14cb08..9fe4d22e93f 100644
12 > --- a/eclass/lua-utils.eclass
13 > +++ b/eclass/lua-utils.eclass
14 > @@ -212,8 +212,9 @@ _lua_get_library_file() {
15 > die "Invalid implementation: ${impl}"
16 > ;;
17 > esac
18 > - libdir=$($(tc-getPKG_CONFIG) --variable libdir ${impl}) || die
19 >
20 > + libdir=$($(tc-getPKG_CONFIG) --variable libdir ${impl}) || die
21 > +
22 > debug-print "${FUNCNAME}: libdir = ${libdir}, libname = ${libname}"
23 > echo "${libdir}/${libname}"
24 > }
25 > @@ -274,6 +275,7 @@ _lua_export() {
26 > local val
27 >
28 > val=$($(tc-getPKG_CONFIG) --variable INSTALL_CMOD ${impl}) || die
29 > + val="${val#${ESYSROOT#${SYSROOT}}}"
30 >
31 > export LUA_CMOD_DIR=${val}
32 > debug-print "${FUNCNAME}: LUA_CMOD_DIR = ${LUA_CMOD_DIR}"
33 > @@ -282,6 +284,7 @@ _lua_export() {
34 > local val
35 >
36 > val=$($(tc-getPKG_CONFIG) --variable includedir ${impl}) || die
37 > + val="${val#${ESYSROOT#${SYSROOT}}}"
38 >
39 > export LUA_INCLUDE_DIR=${val}
40 > debug-print "${FUNCNAME}: LUA_INCLUDE_DIR = ${LUA_INCLUDE_DIR}"
41 > @@ -298,6 +301,7 @@ _lua_export() {
42 > local val
43 >
44 > val=$($(tc-getPKG_CONFIG) --variable INSTALL_LMOD ${impl}) || die
45 > + val="${val#${ESYSROOT#${SYSROOT}}}"
46 >
47 > export LUA_LMOD_DIR=${val}
48 > debug-print "${FUNCNAME}: LUA_LMOD_DIR = ${LUA_LMOD_DIR}"
49 > @@ -364,11 +368,14 @@ lua_get_CFLAGS() {
50 > # @USAGE: [<impl>]
51 > # @DESCRIPTION:
52 > # Obtain and print the name of the directory into which compiled Lua
53 > -# modules are installed, for the given implementation. If no implementation
54 > +# modules are installed for the given implementation. If no implementation
55 > # is provided, ${ELUA} will be used.
56 > #
57 > -# Please note that this function requires Lua and pkg-config installed,
58 > -# and therefore proper build-time dependencies need be added to the ebuild.
59 > +# Please note that this function requires Lua and pkg-config to be installed,
60 > +# and therefore proper build-time dependencies need to be added to the ebuild.
61 > +#
62 > +# For prefix installations, this function does not include the offset in
63 > +# the path.
64 > lua_get_cmod_dir() {
65 > debug-print-function ${FUNCNAME} "${@}"
66 >
67 > @@ -385,6 +392,9 @@ lua_get_cmod_dir() {
68 > #
69 > # Please note that this function requires Lua and pkg-config installed,
70 > # and therefore proper build-time dependencies need be added to the ebuild.
71 > +#
72 > +# For prefix installations, this function does not include the offset in
73 > +# the path.
74 > lua_get_include_dir() {
75 > debug-print-function ${FUNCNAME} "${@}"
76 >
77 > @@ -412,11 +422,14 @@ lua_get_LIBS() {
78 > # @USAGE: [<impl>]
79 > # @DESCRIPTION:
80 > # Obtain and print the name of the directory into which native-Lua
81 > -# modules are installed, for the given implementation. If no implementation
82 > +# modules are installed for the given implementation. If no implementation
83 > # is provided, ${ELUA} will be used.
84 > #
85 > # Please note that this function requires Lua and pkg-config installed,
86 > # and therefore proper build-time dependencies need be added to the ebuild.
87 > +#
88 > +# For prefix installations, this function does not include the offset in
89 > +# the path.
90 > lua_get_lmod_dir() {
91 > debug-print-function ${FUNCNAME} "${@}"
92 >
93
94 That's better, thanks. I would go a step further though and add a note
95 to lua_get_shared_lib() to say that this *does* include the SYSROOT and
96 prefix. It is slightly odd that this differs from lua_get_include_dir()
97 but I cannot find any examples where lua_get_shared_lib() is used in an
98 install phase.
99
100 Can you confirm that following this, you will go around and correct all
101 the ebuilds that use lua_get_include_dir() ? I count around 21 of them.
102 As I said, ${ESYSROOT} should be prepended when it is used in a build
103 phase. luaexpat is a good example of it being used in both a build and
104 an install phase.
105
106 Note that all of this is still slightly broken by the difference
107 between dev-util/pkgconfig and dev-util/pkgconf but I'll resolve that
108 as soon as I can. Most users, including most prefix users, won't notice.
109
110 --
111 James Le Cuirot (chewi)
112 Gentoo Linux Developer