# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils games MY_P="${PN}-${PV:0:4}-${PV:4:2}-${PV:6}" DESCRIPTION="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="~amd64 ~x86" IUSE="debug nls" # fmod is not an option - ignore the README RDEPEND="media-libs/freealut media-libs/openal 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 unpack ${MY_P}-data-full.tar.bz2 cd "${S}" # We need our CXXFLAGS sed -ri \ -e "/env.Append\(CCFLAGS/s:-O2:${CXXFLAGS// /\' ,\'}:" \ SConstruct || die "sed SConstruct failed" # Prevent sandbox violation from /usr/bin/vdrift symlink sed -i \ -e "s:os.system:#os.system:g" \ src/SConscript || die "sed SConscript failed" } src_compile() { local myconf use debug || myconf="release=1" use nls && myconf="${myconf} NLS=1" # Using os_cxxflags=1 from: # http://aur.archlinux.org/packages/vdrift/vdrift/PKGBUILD scons \ ${MAKEOPTS/j/j } \ ${myconf} \ prefix='' \ destdir="${D}" \ bindir="${GAMES_BINDIR}" \ localedir=/usr/share/locale \ datadir="${GAMES_DATADIR}/${PN}" \ use_binreloc=0 \ os_cxxflags=1 \ || die "scons failed" } src_install() { scons install || die "scons install failed" dogamesbin build/${PN} || die "dogamesbin failed" newicon data/textures/small/icons/${PN}-64x64.png ${PN}.png || die make_desktop_entry ${PN} "VDrift" dodoc docs/* prepgamesdirs }