# $Id: Portfile 72301 2010-10-10 10:41:01Z ryandesign@macports.org $

PortSystem              1.0

name                    wesnoth
version                 1.8.5
categories              games
platforms               darwin
maintainers             nodetwo.com:jordan
license                 GPL-2+
homepage                http://www.wesnoth.org/
master_sites            sourceforge
use_bzip2               yes
use_parallel_build      yes
supported_archs         i386 ppc

description             A fantasy turn-based strategy game

long_description        Battle for Wesnoth is a fantasy turn-based strategy \
                        game. Battle for control of villages, using variety of \
                        units which have advantages and disadvantages in \
                        different types of terrains and against different \
                        types of attacks. Units gain experience and advance \
                        levels, and are carried over from one scenario to the \
                        next campaign.

checksums               sha1    22c6cc10dc7172daf636158dba0acac35f538597 \
                        rmd160  c2a6a9f094b862ef274838fd062c5d961f97c261

depends_lib             port:xorg-libX11 \
                        port:boost \
                        path:lib/pkgconfig/sdl.pc:libsdl \
                        port:libsdl_image \
                        port:libsdl_mixer \
                        port:libsdl_ttf \
                        port:libsdl_net \
                        port:libiconv \
                        port:lua \
                        path:lib/pkgconfig/pango.pc:pango \
                        port:fontconfig \
                        port:freetype \
                        port:fribidi \
                        port:gettext \
                        port:zlib

patchfiles              patch-m4-boost.m4.diff

use_autoreconf          yes

configure.args          --with-libiconv-prefix=${prefix} \
                        --with-libintl-prefix=${prefix} \
                        --with-zlib-prefix=${prefix} \
                        --disable-dbus \
                        --disable-desktop-entry \
                        --disable-sdltest \
                        --disable-server \
                        --disable-strict-compilation \
                        --with-boost=${prefix}

configure.cppflags-append   -DBOOST_IOSTREAMS_USE_DEPRECATED

platform macosx {
    pre-destroot {
        xinstall -d ${destroot}${applications_dir}/Wesnoth.app/Contents/MacOS
        ln -sf ${prefix}/bin/wesnoth \
            ${destroot}${applications_dir}/Wesnoth.app/Contents/MacOS/Wesnoth
    }
}

livecheck.regex         <title>${name}.* ${name}-(\[0-9\]+\\.\[0-9\]*\[02468\](\\.\[0-9\]+)*) released.*</title>
