summaryrefslogtreecommitdiff
blob: bf427f112b9c86f66c2ccd1c20c60314df380f42 (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
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=4

inherit eutils toolchain-funcs versionator

MY_P=${PN}-$(replace_version_separator 3 'r' )

DESCRIPTION="Lua bindings to Thomas Boutell's gd library"
HOMEPAGE="http://lua-gd.luaforge.net/"
SRC_URI="http://luaforge.net/frs/download.php/1592/${MY_P}.tar.gz
	mirror://sourceforge/${PN}/${PN}/${MY_P}%20%28for%20Lua%205.1%29/${MY_P}.tar.gz"

LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="doc examples"

RDEPEND="dev-lang/lua
	media-libs/gd[png]"
DEPEND="${RDEPEND}
	dev-util/pkgconfig"

S=${WORKDIR}/${MY_P}

src_prepare() {
	epatch "${FILESDIR}/${P}-makefile.patch"
}

src_compile() {
	emake LUAPKG=lua CC="$(tc-getCC)"
}

src_install() {
	emake install LUAPKG=lua DESTDIR="${D}"
	dodoc README

	if use doc; then
		dohtml doc/*
	fi

	if use examples; then
		insinto /usr/share/doc/${PF}
		doins -r demos
	fi
}