From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 3CEF0138359 for ; Mon, 12 Oct 2020 15:40:12 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7F61AE08C8; Mon, 12 Oct 2020 15:40:09 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 42FA8E08BB for ; Mon, 12 Oct 2020 15:40:09 +0000 (UTC) Message-ID: Subject: Re: [gentoo-dev] [PATCH 3/3] lua-utils.eclass: Add lua_get_static_lib() From: David Seifert To: gentoo-dev@lists.gentoo.org Date: Mon, 12 Oct 2020 17:39:56 +0200 In-Reply-To: <20201012140534.113655-4-marecki@gentoo.org> References: <20201012140534.113655-1-marecki@gentoo.org> <20201012140534.113655-4-marecki@gentoo.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Archives-Salt: 8ad3dc4b-2d91-4594-bea2-7d469f53658c X-Archives-Hash: 8633e92ff800823d138f5e8a7dd78bf2 On Mon, 2020-10-12 at 16:05 +0200, Marek Szuba wrote: > For build systems which must be pointed directly to the relevant > files, > e.g. CMake. > > Signed-off-by: Marek Szuba > --- > eclass/lua-utils.eclass | 24 ++++++++++++++++++++++++ > 1 file changed, 24 insertions(+) > > diff --git a/eclass/lua-utils.eclass b/eclass/lua-utils.eclass > index 100be14cb08..922f72b80d6 100644 > --- a/eclass/lua-utils.eclass > +++ b/eclass/lua-utils.eclass > @@ -329,6 +329,11 @@ _lua_export() { > export LUA_SHARED_LIB="${val}".so > debug-print "${FUNCNAME}: > LUA_SHARED_LIB = ${LUA_SHARED_LIB}" > ;; > + LUA_STATIC_LIB) > + local val=$(_lua_get_library_file > ${impl}) > + export LUA_STATIC_LIB="${val}".a > + debug-print "${FUNCNAME}: > LUA_STATIC_LIB = ${LUA_STATIC_LIB}" > + ;; > LUA_VERSION) > local val > > @@ -443,6 +448,25 @@ lua_get_shared_lib() { > echo "${LUA_SHARED_LIB}" > } > > +# @FUNCTION: lua_get_static_lib > +# @USAGE: [] > +# @DESCRIPTION: > +# Obtain and print the expected name, with path, of the main static > library > +# of the given Lua implementation. If no implementation is provided, > +# ${ELUA} will be used. > +# > +# Note that it is up to the ebuild maintainer to ensure Lua actually > +# provides a static library. > +# > +# Please note that this function requires Lua and pkg-config > installed, > +# and therefore proper build-time dependencies need be added to the > ebuild. > +lua_get_static_lib() { > + debug-print-function ${FUNCNAME} "${@}" > + > + _lua_export "${@}" LUA_STATIC_LIB > + echo "${LUA_STATIC_LIB}" > +} > + > # @FUNCTION: lua_get_version > # @USAGE: [] > # @DESCRIPTION: When is passing static libs ever useful for Lua?