# Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils games autotools DESCRIPTION="A free and portable roguelike molded in the tradition of the \ early greats of the genre." HOMEPAGE="http://crawl-ref.sourceforge.net/" SRC_URI="http://superb-west.dl.sourceforge.net/sourceforge/crawl-ref/stone_soup-${PV}-src.zip" LICENSE="crawl" SLOT="0" KEYWORDS="~x86 ~amd64" IUSE="tiles" DEPEND="sys-libs/ncurses" RDEPEND="sys-libs/ncurses" S="${WORKDIR}/stone_soup-${PV}-src" src_unpack() { unpack stone_soup-${PV}-src.zip || die "unpacking files" } src_compile() { if use tiles ; then UNIX_MAKEFILE="makefile_tiles.unix" fi if ! use tiles; then UNIX_MAKEFILE="makefile.unix" fi cd source sed -i \ -e '/^# DATADIR :=/a DATADIR := ${GAMES_DATADIR}/crawl-data' \ ${UNIX_MAKEFILE} \ || die "sed failed" sed -i \ -e '/^# SAVEDIR :=/a SAVEDIR := ${GAMES_STATEDIR}/crawl-saves/' \ ${UNIX_MAKEFILE} \ || die "sed failed" sed -i \ -e "/stone_soup_icon-32x32/c const char *icon_name = \"${GAMES_DATADIR}/crawl-data/dat/tiles/stone_soup_icon-32x32.png\";" \ tilesdl.cc \ || die "sed failed" emake MAKEFILE=${UNIX_MAKEFILE} || die "compilation failed" } src_install() { cd source dogamesbin crawl || die "installing the binary failed" dodir ${GAMES_DATADIR}/crawl-data dodir ${GAMES_STATEDIR}/crawl-saves dodir ${GAMES_DATADIR}/crawl-data/settings dodir ${GAMES_DATADIR}/crawl-data/docs cp -r dat ${D}${GAMES_DATADIR}/crawl-data cd .. cp -r docs ${D}${GAMES_DATADIR}/crawl-data cp -r settings ${D}${GAMES_DATADIR}/crawl-data dodoc README.txt cd docs dodoc crawl_manual.txt doman crawl.6 prepgamesdirs fperms 770 "${GAMES_STATEDIR}/crawl-saves" || die "fparms failed" }