# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils python games MY_P="${PN}-${PV:0:4}-${PV:4:2}-${PV:6}" DESCRIPTION="A driving simulation made with drift racing in mind" HOMEPAGE="http://vdrift.net/" SRC_URI="mirror://sourceforge/${PN}/${MY_P}-src.tar.bz2 mirror://sourceforge/${PN}/${MY_P}-data-full.tar.bz2" LICENSE="GPL-2" SLOT="0" KEYWORDS="~x86" IUSE="debug nls" RDEPEND="media-libs/openal media-libs/freealut media-libs/libsdl media-libs/sdl-image media-libs/sdl-net" DEPEND="${RDEPEND} dev-util/scons" S=${WORKDIR}/${MY_P}-src pkg_setup() { if ! built_with_use -a media-libs/libsdl X opengl; then eerror "You built libsdl with wrong USE flags." eerror "Make sure you rebuild it like this:" eerror "USE='X opengl'" die "your libsdl sucks" fi } src_unpack() { unpack ${MY_P}-src.tar.bz2 cd ${S} unpack ${MY_P}-data-full.tar.bz2 # We need our CXXFLAGS sed -ri \ -e "/env.Append\(CCFLAGS/s:-O2:${CXXFLAGS// /\' ,\'}:" \ SConstruct \ || die "sed SConstruct failed" } src_compile() { local myconf use debug || myconf="release=1" use nls && myconf="${myconf} NLS=1" scons ${MAKEOPTS/j/j } \ ${myconf} \ prefix='' \ localedir=/usr/share/locale \ datadir=${GAMES_DATADIR}/vdrift \ use_binreloc=0 \ || die "scons failed" } src_install() { dogamesbin build/${PN} || die "dogamesbin failed" dodoc docs/* insinto "${GAMES_DATADIR}"/${PN} doins -r data/* || die "doins failed" newicon data/textures/small/icons/vdrift-64x64.png ${PN}.png make_desktop_entry ${PN} "VDrift" prepgamesdirs }