# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils toolchain-funcs games DESCRIPTION="Enhanced port of the official DOOM source code,that also support Heretic,Hexen and Strife" HOMEPAGE="http://www.zdoom.org" SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2" # It's not yet clear against which licenses ZDoom source code is released :( LICENSE="|| ( doomsource buildlic ravenlic zdoom )" SLOT="0" KEYWORDS="~x86" IUSE="debug timidity" DEPEND=">=media-libs/libsdl-1.2.8-r1 >=dev-lang/nasm-0.98.39-r3 >=media-libs/fmod-3.74 >=media-libs/flac-1.1.2-r3 media-libs/jpeg" RDEPEND="${DEPEND} timidity? ( media-sound/timidity++ )" pkg_setup() { games_pkg_setup } src_unpack() { unpack ${A} || die "unpack failed" cd ${S} # Use default game data path sed -i \ -e "s:/usr/local/share/:/usr/share/games/doom-data/:" \ src/sdl/i_system.h \ || die "sed i_system.h failed" local sdlcflags sdlldflags sdlcflags=`sdl-config --cflags` sdlldflags=`sdl-config --libs` # Various fixes to Makefile.linux: # - build more verbose kicking off ccdv # - set proper CFLAGS/LDFLAGS # - get ridding of annoying updaterevision tool sed -i Makefile.linux \ -e 's:LDFLAGS += -s -Wl,-Map=$(ZDOOM).map:LDFLAGS += -Wl,-Map=$(ZDOOM).map:' \ -e "/^CCDV/d" \ -e 's/^CXXFLAGS += $(CFLAGS)/CXXFLAGS = $(CFLAGS)/' \ -e "s:\`sdl-config --cflags\`:${sdlcflags}:" \ -e "s:\`sdl-config --libs\`:${sdlldflags}:" \ -e 's/^$(ZDOOMBIN): ccdv updaterev $(OBJDIR) $(OBJS)/$(ZDOOMBIN): $(OBJDIR) $(OBJS)/' \ || die "sed Makefile failed" # Remove the SVN revision version sed -i src/version.h \ -e '/#include "svnrevision.h"/d' \ -e 's:" (r" SVN_REVISION_STRING ")"::' \ || die "sed version.h failed" # Fixes to tools Makefiles (build more verbose, get ridding of ccdv) sed -i tools/{dehsupp,lemon,makewad,re2c,updaterevision,xlatcc}/Makefile \ -e "/^CCDV/d" \ || die "sed tools Makefiles failed" } src_compile() { local opts use debug && opts="DEBUG=1" make clean || die "make clean failed" CC="$(tc-getCC)" \ CXX="$(tc-getCXX)" \ CFLAGS="${CFLAGS}" \ CXXFLAGS="${CXXFLAGS}" \ LDFLAGS="${LDFLAGS}" \ emake ${opts} -f Makefile.linux \ || die "make failed" } src_install() { local myexe if use debug; then myexe="${PN}d" newgamesbin ${myexe} ${PN} || die "newgamesbin failed" else dogamesbin ${PN} || die "dogamesbin failed" fi insinto "${GAMES_DATADIR}/doom-data" doins wadsrc/${PN}.pk3 || die "doins failed" dodoc docs/{commands,history,rh-log,zdoom}.txt prepgamesdirs } pkg_postinst() { games_pkg_postinst echo elog "Copy or link wad files into ${GAMES_DATADIR}/doom-data/" elog "(the files must be readable by the 'games' group)." elog elog "To play, simply run:" elog elog " zdoom" elog elog "See /usr/share/doc/${P}/zdoom.txt.gz for more info" echo }