# -*- 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
maintainers {gmail.com:tlockhart1976 @lockhart} openmaintainer
description Simulation of Urban MObility (SUMO)
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-sim.org/
master_sites sourceforge:project/sumo/sumo/version%20${version}/
distname ${name}-src-${version}
worksrcdir ${name}-${version}
checksums rmd160 a52574c70170f93b80dafb115a0d1a4892c5f48b \
sha256 00753ca57a9911f0c99202505a6b05b1777168134842d7924fd827766642608a
default_variants +subseconds +messages
depends_build port:coreutils
# py27-matplotlib requires perl so let it choose which version
set sharedir ${prefix}/share/${name}
set docdir ${prefix}/share/doc/${name}
set python_bin ${frameworks_dir}/Python.framework/Versions/2.7/bin/python2.7
set python_lib ${frameworks_dir}/Python.framework/Versions/2.7/lib/python2.7/site-packages
copy ${filespath}/README.macosx ${worksrcpath}/
reinplace "s#std::getenv(\"SUMO_HOME\")#\"${sharedir}\"#" src/utils/xml/SUMOSAXReader.cpp
reinplace "s#\./PHEMlight/#${sharedir}/data/PHEMlight/#" src/microsim/MSFrame.cpp
reinplace -locale C "s#./PHEMlight/#${sharedir}/data/PHEMlight/#" src/tools/emissionsDrivingCycle_main.cpp
reinplace -locale C "s#./PHEMlight/#${sharedir}/data/PHEMlight/#" src/tools/emissionsMap_main.cpp
set python_bin ${frameworks_dir}/Python.framework/Versions/2.7/bin/python2.7
foreach f [list {*}$python_scripts {*}$python_libs {*}$python_tutorials] {
reinplace -q "s#/usr/bin/env python#${python_bin}#" $f
reinplace -q -E "s|^( *)(sys.path.append)|\\1# \\2|" $f
reinplace -q -E "s|^( *)(.*__file__.*\\.\\.)|\\1# \\2|" $f
reinplace -q -E "s|^( *)(os.path.join.*\\.\\.)|\\1# \\2|" $f
reinplace -q -E "s|^( *)(SUMO_HOME =)|\\1 # \\2|" $f
reinplace -q -E "s|^(if .*SUMO_HOME)|if True: # \\1|" $f
reinplace -q -E "s|^( +)(.*os.path.join.*SUMO_HOME)|\\1# \\2|" $f
reinplace -q -E "s#^( *)from (assign|costMemory|dijkstra|duaIterate|elements|inputs|network|outputs|routeChoices|statisticsElements|tables)#\\1from sumolib.assign.\\2#" $f
reinplace -q -E "s#^( *)from (miscutils|OrderedMultiSet|output|testUtil)#\\1from sumolib.\\2#" $f
reinplace -q -E "s#^import (detector|route2trips|xsd|xml2csv|collectinghandler|connections|netshiftadaptor|route_departOffset|sort_routes|turndefinitions|rmsd|xml2protobuf)#from sumolib import \\1#" $f
reinplace -q -E "s#^import (os,.*), helpers#import \\1, sumolib.helpers as helpers#" $f
reinplace -E "s#@BINDIR@#${bindir}#" README.macosx
reinplace -E "s#@LIBDIR@#${libdir}#" README.macosx
reinplace -E "s#@DOCDIR@#${docdir}#" README.macosx
reinplace -E "s#@PYTHON_LIBDIR@#${python_lib}#" README.macosx
# List of all python scripts. Used later to ensure usage of python27
# (instead of the currently active python)
set python_scripts [list \
tools/createVehTypeDistribution.py \
tools/districts2poly.py \
tools/edgesInDistricts.py \
tools/generateBidiDistricts.py \