dev-lua/moonscript: add from dm9p2CAq
This commit is contained in:
parent
e13825f19d
commit
1c6d89d73f
1
dev-lua/moonscript/Manifest
Normal file
1
dev-lua/moonscript/Manifest
Normal file
|
@ -0,0 +1 @@
|
|||
DIST moonscript-0.5.0.tar.gz 124093 BLAKE2B bda1e8fcd0191e8525ed6a7ecaf393712e24f8242b1dba5019b03f539d1e9acaa74faf67a1e3acddbb9b05f5cb570496d9910ff4f3a86986f2a8aa92234b41ef SHA512 f573f9a96502662987de637f7f62b935fab93aa775122c9ae20d98029394e3136e6b519908ce76e1e77c51fbcee162c3ad0aa58eeb1ee56a2b07951437987941
|
13
dev-lua/moonscript/metadata.xml
Normal file
13
dev-lua/moonscript/metadata.xml
Normal file
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
<maintainer type="person">
|
||||
<email>v@0x0c.xyz</email>
|
||||
<name>dm9pZCAq</name>
|
||||
</maintainer>
|
||||
<upstream>
|
||||
<changelog>https://github.com/leafo/moonscript/raw/master/CHANGELOG.md</changelog>
|
||||
<bugs-to>https://github.com/leafo/moonscript/issues</bugs-to>
|
||||
<remote-id type="github">leafo/moonscript</remote-id>
|
||||
</upstream>
|
||||
</pkgmetadata>
|
83
dev-lua/moonscript/moonscript-0.5.0.ebuild
Normal file
83
dev-lua/moonscript/moonscript-0.5.0.ebuild
Normal file
|
@ -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
|
||||
}
|
Loading…
Reference in a new issue