# Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI=2 inherit eutils games DESCRIPTION="An interactive fiction (IF) player supporting all major formats" HOMEPAGE="http://ccxvii.net/gargoyle/" SRC_URI="http://garglk.googlecode.com/files/${P}-sources.zip" LICENSE="BSD gargoyle hugo luximono GPL-2" SLOT="0" KEYWORDS="~amd64 ~x86" IUSE="-debug -fmod sdl" RDEPEND="dev-libs/glib:2 media-libs/freetype:2 media-libs/jpeg media-libs/libpng sys-libs/zlib x11-libs/gtk+:2 fmod? ( media-libs/fmod ) sdl? ( media-libs/libvorbis media-libs/sdl-mixer media-libs/smpeg )" DEPEND="${RDEPEND} app-arch/unzip dev-util/ftjam" src_prepare() { # TODO: File upstream bug to remove hardcoded path sed -i -e 's|/etc|${GAMES_SYSCONFDIR}|' garglk/config.c || die # TODO: Clean this up if use debug ; then JAMARGS="-sBUILD=DEBUG" OPTIMold="OPTIM = -g ;" OPTIMnew="OPTIM = -g " else JAMARGS="" OPTIMold="OPTIM = -O2 ;" OPTIMnew="OPTIM = " fi # Enable custom cflags OPTIMnew="$OPTIMnew $CFLAGS ;" sed -i -e s/"$OPTIMold"/"$OPTIMnew"/ Jamrules || die # FMOD is disabled by default if use fmod ; then JAMARGS="$JAMARGS -sUSEFMOD=yes" fi # SDL is enabled by default if ! use sdl; then JAMARGS="$JAMARGS -sUSESDL=no" fi edos2unix garglk/garglk.ini # Add ${PN}- prefix to terp paths in launcher: sed -i -e '/^#define T_/s/"/"gargoyle-/' garglk/launcher.c || die # No longer necessary, because wrapper script is not installed: # sed -i -e 's|$dirpath/|\0gargoyle-|' garglk/launcher.sh || die } src_compile() { jam $JAMARGS || die jam $JAMARGS install || die # Note: the line above doesn't actually install anything yet! } src_install() { insinto "${GAMES_SYSCONFDIR}" newins garglk/garglk.ini garglk.ini || die cd build/dist || die dogameslib libgarglk.so || die insinto "${GAMES_PREFIX}/libexec/${PN}" insopts -m0755 for terp in advsys agility alan2 alan3 frotz geas git glulxe hugo jacl \ level9 magnetic nitfol scare tadsr do doins ${terp} || die dosym "${GAMES_PREFIX}/libexec/${PN}/${terp}" \ "${GAMES_BINDIR}/${PN}-${terp}" || die done dogamesbin gargoyle || die prepgamesdirs }