summaryrefslogtreecommitdiff
blob: 51d1946c15dd4f826d428cf250e5bcbe79f097f7 (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
60
61
62
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

inherit multilib

DESCRIPTION="high-level interface for low-level physics engines"
HOMEPAGE="http://opal.sourceforge.net/"
SRC_URI="mirror://sourceforge/${PN}/${P}-src.zip"

LICENSE="|| ( BSD LGPL-2.1 )"
SLOT="0"
KEYWORDS="~x86"
IUSE="debug double-precision examples"

RDEPEND="dev-games/ode"
DEPEND="${RDEPEND}
	app-arch/unzip
	dev-util/scons"

S="${WORKDIR}/${P}-src"

src_compile() {
	local myconf
	if use double-precision; then
		myconf="double=true"
	fi
	if use debug ; then
		myconf="${myconf} debug=true"
	fi

	# the install flag just triggers moving around some files
	scons ODE ${myconf} install

	if use examples; then
		# fix examples
		sed -i \
			-e "s:ogre\/:OGRE\/:g" \
			samples/src/ExampleApplication.h \
			samples/src/ExampleFrameListener.h \
		|| die "sed samples failed"
		#clean up some directories
		rm -r samples/playpen/{vc71,vc8}
		rm -r samples/simple/{vc71,vc8}
	fi
}

src_install() {
	dolib build/posix/release/libopal-ode.so
	insinto /usr/include/opal
	doins build/posix/release/include/opal/*

	insinto /usr/$(get_libdir)/pkgconfig/
	doins /usr/opal.pc

	dodoc readme.txt

	if use examples ; then
		insinto /usr/share/doc/${PF}/samples
		doins -r samples/* || die "copying examples failed"
	fi
}