# Template file for 'lua54-fluent'
pkgname=lua54-fluent
version=0.2.0
revision=1
hostmakedepends="lua51 lua52 lua53 lua54 luarocks-lua54"
depends="lua54 lua54-cldr lua54-luaepnf lua54-penlight"
short_desc="Lua implementation of Project Fluent"
maintainer="Luciogi <githubvoidlinux.supremacy429@passinbox.com>"
license="MIT"
homepage="https://github.com/alerque/fluent-lua"
distfiles="https://github.com/alerque/fluent-lua/archive/refs/tags/v${version}.tar.gz"
checksum=2458b80c8dad59c86de459bb7b4deef285d196b54ab449e73a8b8814f9822633

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

do_install() {
	_pkg 5.4
	vlicense LICENSE
}

lua53-fluent_package() {
	metapackage=yes
	depends="lua53 lua53-cldr lua53-luaepnf lua53-penlight"
	pkg_install() {
		_pkg 5.3
		vlicense LICENSE
	}
}

lua52-fluent_package() {
	metapackage=yes
	depends="lua52 lua52-cldr lua52-luaepnf lua52-penlight"
	pkg_install() {
		_pkg 5.2
		vlicense LICENSE
	}
}

lua51-fluent_package() {
	metapackage=yes
	depends="lua51 lua51-cldr lua51-luaepnf lua51-penlight"
	pkg_install() {
		_pkg 5.1
		vlicense LICENSE
	}
}
