summaryrefslogtreecommitdiff
blob: c863bdfbb2cafc4d48def9ada95cc818e8f9d584 (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
63
64
65
66
67
68
69
70
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=5
inherit eutils scons-utils games

MY_P=${PN}-${PV:0:4}-${PV:4:2}-${PV:6:2}
DESCRIPTION="A driving simulation made with drift racing in mind"
HOMEPAGE="http://vdrift.net/"
SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.bz2
	mirror://sourceforge/${PN}/${MY_P}c_patch.diff"

LICENSE="GPL-3 ZLIB LGPL-2.1+"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""

RDEPEND="app-arch/libarchive
	media-libs/glew
	media-libs/libsdl[opengl,video]
	media-libs/sdl-gfx
	media-libs/sdl-image[png]
	media-libs/libvorbis
	net-misc/curl
	sci-physics/bullet[-double-precision]
	virtual/opengl
	virtual/glu"
DEPEND="${RDEPEND}
	dev-cpp/asio
	dev-libs/boost
	virtual/pkgconfig"

S=${WORKDIR}/VDrift

src_unpack() {
	unpack ${MY_P}.tar.bz2
}

src_prepare() {
	epatch \
		"${DISTDIR}"/${MY_P}c_patch.diff \
		"${FILESDIR}"/${P}-build.patch \
		"${FILESDIR}"/${P}-bullet.patch
}

src_compile() {
	escons \
		force_feedback=1 \
		destdir="${D}" \
		bindir="${GAMES_BINDIR}" \
		datadir="${GAMES_DATADIR}"/${PN} \
		prefix= \
		use_binreloc=0 \
		release=1 \
		os_cc=1 \
		os_cxx=1 \
		os_cxxflags=1 \
		|| die
}

src_install() {
	dogamesbin build/vdrift
	insinto "${GAMES_DATADIR}/${PN}"
	doins -r data/*
	newicon data/textures/icons/vdrift-64x64.png ${PN}.png
	make_desktop_entry ${PN} VDrift
	find "${D}" -name "SCon*" -exec rm \{\} +
	keepdir "${GAMES_DATADIR}"/${PN}/{music,settings/replays,settings/screenshots}
	prepgamesdirs
}