# 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) # N.B. fmod support is based on an older version of fmod and completely broken on Linux. MY_PV="2010.1" MY_P="${PN}-${MY_PV}" EAPI=3 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/${MY_P}-sources.zip" LICENSE="BSD gargoyle hugo luximono GPL-2" SLOT="0" KEYWORDS="~amd64 ~x86" IUSE="-debug sdl" RDEPEND="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 sdl? ( media-libs/libsdl media-libs/sdl-mixer media-libs/sdl-sound media-libs/libvorbis media-libs/smpeg )" DEPEND="${RDEPEND} app-arch/unzip dev-util/ftjam" S="${WORKDIR}/${MY_P}" src_prepare() { JAMARGS="" use debug && JAMARGS="$JAMARGS -sBUILD=DEBUG" 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 #Fix LDFLAGS for shared libraries sed -i \ -e 's/$(SHRLINKFLAGS) /$(SHRLINKFLAGS) $(LDFLAGS) /' \ Jamshared \ || die "sed failed" } src_compile() { jam LINKFLAGS="${LDFLAGS}" $JAMARGS || die jam $JAMARGS install || die # Note: the line above doesn't actually install anything yet! } src_install() { # Install config file: insinto "${GAMES_SYSCONFDIR}" newins garglk/garglk.ini garglk.ini || die # Install application entry and icon: insinto /usr/share/applications doins garglk/${PN}.desktop || die doicon garglk/${PN}-house.png || die # Install library: cd build/dist || die dogameslib libgarglk.so || die # Install launcher and terps, symlinking binaries to avoid name clashes: 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 # N.B. the launcher binary is installed in libexec too, because it expects # to find the interpreters in the same directory: doins ${PN}|| die dosym "${GAMES_PREFIX}/libexec/${PN}/${PN}" \ "${GAMES_BINDIR}/${PN}" || die prepgamesdirs }