Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 534150
Collapse All | Expand All

(-)gentoo/dev-lua/luafilesystem/luafilesystem-1.6.2.ebuild (-7 / +52 lines)
Lines 1-9 Link Here
1
# Copyright 1999-2014 Gentoo Foundation
1
# Copyright 1999-2015 Gentoo Foundation
2
# Distributed under the terms of the GNU General Public License v2
2
# Distributed under the terms of the GNU General Public License v2
3
# $Header: /var/cvsroot/gentoo-x86/dev-lua/luafilesystem/luafilesystem-1.6.2.ebuild,v 1.1 2014/12/24 10:41:04 mrueg Exp $
3
# $Header: $
4
4
5
EAPI=5
5
EAPI=5
6
inherit multilib toolchain-funcs
6
inherit toolchain-funcs
7
7
8
DESCRIPTION="File System Library for the Lua Programming Language"
8
DESCRIPTION="File System Library for the Lua Programming Language"
9
HOMEPAGE="http://keplerproject.github.com/luafilesystem/"
9
HOMEPAGE="http://keplerproject.github.com/luafilesystem/"
Lines 12-34 Link Here
12
LICENSE="MIT"
12
LICENSE="MIT"
13
SLOT="0"
13
SLOT="0"
14
KEYWORDS="~amd64 ~arm ~hppa ~mips ~ppc ~ppc64 ~x86 ~x86-fbsd"
14
KEYWORDS="~amd64 ~arm ~hppa ~mips ~ppc ~ppc64 ~x86 ~x86-fbsd"
15
IUSE=""
15
IUSE_LUA_TARGET="lua_target_lua5-1 lua_target_lua5-2"
16
IUSE="${IUSE_LUA_TARGET}"
16
17
17
DEPEND=">=dev-lang/lua-5.1"
18
REQUIRED_USE="|| ( ${IUSE_LUA_TARGET} )"
19
20
DEPEND="lua_target_lua5-1? ( dev-lang/lua:5.1 )
21
	lua_target_lua5-2? ( dev-lang/lua:5.2 )"
18
RDEPEND="${DEPEND}"
22
RDEPEND="${DEPEND}"
19
23
24
get_lua_variant() {
25
	local lua_target="$1" lua_variant
26
	lua_variant="${lua_target##lua_target_}"
27
	lua_variant="${lua_variant/-/.}"
28
	echo "${lua_variant}"
29
}
30
20
src_prepare() {
31
src_prepare() {
32
	local lua_target lua_variant S_variant
33
	local pkg_config="$(tc-getPKG_CONFIG)" lua_inc lua_cmod
21
	sed -i \
34
	sed -i \
22
		-e "s|/usr/local|/usr|" \
35
		-e "s|/usr/local|/usr|" \
23
		-e "s|/lib|/$(get_libdir)|" \
24
		-e "s|-O2|${CFLAGS}|" \
36
		-e "s|-O2|${CFLAGS}|" \
25
		-e "/^LIB_OPTION/s|= |= ${LDFLAGS} |" \
37
		-e "/^LIB_OPTION/s|= |= ${LDFLAGS} |" \
26
		-e "s|gcc|$(tc-getCC)|" \
38
		-e "s|gcc|$(tc-getCC)|" \
27
		config || die
39
		config || die
40
	for lua_target in ${IUSE_LUA_TARGET} ; do
41
		use "${lua_target}" || continue
42
		lua_variant="$(get_lua_variant ${lua_target})"
43
		S_variant="${S}-${lua_variant}"
44
		einfo "Preparing for ${lua_variant}"
45
		cp -ar "${S}" "${S_variant}" || die
46
		cd "${S_variant}" || die
47
		lua_inc="$(${pkg_config} --variable INSTALL_INC ${lua_variant})" lua_cmod="$(${pkg_config} --variable INSTALL_CMOD ${lua_variant})"
48
		sed -i \
49
			-e "/^LUA_INC/s|=.*|= ${lua_inc}|" \
50
			-e "/^LUA_LIBDIR/s|=.*|= \${DESTDIR}${lua_cmod}|" \
51
			config || die
52
	done
53
}
54
55
src_compile() {
56
	local lua_target lua_variant S_variant
57
	for lua_target in ${IUSE_LUA_TARGET} ; do
58
		use "${lua_target}" || continue
59
		lua_variant="$(get_lua_variant ${lua_target})"
60
		S_variant="${S}-${lua_variant}"
61
		cd "${S_variant}" || die
62
		einfo "Compiling for ${lua_variant}"
63
		default
64
	done
28
}
65
}
29
66
30
src_install() {
67
src_install() {
31
	emake PREFIX="${ED}usr" install
68
	local lua_target lua_variant S_variant
69
	for lua_target in ${IUSE_LUA_TARGET} ; do
70
		use "${lua_target}" || continue
71
		lua_variant="$(get_lua_variant ${lua_target})"
72
		S_variant="${S}-${lua_variant}"
73
		cd "${S_variant}" || die
74
		einfo "Installing for ${lua_variant}"
75
		emake DESTDIR="${D}" install
76
	done
32
	dodoc README
77
	dodoc README
33
	dohtml doc/us/*
78
	dohtml doc/us/*
34
}
79
}

Return to bug 534150