diff --git a/dev-lua/moonscript/Manifest b/dev-lua/moonscript/Manifest new file mode 100644 index 0000000..80dec0e --- /dev/null +++ b/dev-lua/moonscript/Manifest @@ -0,0 +1 @@ +DIST moonscript-0.5.0.tar.gz 124093 BLAKE2B bda1e8fcd0191e8525ed6a7ecaf393712e24f8242b1dba5019b03f539d1e9acaa74faf67a1e3acddbb9b05f5cb570496d9910ff4f3a86986f2a8aa92234b41ef SHA512 f573f9a96502662987de637f7f62b935fab93aa775122c9ae20d98029394e3136e6b519908ce76e1e77c51fbcee162c3ad0aa58eeb1ee56a2b07951437987941 diff --git a/dev-lua/moonscript/metadata.xml b/dev-lua/moonscript/metadata.xml new file mode 100644 index 0000000..36d0b47 --- /dev/null +++ b/dev-lua/moonscript/metadata.xml @@ -0,0 +1,13 @@ + + + + + v@0x0c.xyz + dm9pZCAq + + + https://github.com/leafo/moonscript/raw/master/CHANGELOG.md + https://github.com/leafo/moonscript/issues + leafo/moonscript + + diff --git a/dev-lua/moonscript/moonscript-0.5.0.ebuild b/dev-lua/moonscript/moonscript-0.5.0.ebuild new file mode 100644 index 0000000..186000c --- /dev/null +++ b/dev-lua/moonscript/moonscript-0.5.0.ebuild @@ -0,0 +1,83 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +LUA_COMPAT=( lua5-{1..4} luajit ) + +inherit lua + +DESCRIPTION="A programmer friendly language that compiles into Lua" +HOMEPAGE="https://github.com/leafo/moonscript" +SRC_URI="https://github.com/leafo/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="amd64 arm ppc x86 ~amd64-linux ~x86-linux" +IUSE="+doc" +REQUIRED_USE="${LUA_REQUIRED_USE}" + +RDEPEND=" + ${LUA_DEPS} + dev-lua/lpeg[${LUA_USEDEP}] + >=dev-lua/alt-getopt-0.7[${LUA_USEDEP}] + >=dev-lua/luafilesystem-1.5[${LUA_USEDEP}] +" +DEPEND="${RDEPEND}" + +DOCS=( docs/. README.md ) + +src_prepare() { + default + + lua_copy_sources +} + +moon_tool_compile() { + local in="${1:?}" + local out="${2:?}" + { + printf '%s\n\n' '#!/usr/bin/env lua' + "${LUA}" bin/moonc -p "${in}" + printf '\n%s\n' '-- vim: set filetype=lua:' + + printf 'Built %s\n' "${in}" 1>&2 + } > "${out}" +} + +lua_src_compile() ( + set -e + + cd "${BUILD_DIR}" + + "${LUA}" bin/moonc moon/ moonscript/ + + moon_tool_compile bin/moon{.moon,} + moon_tool_compile bin/{splat.moon,moon-splat} + + find . -type f -name '*.moon' -delete +) + +src_compile() { + lua_foreach_impl lua_src_compile +} + +lua_src_install() ( + cd "${BUILD_DIR}" || die + insinto "$(lua_get_lmod_dir)" + doins -r moon{,script}{,.lua} +) + +src_install() { + einstalldocs + + lua_foreach_impl lua_src_install + + ( + set -e + + for dir in "${WORKDIR}/${P}"-*; do :; done + cd "${dir}" + dobin bin/moon{,c,-splat} + ) || die +}