# $Id: Portfile 70254 2010-08-03 21:21:14Z tommyd@macports.org $

PortSystem              1.0

name                    fife
version                 0.3.1
maintainers             tommyd openmaintainer
categories              games python
platforms               darwin
homepage                http://www.fifengine.de/

description             The FIFE game engine
long_description        FIFE stands for Flexible Isometric Free Engine and \
                        is a cross platform game creation framework.

master_sites            sourceforge

checksums               md5     c67561b85e9cd0c7cc25306460e3176c \
                        sha1    79a1cf404be10c4b6ecd6b7334a3d76514612aa8 \
                        rmd160  a963e9063e3b6ef29a76d3566ff45df19c97f20b

depends_build           port:scons

depends_lib             port:python26 \
                        port:libsdl \
                        port:libsdl_image \
                        port:libsdl_ttf \
                        port:boost \
                        port:libogg \
                        port:libvorbis \
                        port:libguichan \
                        port:swig-python

use_configure           no
use_parallel_build      no

pre-build {
     if { ![string equal [string trim [ exec ${prefix}/bin/python_select -s] ] "python26" ] } {
        ui_error "#################################################"
        ui_error "Python 2.6 is currently not selected as default, "
        ui_error "so fife's binary module will probably not load   "
        ui_error "correctly into this version of Python.           "
        ui_error "Please execute                                   "
        ui_error "    sudo ${prefix}/bin/python_select python26    "
        ui_error "and try again.                                   "
        ui_error "#################################################"
        return -code error "wrong python version selected"
    }
}

build.cmd               scons
build.target            fife
build.args              --prefix=${prefix} \
                        --python-prefix=${prefix}/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/
build.env               CC=${configure.cc} CXX=${configure.cxx} \
                        CPP=${configure.cpp} SWIG=${prefix}/bin/swig

destroot.cmd            scons
destroot.target         install-all
destroot.args           --prefix=${prefix} \
                        --python-prefix=${prefix}/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/
destroot.env            DESTDIR=${destroot}
