inherit toolchain-funcs flag-o-matic games MY_P="deng_1.8.9+1.9.0.beta5.1+svn.6034" # FIXME, this is stupid DESCRIPTION="A modern gaming engine for Doom, Heretic, and Hexen" HOMEPAGE="http://www.doomsdayhq.com/" SRC_URI="https://launchpad.net/%7Eyagisan/+archive/+files/${MY_P}.orig.tar.gz" LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64 ~ppc ~x86" IUSE="openal" RDEPEND="virtual/opengl virtual/glu media-libs/libsdl media-libs/sdl-mixer media-libs/sdl-net media-libs/libpng sys-libs/glibc sys-libs/zlib net-misc/curl openal? ( media-libs/openal )" DEPEND="${RDEPEND} >=dev-util/cmake-2.4.5 app-arch/zip" S=${WORKDIR}/doomsday/build src_compile() { if ! built_with_use "net-misc/curl" gnutls ; then eerror "Recompile net-misc/curl with 'gnutls' USE flag." die "curl without gnutls support detected" fi # -O3 causes segfaults, noticably when trying to play Hexen replace-flags -O3 -O2 cmake \ -DCMAKE_C_COMPILER=$(type -P $(tc-getCC)) \ -DCMAKE_INSTALL_PREFIX=/usr \ -Ddatadir="${GAMES_DATADIR}"/${PN} \ -Dbindir="${GAMES_BINDIR}" \ -Dlibdir="$(games_get_libdir)" \ -DFORTIFY_SOURCE=2 \ $(use openal && echo -DBUILDOPENAL=1) \ ../ || die "cmake failed" emake || die "emake failed" } src_install() { emake DESTDIR="${D}" install || die "emake install failed" mv "${D}/${GAMES_DATADIR}"/{${PN}/data/jdoom,doom-data} || die mv "${D}/${GAMES_DATADIR}"/{${PN}/data/jheretic,heretic-data} || die mv "${D}/${GAMES_DATADIR}"/{${PN}/data/jhexen,hexen-data} || die dosym "${GAMES_DATADIR}"/doom-data "${GAMES_DATADIR}"/${PN}/data/jdoom || die dosym "${GAMES_DATADIR}"/heretic-data "${GAMES_DATADIR}"/${PN}/data/jheretic || die dosym "${GAMES_DATADIR}"/hexen-data "${GAMES_DATADIR}"/${PN}/data/jhexen || die local game for game in jdoom jheretic jhexen ; do newgamesbin "${FILESDIR}"/wrapper ${game} sed -i "s:GAME:${game}:" \ "${D}/${GAMES_BINDIR}"/${game} \ || die "sed ${GAMES_BINDIR}/${game} failed" done # Make wrappers for the common wads local n for n in doom doom2 tnt plutonia ; do games_make_wrapper ${PN}-${n} \ "jdoom -file \"${GAMES_DATADIR}\"/doom-data/${n}.wad" done for n in heretic ; do games_make_wrapper ${PN}-${n} \ "jheretic -file \"${GAMES_DATADIR}\"/heretic-data/${n}.wad" done for n in hexen hexdd ; do games_make_wrapper ${PN}-${n} \ "jhexen -file \"${GAMES_DATADIR}\"/hexen-data/${n}.wad" done doman ../engine/doc/${PN}.6 dodoc ../engine/doc/*.txt README prepgamesdirs } pkg_postinst() { games_pkg_postinst elog "To play the original Doom levels, or its addons," elog "place doom.wad / doom2.wad / tnt.wad / plutonia.wad into" elog "${GAMES_DATADIR}/doom-data. Then run" elog "doomsday-doom / doomsday-doom2" elog "doomsday-tnt / doomsday-plutonia accordingly." elog elog "doom1.wad is the shareware demo wad consisting of 1 episode," elog "and doom.wad is the full Doom 1 set of 3 episodes" elog "(or 4 in the Final Doom wad). doom2.wad is the Doom 2 game." elog "tnt.wad and plutonia.wad are the TNT: Evilution and The Plutonia" elog "Experiment addons, respectively." elog elog "You can even emerge doom-data (shareware version) and/or freedoom" elog "(free version), with the doomsday useflag enabled, to play for free." elog elog "For Heretic, put heretic.wad into ${GAMES_DATADIR}/heretic-data" elog "For Hexen and its addon, put hexen.wad and/or hexdd.wad into" elog "${GAMES_DATADIR}/hexen-data" elog "Run doomsday-heretic / doomsday-hexen / doomsday-hexdd accordingly." }