mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-15 08:56:58 +02:00
eclass/lua-single: Sync with gentoo
It's from gentoo commit 8d037b76b199e71a1d40db501e67b7aeac87fad8.
This commit is contained in:
parent
14ed8bb1c6
commit
93c16d73df
@ -1,4 +1,4 @@
|
||||
# Copyright 1999-2020 Gentoo Authors
|
||||
# Copyright 1999-2021 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
# @ECLASS: lua-single.eclass
|
||||
@ -8,7 +8,8 @@
|
||||
# @AUTHOR:
|
||||
# Marek Szuba <marecki@gentoo.org>
|
||||
# Based on python-single-r1.eclass by Michał Górny <mgorny@gentoo.org> et al.
|
||||
# @SUPPORTED_EAPIS: 7
|
||||
# @SUPPORTED_EAPIS: 7 8
|
||||
# @PROVIDES: lua-utils
|
||||
# @BLURB: An eclass for Lua packages not installed for multiple implementations.
|
||||
# @DESCRIPTION:
|
||||
# An extension of lua.eclass suite for packages which don't support being
|
||||
@ -34,9 +35,9 @@
|
||||
#
|
||||
# @EXAMPLE:
|
||||
# @CODE
|
||||
# EAPI=7
|
||||
# EAPI=8
|
||||
#
|
||||
# LUA_COMPAT=( lua5-{1..3} )
|
||||
# LUA_COMPAT=( lua5-{3..4} )
|
||||
#
|
||||
# inherit lua-single
|
||||
#
|
||||
@ -62,15 +63,10 @@
|
||||
# }
|
||||
# @CODE
|
||||
|
||||
case ${EAPI:-0} in
|
||||
0|1|2|3|4|5|6)
|
||||
die "Unsupported EAPI=${EAPI} (too old) for ${ECLASS}"
|
||||
;;
|
||||
7)
|
||||
;;
|
||||
*)
|
||||
die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
|
||||
case ${EAPI} in
|
||||
7|8)
|
||||
;;
|
||||
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
|
||||
esac
|
||||
|
||||
if [[ ! ${_LUA_SINGLE_R0} ]]; then
|
||||
@ -95,7 +91,7 @@ EXPORT_FUNCTIONS pkg_setup
|
||||
#
|
||||
# Example:
|
||||
# @CODE
|
||||
# LUA_COMPAT=( lua5-1 lua5-2 lua5-3 )
|
||||
# LUA_COMPAT=( lua5-1 lua5-3 lua5-4 )
|
||||
# @CODE
|
||||
#
|
||||
# Please note that you can also use bash brace expansion if you like:
|
||||
@ -120,7 +116,7 @@ EXPORT_FUNCTIONS pkg_setup
|
||||
#
|
||||
# Example:
|
||||
# @CODE
|
||||
# LUA_COMPAT_OVERRIDE='lua5-2' emerge -1v dev-lua/foo
|
||||
# LUA_COMPAT_OVERRIDE='luajit' emerge -1v dev-lua/foo
|
||||
# @CODE
|
||||
|
||||
# @ECLASS-VARIABLE: LUA_REQ_USE
|
||||
@ -159,7 +155,7 @@ EXPORT_FUNCTIONS pkg_setup
|
||||
# Example value:
|
||||
# @CODE
|
||||
# lua_targets_lua5-1? ( dev-lang/lua:5.1 )
|
||||
# lua_targets_lua5-2? ( dev-lang/lua:5.2 )
|
||||
# lua_targets_lua5-3? ( dev-lang/lua:5.3 )
|
||||
# @CODE
|
||||
|
||||
# @ECLASS-VARIABLE: LUA_REQUIRED_USE
|
||||
@ -178,7 +174,7 @@ EXPORT_FUNCTIONS pkg_setup
|
||||
#
|
||||
# Example value:
|
||||
# @CODE
|
||||
# || ( lua_targets_lua5-1 lua_targets_lua5-2 )
|
||||
# || ( lua_targets_lua5-1 lua_targets_lua5-3 )
|
||||
# @CODE
|
||||
|
||||
# @ECLASS-VARIABLE: LUA_SINGLE_USEDEP
|
||||
@ -215,7 +211,7 @@ EXPORT_FUNCTIONS pkg_setup
|
||||
#
|
||||
# Example value:
|
||||
# @CODE
|
||||
# lua_targets_lua5-1(-)?,lua_targets_lua5-2(-)?
|
||||
# lua_targets_lua5-1(-)?,lua_targets_lua5-3(-)?
|
||||
# @CODE
|
||||
|
||||
# @FUNCTION: _lua_single_set_globals
|
||||
@ -353,7 +349,7 @@ _lua_verify_patterns() {
|
||||
|
||||
local impl pattern
|
||||
for pattern; do
|
||||
for impl in "${_LUA_ALL_IMPLS[@]}"; do
|
||||
for impl in "${_LUA_ALL_IMPLS[@]}" "${_LUA_HISTORICAL_IMPLS[@]}"; do
|
||||
[[ ${impl} == ${pattern/./-} ]] && continue 2
|
||||
done
|
||||
|
||||
@ -381,15 +377,15 @@ _lua_verify_patterns() {
|
||||
# @CODE
|
||||
# LUA_COMPAT=( lua5-{1..3} )
|
||||
# RDEPEND="$(lua_gen_cond_dep \
|
||||
# 'dev-lua/backported_core_module[${LUA_USEDEP}]' lua5-1 lua5-2 )"
|
||||
# 'dev-lua/backported_core_module[${LUA_USEDEP}]' lua5-1 lua5-3 )"
|
||||
# @CODE
|
||||
#
|
||||
# It will cause the variable to look like:
|
||||
# @CODE
|
||||
# RDEPEND="lua_single_target_lua5-1? (
|
||||
# dev-lua/backported_core_module[lua_targets_lua5-1(-)?,...] )
|
||||
# lua_single_target_lua5-2? (
|
||||
# dev-lua/backported_core_module[lua_targets_lua5-2(-)?,...] )"
|
||||
# lua_single_target_lua5-3? (
|
||||
# dev-lua/backported_core_module[lua_targets_lua5-3(-)?,...] )"
|
||||
# @CODE
|
||||
lua_gen_cond_dep() {
|
||||
debug-print-function ${FUNCNAME} "${@}"
|
||||
@ -441,13 +437,13 @@ lua_gen_cond_dep() {
|
||||
# Example:
|
||||
# @CODE
|
||||
# LUA_COMPAT=( lua5-{1..3} )
|
||||
# RDEPEND="foo? ( $(lua_gen_impl_dep 'deprecated(+)' lua5-3 ) )"
|
||||
# RDEPEND="foo? ( $(lua_gen_impl_dep 'deprecated(+)' lua5-4 ) )"
|
||||
# @CODE
|
||||
#
|
||||
# It will cause the variable to look like:
|
||||
# @CODE
|
||||
# RDEPEND="foo? (
|
||||
# lua_single_target_lua5-3? ( dev-lang/lua:5.3[deprecated(+)] )
|
||||
# lua_single_target_lua5-4? ( dev-lang/lua:5.3[deprecated(+)] )
|
||||
# )"
|
||||
# @CODE
|
||||
lua_gen_impl_dep() {
|
||||
|
Loading…
Reference in New Issue
Block a user