summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMarek Szuba <marecki@gentoo.org>2020-10-12 14:45:33 +0200
committerMarek Szuba <marecki@gentoo.org>2020-10-15 18:27:01 +0200
commit5cb5d75ca6f0ca3365b9d2ad85f5d20f3cb2abe5 (patch)
tree90b9c8318d73b8ccd8144224bfdc58ac22ea47fe /eclass
parentmedia-libs/libsdl2: Support app-i18n/fcitx and app-i18n/ibus. (diff)
downloadgentoo-5cb5d75ca6f0ca3365b9d2ad85f5d20f3cb2abe5.tar.gz
gentoo-5cb5d75ca6f0ca3365b9d2ad85f5d20f3cb2abe5.tar.bz2
gentoo-5cb5d75ca6f0ca3365b9d2ad85f5d20f3cb2abe5.zip
lua-utils.eclass: Add lua_get_include_dir()
For build systems which must be pointed directly to the relevant files, e.g. CMake. Signed-off-by: Marek Szuba <marecki@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r--eclass/lua-utils.eclass24
1 files changed, 24 insertions, 0 deletions
diff --git a/eclass/lua-utils.eclass b/eclass/lua-utils.eclass
index 24ef67635d5..8f54e57dbd7 100644
--- a/eclass/lua-utils.eclass
+++ b/eclass/lua-utils.eclass
@@ -250,6 +250,14 @@ _lua_export() {
export LUA_CMOD_DIR=${val}
debug-print "${FUNCNAME}: LUA_CMOD_DIR = ${LUA_CMOD_DIR}"
;;
+ LUA_INCLUDE_DIR)
+ local val
+
+ val=$($(tc-getPKG_CONFIG) --variable includedir ${impl}) || die
+
+ export LUA_INCLUDE_DIR=${val}
+ debug-print "${FUNCNAME}: LUA_INCLUDE_DIR = ${LUA_INCLUDE_DIR}"
+ ;;
LUA_LIBS)
local val
@@ -335,6 +343,22 @@ lua_get_cmod_dir() {
echo "${LUA_CMOD_DIR}"
}
+# @FUNCTION: lua_get_include_dir
+# @USAGE: [<impl>]
+# @DESCRIPTION:
+# Obtain and print the name of the directory containing header files
+# of the given Lua 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.
+lua_get_include_dir() {
+ debug-print-function ${FUNCNAME} "${@}"
+
+ _lua_export "${@}" LUA_INCLUDE_DIR
+ echo "${LUA_INCLUDE_DIR}"
+}
+
# @FUNCTION: lua_get_LIBS
# @USAGE: [<impl>]
# @DESCRIPTION: