# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit games eutils flag-o-matic multilib DESCRIPTION="Vavoom is a source port based on sources of Doom, Heretic, Hexen and a little bit from Quake." HOMEPAGE="http://www.vavoom-engine.com/" SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2" LICENSE="GPL-2" SLOT="0" KEYWORDS="~x86 ~amd64" IUSE="sdl opengl openal external-glbsp vorbis mad mikmod flac dedicated" DEPEND="media-libs/libpng sys-libs/zlib media-sound/timidity++ sdl? ( media-libs/libsdl media-libs/sdl-mixer ) amd64? ( sdl? ( app-emulation/emul-linux-x86-sdl ) ) opengl? ( virtual/opengl ) openal? ( media-libs/openal ) vorbis? ( media-libs/libvorbis ) mad? ( media-libs/libmad ) mikmod? ( media-libs/libmikmod ) flac? ( media-libs/flac ) external-glbsp? ( games-util/glbsp )" pkg_setup() { if use amd64 ; then if ! has_m32 ; then eerror "Your compiler seems to be unable to compile 32bit code." eerror "Make sure you compile gcc with:" echo eerror " USE=multilib FEATURES=-sandbox" die "Cannot produce 32bit code" fi if has_multilib_profile ; then export ABI=x86 else append-flags -m32 append-ldflags -m32 fi fi games_pkg_setup } dir="${GAMES_DATADIR}/${PN}" src_unpack() { unpack ${A} || die "unpack failed" cd "${S}" epatch "${FILESDIR}/vavoom-glvis-linux.diff" } src_compile() { egamesconf \ $(use_with sdl) \ $(use_with opengl) \ $(use_with openal) \ $(use_with external-glbsp) \ $(use_with vorbis) \ $(use_with mad libmad) \ $(use_with mikmod) \ $(use_with flac) || die "configure failed" emake -j1 || die "emake failed" if use dedicated ; then emake sv || die "emake sv failed" fi } src_install() { exeinto "${dir}" doexe Vavoom || die "doexe failed" games_make_wrapper vavoom ./Vavoom "${dir}" "${dir}" if use dedicated ; then exeinto "${dir}" doexe VavoomSV || die "doexe failed" games_make_wrapper vavoomsv ./VavoomSV "${dir}" "${dir}" fi insinto "${GAMES_DATADIR}/${PN}/basev" doins basev/games.txt || die "doins failed" insinto "${GAMES_DATADIR}/${PN}/basev/common" doins basev/common/default.cfg || die "doins failed" doins basev/common/startup.vs || die "doins failed" doins basev/common/wad0.wad || die "doins failed" insinto "${GAMES_DATADIR}/${PN}/basev/doom" doins basev/doom/wad0.wad || die "doins failed" insinto "${GAMES_DATADIR}/${PN}/basev/doom1" doins basev/doom1/base.txt || die "doins failed" doins basev/doom1/wad0.wad || die "doins failed" insinto "${GAMES_DATADIR}/${PN}/basev/doom2" doins basev/doom2/base.txt || die "doins failed" doins basev/doom2/wad0.wad || die "doins failed" insinto "${GAMES_DATADIR}/${PN}/basev/heretic" doins basev/heretic/wad0.wad || die "doins failed" insinto "${GAMES_DATADIR}/${PN}/basev/hexen" doins basev/hexen/wad0.wad || die "doins failed" insinto "${GAMES_DATADIR}/${PN}/basev/plutonia" doins basev/plutonia/base.txt || die "doins failed" doins basev/plutonia/wad0.wad || die "doins failed" insinto "${GAMES_DATADIR}/${PN}/basev/strife" doins basev/strife/wad0.wad || die "doins failed" insinto "${GAMES_DATADIR}/${PN}/basev/tnt" doins basev/tnt/base.txt || die "doins failed" doins basev/tnt/wad0.wad || die "doins failed" dodoc docs/*.txt prepgamesdirs } pkg_postinst() { games_pkg_postinst einfo "Copy WAD files in ${GAMES_DATADIR}/${PN} with correct permissions:" einfo "Example: (run as root) chmod 640 doom.wad && chgrp games doom.wad" einfo einfo "Example command line:" einfo " vavoom -doom -opengl -window" einfo einfo "See documentation for further details" }