mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-28 17:11:34 +02:00
eclass/lua-utils: Sync with Gentoo
It's from Gentoo commit 2cba2db27919bc449ed2a7bf7ed3259c6b96e65f.
This commit is contained in:
parent
0a9c0b0daf
commit
b2132686b0
@ -1,4 +1,4 @@
|
||||
# Copyright 1999-2021 Gentoo Authors
|
||||
# Copyright 1999-2023 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
# @ECLASS: lua-utils.eclass
|
||||
@ -18,16 +18,16 @@
|
||||
# functions. It can be inherited safely.
|
||||
|
||||
case ${EAPI} in
|
||||
7|8)
|
||||
;;
|
||||
7|8) ;;
|
||||
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
|
||||
esac
|
||||
|
||||
if [[ ! ${_LUA_UTILS_R0} ]]; then
|
||||
if [[ -z ${_LUA_UTILS_ECLASS} ]]; then
|
||||
_LUA_UTILS_ECLASS=1
|
||||
|
||||
inherit toolchain-funcs
|
||||
|
||||
# @ECLASS-VARIABLE: _LUA_ALL_IMPLS
|
||||
# @ECLASS_VARIABLE: _LUA_ALL_IMPLS
|
||||
# @INTERNAL
|
||||
# @DESCRIPTION:
|
||||
# All supported Lua implementations, most preferred last
|
||||
@ -39,7 +39,7 @@ _LUA_ALL_IMPLS=(
|
||||
)
|
||||
readonly _LUA_ALL_IMPLS
|
||||
|
||||
# @ECLASS-VARIABLE: _LUA_HISTORICAL_IMPLS
|
||||
# @ECLASS_VARIABLE: _LUA_HISTORICAL_IMPLS
|
||||
# @INTERNAL
|
||||
# @DESCRIPTION:
|
||||
# All historical Lua implementations that are no longer supported.
|
||||
@ -171,7 +171,7 @@ _lua_wrapper_setup() {
|
||||
export PATH PKG_CONFIG_PATH
|
||||
}
|
||||
|
||||
# @ECLASS-VARIABLE: ELUA
|
||||
# @ECLASS_VARIABLE: ELUA
|
||||
# @DEFAULT_UNSET
|
||||
# @DESCRIPTION:
|
||||
# The executable name of the current Lua interpreter. This variable is set
|
||||
@ -182,7 +182,7 @@ _lua_wrapper_setup() {
|
||||
# lua5.1
|
||||
# @CODE
|
||||
|
||||
# @ECLASS-VARIABLE: LUA
|
||||
# @ECLASS_VARIABLE: LUA
|
||||
# @DEFAULT_UNSET
|
||||
# @DESCRIPTION:
|
||||
# The absolute path to the current Lua interpreter. This variable is set
|
||||
@ -384,7 +384,7 @@ lua_enable_tests() {
|
||||
busted)
|
||||
test_directory="${2:-spec}"
|
||||
test_pkg="dev-lua/busted"
|
||||
if [[ ! ${_LUA_SINGLE_R0} ]]; then
|
||||
if [[ ! ${_LUA_SINGLE_ECLASS} ]]; then
|
||||
eval "lua_src_test() {
|
||||
busted --lua=\"\${ELUA}\" --output=\"plainTerminal\" \"${test_directory}\" || die \"Tests fail with \${ELUA}\"
|
||||
}"
|
||||
@ -403,7 +403,7 @@ lua_enable_tests() {
|
||||
|
||||
local test_deps=${RDEPEND}
|
||||
if [[ -n ${test_pkg} ]]; then
|
||||
if [[ ! ${_LUA_SINGLE_R0} ]]; then
|
||||
if [[ ! ${_LUA_SINGLE_ECLASS} ]]; then
|
||||
test_deps+=" ${test_pkg}[${LUA_USEDEP}]"
|
||||
else
|
||||
test_deps+=" $(lua_gen_cond_dep "
|
||||
@ -536,5 +536,4 @@ lua_get_version() {
|
||||
echo "${LUA_VERSION}"
|
||||
}
|
||||
|
||||
_LUA_UTILS_R0=1
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user