Gentoo Archives: gentoo-dev

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

Replies