summaryrefslogtreecommitdiff
blob: 3418fe1ceb418e91046cd4faebc2fe4d0723187c (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
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-lang/tolua/tolua-5.0-r1.ebuild,v 1.2 2006/10/19 09:55:33 exg Exp $

inherit toolchain-funcs portability

DESCRIPTION="A tool that simplifies the integration of C/C++ code with Lua"
HOMEPAGE="http://www.tecgraf.puc-rio.br/~celes/tolua/"
SRC_URI="ftp://ftp.tecgraf.puc-rio.br/pub/users/celes/tolua/${P}.tar.gz"

LICENSE="as-is"
SLOT="0"
KEYWORDS="~x86 ~sparc"
IUSE=""

DEPEND=">=dev-lang/lua-5.0"

src_unpack() {
	unpack ${A}
	cd ${S}

	sed -i \
		-e "/^CC=/ s/=.*/=$(tc-getCC)/" \
		-e "/^LUA=/ s:=.*:=/usr:" \
		-e "s/^\(LIB=.*\)/\1 $(dlopen_lib)/" \
		-e "s:-O2:${CFLAGS}:" config || \
			die "sed config failed"
	sed -i \
		-e 's:make:$(MAKE):' Makefile || \
			die "sed Makefile failed"
}

src_compile() {
	emake || die "emake failed"
}

src_install() {
	dobin bin/tolua || die
	dolib.a lib/libtolua.a
	insinto /usr/include
	doins include/tolua.h
	dodoc INSTALL README
	dohtml doc/*
}