summaryrefslogtreecommitdiff
blob: baca13f38003892235042689faa86deb107c1cbe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: This ebuild is from Lua overlay; Bumped by mva; $

EAPI="5"

VCS="git-r3"
inherit lua

DESCRIPTION="A programmer friendly language that compiles into Lua."
HOMEPAGE="https://github.com/leafo/moonscript"
SRC_URI=""

EGIT_REPO_URI="https://github.com/leafo/moonscript"

LICENSE="MIT"
SLOT="0"
KEYWORDS=""
IUSE="+doc +inotify"

RDEPEND="
	|| (
		dev-lua/lpeg
		dev-lua/lulpeg[lpeg-compat]
	)
	dev-lua/luafilesystem
	dev-lua/alt-getopt
	inotify? ( dev-lua/linotify )
"
DEPEND="${RDEPEND}"

DOCS=( docs/ README.md )

each_lua_compile() {
	local lua="$(lua_get_implementation)"
	${lua} bin/moonc moon/ moonscript/
}

all_lua_compile() {
	local lua="$(lua_get_implementation)"

	echo "#!/usr/bin/env lua" > bin/moon
	${lua} bin/moonc -p bin/moon.moon >> bin/moon
	echo "-- vim: set filetype=lua:" >> bin/moon

	${lua} bin/moonc -p bin/splat.moon >> bin/splat
}

each_lua_install() {
	dolua moon{,script}{,.lua}
}

all_lua_install() {
	dobin bin/{moon,moonc,splat}
}