summaryrefslogtreecommitdiff
path: root/app-eselect/eselect-lua
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-09-23 10:22:15 +0100
committerV3n3RiX <venerix@redcorelinux.org>2020-09-23 10:22:15 +0100
commit8b4ace9c50842c5b83401ea7b179dcab940387e1 (patch)
tree230f3135ceaace633cf93e9838b185c4a6664c2e /app-eselect/eselect-lua
parent9ee6d97c2883d42f204a533a8bc1f4562df778fb (diff)
gentoo resync : 23.09.2020
Diffstat (limited to 'app-eselect/eselect-lua')
-rw-r--r--app-eselect/eselect-lua/Manifest5
-rw-r--r--app-eselect/eselect-lua/eselect-lua-2.ebuild (renamed from app-eselect/eselect-lua/eselect-lua-1.ebuild)21
-rw-r--r--app-eselect/eselect-lua/files/lua.eselect-2172
-rw-r--r--app-eselect/eselect-lua/metadata.xml4
4 files changed, 197 insertions, 5 deletions
diff --git a/app-eselect/eselect-lua/Manifest b/app-eselect/eselect-lua/Manifest
index f191120bcf19..667940d3f7db 100644
--- a/app-eselect/eselect-lua/Manifest
+++ b/app-eselect/eselect-lua/Manifest
@@ -1,3 +1,4 @@
AUX lua.eselect-1 3217 BLAKE2B c3f2723afd8177878443bad6fbb51d16a0b90a9f439fe0f2dd150105488db540481136e2ff5f3d2a0b71bdcc88e95f6751a63c7c0a6bea4c32445f8871aa4163 SHA512 653aa84caf8a3706206099de78d8e1b2bbd41cda40dd7dac2b022c85a1988d864a80f490389db3fc2450555d301f965189df132a964a4425ee2bab6c2b7be220
-EBUILD eselect-lua-1.ebuild 605 BLAKE2B 25d04cde1981dfd1d7779c3aef7667bab3b36aad6241748352ba46556461e20810067756dc55a6b2d131fba43c70021c2919762dabec6c9dc9508c190a49d5b6 SHA512 8ca272a71ccce716bcd11b77f759efa1f2edcf1be72bcec31fe72be9c0140f9cd827e60c45e1299338d38595be9a558643998f7e2d69ec0453e5f36d4f32f305
-MISC metadata.xml 248 BLAKE2B 5d9c3678c604aac0f24c5d5015e28f02b9ce83bb6a179755a44adeb3d69e4dd50be4acc30a6317649f5be23bcf13ac210bbe4712aa403e9c4cf2de351b39c941 SHA512 dc5b06a888be6367909895d5891a08189f4657bcee602e5ff0021be2ad3677e58ec7387ff244625be66a142138666e7eac790d2a7b1e298f0ad644725b5e57e0
+AUX lua.eselect-2 4192 BLAKE2B 90c8241a3dcc822466aa9a95420143bcdcd5a9aed3d8688958cc2bd30005f298399f8d34834ffb7a727a1186acfd9e98b765cc5a949ef81e39ca96e83c028afa SHA512 fa7dfa52542d9410dcc5f60bc4ef63db7b8396c7ba6115f2d83951a171d996aea3c13530ac2d7ef5025b5047aacb2e4936527377aec0d53229f46d518bd79845
+EBUILD eselect-lua-2.ebuild 791 BLAKE2B 029dd825b07c7a8406658dd34dd1e5699624900a35683befe97e045cd3c492bc9acbeee0c7d1a963742a4284da4e5f231ab27952ab9e971fe0822f9d8fad1d16 SHA512 bc52a5adf91a1029fea819be865040f5f6d77d88d4e22e9f6af1780966b1bb1f07e4d7bf19a83c87abdb5df2560d9a6ea3e9cd2a29eed96976317cdd7536236c
+MISC metadata.xml 361 BLAKE2B d4e3b671abc0924f33030927fed5591df325b49a42711b7d5d9c4c9052433903414434402c12dbebf907f8197fb0f82bf9d44202599e255ccbc01b6e3d78bbed SHA512 425998f090c34d79e2190c0aa0ad81601a9e2fca458f7e9fe0fd4b09f2abb10c7eb4a02307d97e28d5b3aee3098eda57715d0e0cdbe254ba9f2768def2e74654
diff --git a/app-eselect/eselect-lua/eselect-lua-1.ebuild b/app-eselect/eselect-lua/eselect-lua-2.ebuild
index 321aa9120693..82abd3207ea4 100644
--- a/app-eselect/eselect-lua/eselect-lua-1.ebuild
+++ b/app-eselect/eselect-lua/eselect-lua-2.ebuild
@@ -1,7 +1,7 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=5
+EAPI=7
DESCRIPTION="Lua eselect module"
HOMEPAGE="https://wiki.gentoo.org/wiki/No_homepage"
@@ -11,9 +11,24 @@ SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
IUSE=""
-DEPEND=">=app-admin/eselect-1.2.4"
+DEPEND="
+ !dev-lang/lua:0
+ >=app-admin/eselect-1.2.4
+"
RDEPEND="${DEPEND}"
-
+PDEPEND="
+ || (
+ dev-lang/lua:5.1
+ dev-lang/lua:5.2
+ dev-lang/lua:5.3
+ (
+ dev-lang/luajit:2
+ app-eselect/eselect-luajit
+ )
+ )
+"
+# dev-lang/lua:5.4
+# TODO: ^
S="${WORKDIR}"
src_install() {
diff --git a/app-eselect/eselect-lua/files/lua.eselect-2 b/app-eselect/eselect-lua/files/lua.eselect-2
new file mode 100644
index 000000000000..02a942788b9d
--- /dev/null
+++ b/app-eselect/eselect-lua/files/lua.eselect-2
@@ -0,0 +1,172 @@
+# -*-eselect-*- vim: ft=eselect
+# Copyright 2014-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+inherit config multilib
+
+DESCRIPTION="Manage lua symlinks"
+MAINTAINER="mva@gentoo.org"
+
+HEADER_FILES="lauxlib.h luaconf.h lua.h lua.hpp lualib.h"
+
+remove_symlinks() {
+ rm -f "${EROOT}"/usr/bin/{lua,luac} &>/dev/null
+ for dir in $(get_libdirs) ; do
+ rm -f "${EROOT}"${dir}/liblua.so &>/dev/null && \
+ rm -f "${EROOT}"${dir}/pkgconfig/lua.pc &>/dev/null
+ done
+ for f in $HEADER_FILES ; do
+ rm -f "${EROOT}"/usr/include/${f}
+ done
+ rm -f "${EROOT}"/usr/share/man/man1/{lua,luac}.1{,.gz,.bz2,.lzma} &>/dev/null
+}
+
+_dup() {
+ dirname ${1}/.
+}
+
+set_symlinks() {
+ local ver=$1
+ ln -s lua${ver} $(_dup "${EROOT}"/usr/bin/lua)
+ ln -s luac${ver} $(_dup "${EROOT}"/usr/bin/luac)
+ for dir in $(get_libdirs) ; do
+ if has 'jit*' ${ver}; then
+ type -p lua${ver} &>/dev/null || die -q "It's something wrong with your lua${ver} installation: it's binary leads to broken symlink"
+ local abi=$(lua${ver} -e 'print(_VERSION:match("%d.%d"))')
+ local libname=libluajit-${abi}.so.${ver##jit-}
+ test -f "${EROOT}/${dir}/${libname}" || die -q "Can't find libluajit for lua${ver} (lua abi: ${abi})"
+ ln -s ${libname} $(_dup "${EROOT}/${dir}"/liblua.so)
+ else
+ ln -s liblua${ver}.so $(_dup "${EROOT}/${dir}"/liblua.so)
+ fi
+ ln -s lua${ver}.pc $(_dup "${EROOT}/${dir}"/pkgconfig/lua.pc)
+ done
+ for manpage in "${EROOT}"/usr/share/man/man1/lua*${ver}.1* ; do
+ test -f ${manpage} &&
+ ln -s $(basename "${manpage}") $(_dup "${manpage//${ver}}")
+ done
+ for header in $HEADER_FILES ; do
+ local hdr;
+ if has 'jit*' ${ver}; then
+ type -p lua${ver} &>/dev/null || die -q "lua${ver} binary is missing (or leads to broken symlink)"
+ local jit_v=$(lua${ver} -e 'print(jit.version:match("%d.%d"))')
+ hdr=luajit-${jit_v}/${header};
+ else
+ hdr=lua${ver}/${header};
+ fi
+ test -f "${EROOT}/usr/include/${hdr}" || die -q "Missing header: ${header}"
+ ln -s "${hdr}" $(_dup "${EROOT}"/usr/include/${header})
+ done
+}
+
+get_libdirs() {
+ local dir libdirs
+ for dir in $(list_libdirs); do
+ [[ -L ${EROOT}/usr/${dir} ]] && continue
+ ls "${EROOT}"/usr/${dir}/liblua*.* > /dev/null 2>&1 || continue
+
+ libdirs+=' '/usr/${dir}
+ done
+ echo ${libdirs:-/usr/lib}
+}
+
+find_targets() {
+ local dirs
+ local prefix="${EROOT}/usr/bin/lua"
+ for f in ${prefix}{5,jit-2}.* ; do
+ [[ -f "${f}" ]] && dirs="${dirs} ${f##$prefix}"
+ done
+ echo $dirs
+}
+
+resolv_target() {
+ local targets=( $(find_targets) )
+ if is_number $1; then
+ [[ $1 -le ${#targets[@]} && $1 -gt 0 ]] && echo "${targets[ $(( $1 - 1 )) ]}"
+ elif has $1 ${targets[@]}; then
+ echo $1
+ fi
+}
+
+get_active_version() {
+ readlink -e "${EROOT}"/usr/bin/lua | sed -ne "s:.*/usr/bin/lua\([\w.-]*\):\1:p"
+}
+
+## Actual actions
+
+## set action
+
+describe_set() {
+ echo "Sets the current version of lua"
+}
+
+describe_set_parameters() {
+ echo '<target>'
+}
+
+describe_set_options() {
+ echo 'target: Target name or number (from "list" action)'
+}
+
+
+do_set() {
+ local target=$(resolv_target $1)
+ if [[ -z "${target}" ]]; then
+ die -q "You need to specify a version"
+ fi
+ remove_symlinks
+ set_symlinks $target
+}
+
+## List action
+
+describe_list() {
+ echo 'Lists available lua versions'
+}
+
+do_list() {
+ local targets
+ local a
+ targets=( $(find_targets) )
+ a=$(get_active_version)
+ for (( i = 0; i < ${#targets[@]}; i++ )) ; do
+ [[ $a == ${targets[i]} ]] && targets[i]=$(highlight_marker "${targets[i]}")
+ done
+ write_numbered_list -m '(none found)' "${targets[@]}"
+}
+
+## Show action
+
+describe_show() {
+ echo 'Show the active lua version'
+}
+
+do_show() {
+ get_active_version
+}
+
+## update action
+
+describe_update() {
+ echo 'Automatically update the lua version'
+}
+
+describe_update_options() {
+ echo 'ifunset : Do not override existing implementation'
+}
+
+do_update() {
+ [[ -n ${1} && ! ( ${1} == ifunset || ${1} == '--if-unset' ) ]] && \
+ die -q 'Usage error'
+
+ [[ ( ${1} == ifunset || ${1} == '--if-unset' ) && -n $(get_active_version) ]] && \
+ return
+
+ remove_symlinks
+
+ local targets=( $(find_targets) )
+ if [[ -n ${#targets[@]} ]] ; then
+ local target=${targets[${#targets[@]} - 1]}
+ set_symlinks $target || echo 'Nothing to update'
+ fi
+}
diff --git a/app-eselect/eselect-lua/metadata.xml b/app-eselect/eselect-lua/metadata.xml
index c36c37139fad..c4df8c7ed369 100644
--- a/app-eselect/eselect-lua/metadata.xml
+++ b/app-eselect/eselect-lua/metadata.xml
@@ -2,6 +2,10 @@
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
+ <email>mva@gentoo.org</email>
+ <name>Vadim Misbakh-Soloviov</name>
+ </maintainer>
+ <maintainer type="person">
<email>williamh@gentoo.org</email>
<name>William Hubbs</name>
</maintainer>