void-packages/srcpkgs/lua54-luarepl/template
Luca Matei Pintilie c7cffa4240 lua54-luarepl: fix cross compiled binary
When cross compiling the path in /usr/bin/repl.lua contains the target
arch in the destdir path, which must be replaced differently than the
others.

Aside from that, added lua version to the package and sub packages
descriptions, as well as switched to vsed to catch this next time. And
move vlicense in _package.

Co-Authored-By: Đoàn Trần Công Danh <sgn.danh@gmail.com>
2025-01-05 22:44:57 +07:00

53 lines
1.3 KiB
Bash

# Template file for 'lua54-luarepl'
pkgname=lua54-luarepl
version=0.10
revision=2
build_style=meta
hostmakedepends="lua51 lua52 lua53 lua54 luarocks-lua54"
depends="lua54"
_desc="Reusable REPL component for Lua, written in Lua"
short_desc="${_desc} (5.4.x)"
maintainer="Luciogi <githubvoidlinux.supremacy429@passinbox.com>"
license="MIT"
homepage="https://github.com/hoelzro/lua-repl"
distfiles="https://github.com/hoelzro/lua-repl/archive/refs/tags/${version}.tar.gz"
checksum=55ba9f032bb4eb0e2e93dc66a368549bcf1a915bdd9f9a467eb778c3133c6373
_rockname=${pkgname#lua54-}
_rocksrel=1
_package() {
luarocks --lua-version="$1" --tree="${PKGDESTDIR}/usr/" \
make --deps-mode=none --no-manifest "${_rockname}-${version}-${_rocksrel}.rockspec"
vsed -i "${PKGDESTDIR}/usr/bin/rep.lua" -e "s|$(realpath "${PKGDESTDIR}")||g"
mv "${PKGDESTDIR}/usr/bin/rep.lua" "${PKGDESTDIR}/usr/bin/rep.lua${1/./}"
vlicense COPYING
}
do_install() {
_package 5.4
vsed -i "${PKGDESTDIR}/usr/bin/rep.lua54" -e "s|lua5\.3|lua5\.4|"
}
lua53-luarepl_package() {
depends="lua53"
short_desc="${_desc} (5.3.x)"
pkg_install() {
_package 5.3
}
}
lua52-luarepl_package() {
depends="lua52"
short_desc="${_desc} (5.2.x)"
pkg_install() {
_package 5.2
}
}
lua51-luarepl_package() {
depends="lua51"
short_desc="${_desc} (5.1.x)"
pkg_install() {
_package 5.1
}
}