# $Id: Portfile 91200 2012-03-25 18:58:17Z dports@macports.org $

PortSystem          1.0

name                fizmo
version             0.7.2
categories          games
maintainers         spellbreaker.org:Christoph.Ender
description         Console-based Z-Machine interpreter for Infocom games.
long_description    Fizmo is a Z-Machine interpreter (Fizmo Interprets \
                    Z-Machine Opcodes) which allows you to run Infocom- and \
                    most other Z-Machine based games -- except version 6 -- on \
                    POSIX-like systems which provide a ncursesw (note the 'w') \
                    library. It has been successfully compiled on Debian based \
                    Linux, Mac OS X (with MacPorts providing ncursesw) and \
                    Windows (using Cygwin and a self-compiled ncursesw \
                    library). This is a console-style application, meaning \
                    that it runs in textmode and does not provide any GUI \
                    whatsoever. For more information about Infocom and \
                    interactive fiction, see the 'New to IF' section at \
                    http://www.ifarchive.org. Games are available from \
                    http://www.ifarchive.org/indexes/if-archiveXgamesXzcode.html
homepage            http://spellbreaker.org/~chrender/fizmo/
platforms           darwin linux
master_sites        http://spellbreaker.org/~chrender/fizmo/source/

checksums           sha256 9d9f6121e6a7cb67a3ffdcd182fc8a1840f01faae6ec1dfb85b1c4fbd2bdb7ed \
                    rmd160 f5e8f31db5a84c2e18a2a12b17d54a29ceb87e47

depends_build       port:pkgconfig

depends_lib         port:ncurses \
                    port:libsdl_sound \
                    port:libsndfile \
                    port:libxml2 \
                    port:xorg-libX11 \
                    port:jpeg \
                    port:libpng

post-patch {
   file copy ${worksrcpath}/config.macports.mk ${worksrcpath}/config.mk
   reinplace "s|/opt/local|${destroot}${prefix}|g" ${worksrcpath}/config.mk
}

use_configure       no

build.args          CC="${configure.cc}" CFLAGS="[get_canonical_archflags]" prefix=${prefix}
build.target        fizmo-console fizmo-ncursesw

destroot.args       CC="${configure.cc}" CFLAGS="[get_canonical_archflags]" prefix=${prefix} DESTDIR="${destroot}/${prefix}"
destroot.target     install-locales install-fizmo-console install-fizmo-ncursesw

post-destroot {
        file link -symbolic ${destroot}${prefix}/bin/fizmo \
                fizmo-ncursesw
        file link -symbolic ${destroot}${prefix}/share/man/man6/fizmo.6 \
                fizmo-ncursesw.6
}

