summaryrefslogtreecommitdiff
blob: 5cc85c95f40946757dbc2894d57b1456042e2fe9 (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
56
57
58
59
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=6

VCS="git"
GITHUB_A="gvvaughan"

inherit lua

DESCRIPTION="LibYAML binding for Lua."
HOMEPAGE="https://github.com/gvvaughan/lyaml"

LICENSE="GPL"
SLOT="0"
KEYWORDS=""
IUSE="doc"

RDEPEND="
	dev-libs/libyaml
"
DEPEND="
	${RDEPEND}
	dev-lua/lua-stdlib
	dev-lua/ldoc
"

DOCS=(README.md NEWS.md)
HTML_DOCS=(html/.)

all_lua_prepare() {
	sed -r \
		-e "s/@package@/${PN}/" \
		-e "s/@version@/${PV}/" \
		-e '/^dir/s@../doc@../html@' \
		-i build-aux/config.ld.in

	cp "${FILESDIR}"/Makefile "${S}"

	lua_default
}

each_lua_configure() {
	local ver="${PV}";
	if [[ "${PV}" == "9999" ]]; then
		ver="git:$(git rev-parse --short @)"
	fi
	local myeconfargs=(
		package="${PN}"
		version="${ver}"
		LUA_INCDIR="$(lua_get_incdir)"
	)
	lua_default
}

each_lua_install() {
	dolua lib/"${PN}"
	dolua "${PN:1}".so
}