# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 68016 2010-05-24 22:34:40Z ryandesign@macports.org $

PortSystem          1.0

name                sumo-devel
conflicts           sumo
svn.revision        8004
version             0.11.1-r${svn.revision}
categories          science devel
platforms           darwin
maintainers         me.com:jens.fahnenbruck \
                    herbiet.net:guillaume-jean
license             GPL-2

description         Development version of Simulation of Urban MObility (SUMO)
long_description \
    Simulation of Urban MObility (SUMO) is an open source, highly portable, \
    microscopic road traffic simulation package designed to handle large \
    road networks. It is mainly developed by employees of the Institute of \
    Transportation Systems at the German Aerospace Center.

homepage            http://sumo.sourceforge.net/

fetch.type          svn
svn.method          checkout
svn.args-append     --depth immediates
svn.url             https://sumo.svn.sourceforge.net/svnroot/sumo/trunk/sumo/
worksrcdir          sumo

# don't check out the tests directory; it's huge and doesn't get used
post-fetch {
    set svn_item_list [list]
    foreach svn_item [glob -directory ${worksrcpath} -tails *] {
        if {[file isdirectory ${worksrcpath}/${svn_item}] && "tests" != ${svn_item}} {
            lappend svn_item_list ${svn_item}
        }
    }
    set cmd "cd ${worksrcpath} && ${svn.cmd} ${svn.pre_args} update -r ${svn.revision} --set-depth infinity [join ${svn_item_list} { }]"
    ui_debug ${cmd}
    system ${cmd}
}

depends_lib-append \
    port:fox \
    port:gdal \
    port:libtool \
    port:proj \
    port:xercesc

use_autoreconf     yes

# required for the gui to be enabled
configure.args-append \
    --with-fox=${prefix}

variant debug description {Enable SUMO debugging code} {
    configure.args-append \
        --enable-debug
}

variant double_precision description {Use "double" instead of "float" for calculations} {
    configure.args-append \
        --enable-double-precision
}

variant subseconds description {Enable subsecond timesteps} {
    configure.args-append \
        --enable-subsecond
}

variant messages description {Enable static and dynamic messages emitted by vehicles} {
    configure.args-append \
        --enable-messages
}

variant no_internal_lanes description {Disable junction internal lanes} {
    configure.args-append \
        --disable-internal-lanes
}

variant no_traci description {Disable Traffic Control Interface (TraCI) Server} {
    configure.args-append \
        --disable-traci
}
