# Template file for 'lua54-penlight'
pkgname=lua54-penlight
version=1.14.0
revision=1
hostmakedepends="lua54 lua53 lua52 lua51 zip luarocks-lua54"
makedepends="lua54-devel lua53-devel lua52-devel lua51-devel lua54-luafilesystem"
depends="lua54 lua54-luafilesystem"
short_desc="Lua libraries focusing on input data handling"
maintainer="Luciogi <githubvoidlinux.supremacy429@passinbox.com>"
license="MIT"
homepage="https://github.com/lunarmodules/Penlight"
distfiles="https://github.com/lunarmodules/Penlight/archive/refs/tags/${version}.tar.gz"
checksum=2387431c0e83c4189cccb35b989141a3280d735cb5d42bacf3451af9869bebf7

_rockname=${pkgname#lua54-}
_rocksrel=1
_package() {
	luarocks --lua-version="$1" --tree="${PKGDESTDIR}/usr" \
		make  --deps-mode=none --no-manifest "rockspecs/${_rockname}-${version}-${_rocksrel}.rockspec"
}

do_install() {
	_package 5.4
	vlicense LICENSE.md
}

lua51-penlight_package() {
	build_style=meta
	depends="lua51 lua51-luafilesystem"
	pkg_install() {
		_package 5.1
		vlicense LICENSE.md
	}
}

lua52-penlight_package() {
	build_style=meta
	depends="lua52 lua52-luafilesystem"
	pkg_install() {
		_package 5.2
		vlicense LICENSE.md
	}
}

lua53-penlight_package() {
	build_style=meta
	depends="lua53 lua53-luafilesystem"
	pkg_install() {
		_package 5.3
		vlicense LICENSE.md
	}
}
