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