# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit games eutils flag-o-matic DESCRIPTION="Advanced source port for Doom/Heretic/Hexen/Strife" HOMEPAGE="http://www.vavoom-engine.com" SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2" LICENSE="GPL-2" SLOT="0" KEYWORDS="~x86 ~amd64" IUSE="debug dedicated external-glbsp flac mad mikmod models music openal \ opengl tools vorbis" MY_BIN=${PN}.`uname -m` QA_EXECSTACK="${GAMES_BINDIR:1}/${MY_BIN}" DEPEND="media-libs/libpng sys-libs/zlib media-sound/timidity++ media-libs/libsdl media-libs/sdl-mixer openal? ( media-libs/openal ) external-glbsp? ( games-util/glbsp ) vorbis? ( media-libs/libvorbis ) mad? ( media-libs/libmad ) mikmod? ( media-libs/libmikmod ) flac? ( media-libs/flac )" PDEPEND="${DEPEND} models? ( games-fps/vavoom-models ) music? ( games-fps/vavoom-music )" pkg_setup() { if use opengl ; then if ! built_with_use media-libs/libsdl opengl ; then eerror "'opengl' USE flag enabled, but libsdl without opengl detected" eerror "Recompile media-libs/libsdl with opengl USE flag enabled" die "libsdl without opengl detected" fi fi games_pkg_setup } src_unpack() { unpack ${A} || die "unpack failed" } src_compile() { if use debug ; then append-flags -g2 fi egamesconf \ --with-sdl \ --with-iwaddir=${GAMES_DATADIR}/${PN} \ $(use_with opengl) \ $(use_with openal) \ $(use_with external-glbsp) \ $(use_with vorbis) \ $(use_with mad libmad) \ $(use_with mikmod) \ $(use_with flac) \ $(use_enable debug) \ $(use_enable debug zone-debug) \ $(use_enable dedicated server) || die "configure failed" # Parallel compiling seems to be broken emake -j1 || die "emake failed" } src_install() { make DESTDIR=${D} install || die "make install failed" # I don't need PNG icon rm ${D}/${GAMES_DATADIR}/${PN}/${PN}.png #doicon source/${PN}.png || die "doicon failed" #make_desktop_entry ${PN} "Vavoom Engine" dodoc docs/${PN}.txt || die "dodoc failed" if use tools; then dobin utils/bin/{acc,fixmd2,vcc,vlumpy} || die "dobin failed" dodoc utils/vcc/vcc.txt || die "dodoc failed" fi prepgamesdirs } pkg_postinst() { games_pkg_postinst elog "Copy WAD files in ${GAMES_DATADIR}/${PN} with correct permissions" elog "(the files must be readable by 'games' group)" elog elog "Example command line:" elog " vavoom -doom -opengl -window" elog elog "See documentation for further details" if use tools; then echo elog "You have also installed some Vavoom-related utilities" elog "(useful for mod developing :) )" elog elog " - acc (ACS Script Compiler)" elog " - fixmd2 (MD2 models utility)" elog " - vcc (Vavoom C Compiler)" elog " - vlumpy (Vavoom Lump utility)" elog elog "See the Vavoom Wiki at http://vavoom-engine.com/wiki/ or" elog "Vavoom Forum at http://www.vavoom-engine.com/forums/" elog "for further help" fi }