summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--eclass/lua-utils.eclass21
-rw-r--r--profiles/desc/lua_single_target.desc1
-rw-r--r--profiles/desc/lua_targets.desc1
3 files changed, 19 insertions, 4 deletions
diff --git a/eclass/lua-utils.eclass b/eclass/lua-utils.eclass
index 490d19a00198..24ef67635d55 100644
--- a/eclass/lua-utils.eclass
+++ b/eclass/lua-utils.eclass
@@ -14,8 +14,6 @@
# A utility eclass providing functions to query Lua implementations,
# install Lua modules and scripts.
#
-# Please note that for the time being this eclass does NOT support luajit.
-#
# This eclass neither sets any metadata variables nor exports any phase
# functions. It can be inherited safely.
@@ -39,6 +37,7 @@ inherit toolchain-funcs
# @DESCRIPTION:
# All supported Lua implementations, most preferred last
_LUA_ALL_IMPLS=(
+ luajit
lua5-1
lua5-2
lua5-3
@@ -141,9 +140,16 @@ _lua_wrapper_setup() {
local ELUA LUA
_lua_export "${impl}" ELUA LUA
- # Lua interpreter and compiler
+ # Lua interpreter
ln -s "${EPREFIX}"/usr/bin/${ELUA} "${workdir}"/bin/lua || die
- ln -s "${EPREFIX}"/usr/bin/${ELUA/a/ac} "${workdir}"/bin/luac || die
+
+ # Lua compiler, or a stub for it in case of luajit
+ if [[ ${ELUA} == luajit ]]; then
+ # Just in case
+ ln -s "${EPREFIX}"/bin/true "${workdir}"/bin/luac || die
+ else
+ ln -s "${EPREFIX}"/usr/bin/${ELUA/a/ac} "${workdir}"/bin/luac || die
+ fi
# pkg-config
ln -s "${EPREFIX}"/usr/$(get_libdir)/pkgconfig/${ELUA}.pc \
@@ -201,6 +207,10 @@ _lua_export() {
local impl var
case "${1}" in
+ luajit)
+ impl=${1}
+ shift
+ ;;
lua*)
impl=${1/-/.}
shift
@@ -259,6 +269,9 @@ _lua_export() {
LUA_PKG_DEP)
local d
case ${impl} in
+ luajit)
+ LUA_PKG_DEP="dev-lang/luajit:="
+ ;;
lua*)
LUA_PKG_DEP="dev-lang/lua:${impl#lua}"
;;
diff --git a/profiles/desc/lua_single_target.desc b/profiles/desc/lua_single_target.desc
index 1bee02b69783..c3d422e434d7 100644
--- a/profiles/desc/lua_single_target.desc
+++ b/profiles/desc/lua_single_target.desc
@@ -7,3 +7,4 @@ lua5-1 - Build for Lua 5.1 only
lua5-2 - Build for Lua 5.2 only
lua5-3 - Build for Lua 5.3 only
lua5-4 - Build for Lua 5.4 only
+luajit - Build for LuaJIT only
diff --git a/profiles/desc/lua_targets.desc b/profiles/desc/lua_targets.desc
index 2575de0bcfd8..75b9e0f86af2 100644
--- a/profiles/desc/lua_targets.desc
+++ b/profiles/desc/lua_targets.desc
@@ -7,3 +7,4 @@ lua5-1 - Build with Lua 5.1
lua5-2 - Build with Lua 5.2
lua5-3 - Build with Lua 5.3
lua5-4 - Build with Lua 5.4
+luajit - Build with LuaJIT