]> Pileus Git - ~andy/sunrise/blob - media-gfx/ngplant/ngplant-0.9.7.ebuild
media-gfx/ngplant: Initial commit for bug 260096
[~andy/sunrise] / media-gfx / ngplant / ngplant-0.9.7.ebuild
1 # Copyright 1999-2009 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 EAPI="2"
6
7 inherit eutils multilib toolchain-funcs
8
9 DESCRIPTION="plant modeling software package"
10 HOMEPAGE="http://ngplant.sourceforge.net"
11 SRC_URI="mirror://sourceforge/${PN}/${PN}/${PV}/${P}.tar.gz"
12
13 SLOT="0"
14 KEYWORDS="~amd64 ~x86"
15 LICENSE="GPL-3 BSD"
16 IUSE="doc examples"
17
18 RDEPEND="
19         media-libs/glew
20         virtual/glut
21         x11-libs/wxGTK:2.8
22         dev-lang/lua"
23 DEPEND="${RDEPEND}
24         dev-util/scons
25         dev-util/pkgconfig
26         dev-libs/libxslt"
27
28 src_prepare() {
29         epatch "${FILESDIR}"/${PV}-gcc4.3.patch
30         rm -rf extern
31
32         sed \
33                 -e "s:CC_OPT_FLAGS=.*$:CC_OPT_FLAGS=\'${CFLAGS}\':g" \
34                 -i SConstruct \
35                 || die "failed to correct CFLAGS"
36
37         sed \
38                 -e "s:LINKFLAGS='-s':LINKFLAGS=\'${LDFLAGS}\':g" \
39                 -i ngpview/SConscript ${PN}/SConscript devtools/SConscript ngpshot/SConscript \
40                 || die "failed to correct LDFLAGS"
41 }
42
43 src_compile() {
44         scons \
45                 CC=$(tc-getCC) \
46                 CXX=$(tc-getCXX)\
47                 LINKFLAGS="${LDFLAGS}" \
48                 GLEW_INC="/usr/include/" \
49                 GLEW_LIBPATH="/usr/$(get_libdir)/" \
50                 GLEW_LIBS="GLEW GL GLU glut" \
51                 LUA_INC="/usr/include/" \
52                 LUA_LIBPATH="/usr/$(get_libdir)/" \
53                 LUA_LIBS="$(pkg-config lua --libs)" \
54                 || die
55 }
56
57 src_install() {
58         dobin ${PN}/${PN} ngpview/ngpview devtools/ngpbench ngpshot/ngpshot scripts/ngp2obj.py || die
59         dolib.a ngpcore/libngpcore.a ngput/libngput.a || die
60         insinto /usr/share/${PN}/
61         doins -r plugins shaders || die
62
63         dodoc ReleaseNotes || die
64
65         if use examples; then
66                 doins -r samples || die
67         fi
68
69         if use doc; then
70                 dohtml -r docapi || die
71         fi
72 }