# Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ # TODO: # - verify all the licenses for fonts + terps are represented in ${LICENSE} # - mail upstream maintainer with various requests for configurability: # - don't hardcode /etc/garglk.ini in config.c # - don't hardcode paths to interpreters in launcher.c (e.g. allow specifying a prefix?) # - have OPTIM honour CFLAGS if they are set, or allow us to override it # - options like USE_SDL and BUNDLEFONTS should be declared with "X ?= y" instead of "X = y" # so we can override them by passing -sX=z to jam (like BUILD right now) 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 media-fonts/liberation-fonts media-fonts/libertine-ttf 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() { JAMARGS="" use debug && JAMARGS="$JAMARGS -sBUILD=DEBUG" use fmod && JAMARGS="$JAMARGS -sUSEFMOD=yes" # disabled by default if ! use sdl; then # This doesn't work because Jamrules overrides it: # JAMARGS="$JAMARGS -sUSESDL=no" sed -i -e '/^USESDL = /s/yes/no/' Jamrules || die fi # Allow custom CFLAGS: sed -i -e "/^\s*OPTIM = /s/ \(-O.*\)\? ;/ $CFLAGS ;/" Jamrules || die # Don't bundle default fonts; we'll install better ones as a dependency: sed -i -e '/^BUNDLEFONTS = /s/yes/no/' Jamrules || die # Convert garglk.ini to UNIX format: edos2unix garglk/garglk.ini # Fix patch to garglk.ini in config loader: sed -i -e "s|/etc|${GAMES_SYSCONFDIR}|" garglk/config.c || die # 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 insinto /usr/share/applications doins garglk/gargoyle.desktop || die doicon garglk/gargoyle-house.png || 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 }