Gentoo Archives: gentoo-dev

From: David Seifert <soap@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [PATCH 3/3] lua-utils.eclass: Add lua_get_static_lib()
Date: Mon, 12 Oct 2020 15:40:12
Message-Id: b2a7d17f84eb40695f290ea507962f42057781b6.camel@gentoo.org
In Reply to: [gentoo-dev] [PATCH 3/3] lua-utils.eclass: Add lua_get_static_lib() by Marek Szuba
1 On Mon, 2020-10-12 at 16:05 +0200, Marek Szuba wrote:
2 > For build systems which must be pointed directly to the relevant
3 > files,
4 > e.g. CMake.
5 >
6 > Signed-off-by: Marek Szuba <marecki@g.o>
7 > ---
8 > eclass/lua-utils.eclass | 24 ++++++++++++++++++++++++
9 > 1 file changed, 24 insertions(+)
10 >
11 > diff --git a/eclass/lua-utils.eclass b/eclass/lua-utils.eclass
12 > index 100be14cb08..922f72b80d6 100644
13 > --- a/eclass/lua-utils.eclass
14 > +++ b/eclass/lua-utils.eclass
15 > @@ -329,6 +329,11 @@ _lua_export() {
16 > export LUA_SHARED_LIB="${val}".so
17 > debug-print "${FUNCNAME}:
18 > LUA_SHARED_LIB = ${LUA_SHARED_LIB}"
19 > ;;
20 > + LUA_STATIC_LIB)
21 > + local val=$(_lua_get_library_file
22 > ${impl})
23 > + export LUA_STATIC_LIB="${val}".a
24 > + debug-print "${FUNCNAME}:
25 > LUA_STATIC_LIB = ${LUA_STATIC_LIB}"
26 > + ;;
27 > LUA_VERSION)
28 > local val
29 >
30 > @@ -443,6 +448,25 @@ lua_get_shared_lib() {
31 > echo "${LUA_SHARED_LIB}"
32 > }
33 >
34 > +# @FUNCTION: lua_get_static_lib
35 > +# @USAGE: [<impl>]
36 > +# @DESCRIPTION:
37 > +# Obtain and print the expected name, with path, of the main static
38 > library
39 > +# of the given Lua implementation. If no implementation is provided,
40 > +# ${ELUA} will be used.
41 > +#
42 > +# Note that it is up to the ebuild maintainer to ensure Lua actually
43 > +# provides a static library.
44 > +#
45 > +# Please note that this function requires Lua and pkg-config
46 > installed,
47 > +# and therefore proper build-time dependencies need be added to the
48 > ebuild.
49 > +lua_get_static_lib() {
50 > + debug-print-function ${FUNCNAME} "${@}"
51 > +
52 > + _lua_export "${@}" LUA_STATIC_LIB
53 > + echo "${LUA_STATIC_LIB}"
54 > +}
55 > +
56 > # @FUNCTION: lua_get_version
57 > # @USAGE: [<impl>]
58 > # @DESCRIPTION:
59
60 When is passing static libs ever useful for Lua?

Replies