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

EAPI="2"

MY_PN=Box2D

inherit eutils

IUSE=""

DESCRIPTION="Box2D is an open source physics engine written primarily for games."
HOMEPAGE="http://www.box2d.org"
SRC_URI="mirror://sourceforge/${PN}/${MY_PN}_v${PV}.zip"

LICENSE="ZLIB"
SLOT="0"
KEYWORDS="~x86"
IUSE=""

RDEPEND="media-libs/freeglut
	app-arch/unzip"
DEPEND="${RDEPEND}"

S="${WORKDIR}"/${MY_PN}_v${PV}/${MY_PN}/Source

src_prepare(){
	epatch "${FILESDIR}"/${P}-gcc4.patch
	sed -i -e "s:../Source/::g" -i ../Include/Box2D.h || die sed failed
}

src_compile() {
	emake || die
}

src_install() {
	dodoc ../Readme.txt

	dolib.a Gen/float/lib${PN}.a

	insinto /usr/include/${MY_PN}/
	doins ../Include/${MY_PN}.h
	insinto /usr/include/${MY_PN}/Collision/
	doins Collision/*.h
	insinto /usr/include/${MY_PN}/Collision/Shapes/
	doins Collision/Shapes/*.h
	insinto /usr/include/${MY_PN}/Common/
	doins Common/*.h
	insinto /usr/include/${MY_PN}/Dynamics/
	doins Dynamics/*.h
	insinto /usr/include/${MY_PN}/Dynamics/Contacts/
	doins Dynamics/Contacts/*.h
	insinto /usr/include/${MY_PN}/Dynamics/Joints/
	doins Dynamics/Joints/*.h
}