summaryrefslogtreecommitdiff
blob: 77590d3c3ffc729156d644da5478b0831eed972f (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
71
72
73
74
75
76
77
78
79
80
81
82
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/games-sports/speed-dreams/speed-dreams-1.4.0.ebuild,v 1.6 2012/03/12 13:02:05 tupone Exp $

EAPI=2
inherit autotools eutils versionator games

DESCRIPTION="A fork of the famous open racing car simulator TORCS"
HOMEPAGE="http://speed-dreams.sourceforge.net/"
SRC_URI="mirror://sourceforge/speed-dreams/${P}-r2307-src.tar.bz2"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 x86"
IUSE=""

RDEPEND="virtual/opengl
	virtual/glu
	media-libs/freeglut
	>=media-libs/plib-1.8.3
	media-libs/openal
	media-libs/freealut
	x11-libs/libX11
	x11-libs/libXext
	x11-libs/libICE
	x11-libs/libSM
	x11-libs/libXt
	x11-libs/libXi
	x11-libs/libXmu
	x11-libs/libXxf86vm
	x11-libs/libXrender
	x11-libs/libXrandr
	sys-libs/zlib
	>=media-libs/libpng-1.2.40"
DEPEND="${RDEPEND}
	x11-proto/xproto
	x11-proto/randrproto"

S=${WORKDIR}/${PN}-$(get_version_component_range 1-3)-src

src_prepare() {
	# http://sourceforge.net/apps/trac/speed-dreams/ticket/111
	MAKEOPTS="${MAKEOPTS} -j1"

	epatch \
			"${FILESDIR}"/${P}-asneeded.patch \
			"${FILESDIR}"/${P}-libpng15.patch

	sed -i \
		-e '/ADDCFLAGS/s: -O2::' \
		configure.in || die
	sed -i \
		-e '/COPYING/s:=.*:= \\:' \
		Makefile || die
	sed -i \
		-e "/^datadir/s:=.*:= ${GAMES_DATADIR}/${PN}:" \
		Make-config.in || die

	AT_NOEAUTOMAKE=yes eautoreconf
}

src_configure() {
	addpredict $(echo /dev/snd/controlC? | sed 's/ /:/g')
	[[ -e /dev/dsp ]] && addpredict /dev/dsp
	egamesconf \
		--prefix=/usr \
		--bindir="${GAMES_BINDIR}" \
		--disable-dependency-tracking
}

src_install() {
	emake DESTDIR="${D}" install datainstall || die

	find "${D}" -name Makefile -exec rm -f {} +

	dodoc CHANGES README TODO

	newicon icon.svg ${PN}.svg
	make_desktop_entry ${PN} "Speed Dreams"

	prepgamesdirs
}