luarocks: specify package alternatives
Subpackages for lua51 and lua52 provide wrapper scripts around `luarocks` and `luarocks-admin` to call with the correct lua version. This extends them to fully support XBPS' package alternatives mechanism. Closes: #10986 [via git-merge-pr]
This commit is contained in:
parent
b03bc27db5
commit
dbe1a7c93c
1 changed files with 16 additions and 4 deletions
|
@ -18,6 +18,9 @@ license="MIT"
|
|||
homepage="https://luarocks.org/"
|
||||
distfiles="https://luarocks.org/releases/luarocks-${version}.tar.gz"
|
||||
checksum=1236a307ca5c556c4fed9fdbd35a7e0e80ccf063024becc8c3bf212f37ff0edf
|
||||
alternatives="
|
||||
luarocks:luarocks:/usr/bin/luarocks-5.3
|
||||
luarocks:luarocks-admin:/usr/bin/luarocks-admin-5.3"
|
||||
|
||||
conf_files="/etc/luarocks/config-5.3.lua"
|
||||
|
||||
|
@ -45,20 +48,26 @@ post_install() {
|
|||
make DESTDIR="${DESTDIR}" LUA_VERSION=$lv install-config
|
||||
|
||||
echo "#!/bin/sh" > ${DESTDIR}/usr/bin/luarocks-$lv
|
||||
echo "exec luarocks --lua-version $lv \"\$@\"" >> ${DESTDIR}/usr/bin/luarocks-$lv
|
||||
echo "exec luarocks-5.3 --lua-version $lv \"\$@\"" >> ${DESTDIR}/usr/bin/luarocks-$lv
|
||||
chmod +x ${DESTDIR}/usr/bin/luarocks-$lv
|
||||
|
||||
echo "#!/bin/sh" > ${DESTDIR}/usr/bin/luarocks-admin-$lv
|
||||
echo "exec luarocks-admin --lua-version $lv \"\$@\"" >> ${DESTDIR}/usr/bin/luarocks-admin-$lv
|
||||
echo "exec luarocks-admin-5.3 --lua-version $lv \"\$@\"" >> ${DESTDIR}/usr/bin/luarocks-admin-$lv
|
||||
chmod +x ${DESTDIR}/usr/bin/luarocks-admin-$lv
|
||||
done
|
||||
|
||||
mv ${DESTDIR}/usr/bin/luarocks{,-5.3}
|
||||
mv ${DESTDIR}/usr/bin/luarocks-admin{,-5.3}
|
||||
}
|
||||
|
||||
luarocks-lua52_package() {
|
||||
archs=noarch
|
||||
short_desc+=" - Lua52"
|
||||
depends="luarocks>=${version}_${revision} lua52"
|
||||
depends="${sourcepkg}>=${version}_${revision} lua52"
|
||||
conf_files="/etc/luarocks/config-5.2.lua"
|
||||
alternatives="
|
||||
luarocks:luarocks:/usr/bin/luarocks-5.2
|
||||
luarocks:luarocks-admin:/usr/bin/luarocks-admin-5.2"
|
||||
pkg_install() {
|
||||
vmove usr/bin/luarocks-5.2
|
||||
vmove usr/bin/luarocks-admin-5.2
|
||||
|
@ -69,8 +78,11 @@ luarocks-lua52_package() {
|
|||
luarocks-lua51_package() {
|
||||
archs=noarch
|
||||
short_desc+=" - Lua51"
|
||||
depends="luarocks>=${version}_${revision} lua51"
|
||||
depends="${sourcepkg}>=${version}_${revision} lua51"
|
||||
conf_files="/etc/luarocks/config-5.1.lua"
|
||||
alternatives="
|
||||
luarocks:luarocks:/usr/bin/luarocks-5.1
|
||||
luarocks:luarocks-admin:/usr/bin/luarocks-admin-5.1"
|
||||
pkg_install() {
|
||||
vmove usr/bin/luarocks-5.1
|
||||
vmove usr/bin/luarocks-admin-5.1
|
||||
|
|
Loading…
Reference in a new issue