# -*- 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 144468 2016-01-09 17:26:21Z khindenburg@macports.org $ PortSystem 1.0 name sumo version 0.25.0 categories science devel platforms darwin maintainers gmail.com:tlockhart1976 openmaintainer license GPL-3 description 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-sim.org/ master_sites sourceforge:project/sumo/sumo/version%20${version}/ distname ${name}-src-${version} worksrcdir ${name}-${version} checksums rmd160 0b9faa6690b53abb15eb2039650410aeecdd33cd \ sha256 b959eb9aa705e6029764756225185c2602101180fa2f51233976385ff05bf88e default_variants +subseconds +messages depends_lib-append \ port:fox \ port:gdal \ port:libtool \ port:proj \ port:xercesc3 # py27-matplotlib requires perl so let it choose which version depends_lib-append \ port:python27 \ port:py27-matplotlib \ port:py27-protobuf set bindir ${prefix}/bin set libdir ${prefix}/lib 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 post-extract { copy ${filespath}/README.macosx ${worksrcpath}/ } post-patch { reinplace "s#std::getenv(\"SUMO_HOME\")#\"${sharedir}\"#" src/utils/xml/SUMOSAXReader.cpp reinplace "s#\./PHEMlight/#${sharedir}/data/PHEMlight/#" src/microsim/MSFrame.cpp reinplace "s#\./PHEMlight/#${sharedir}/data/PHEMlight/#" src/router/ROFrame.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 "s#/usr/bin/env python#${python_bin}#" $f reinplace -E "s|^( *)(sys.path.append)|\\1# \\2|" $f reinplace -E "s|^( *)(.*__file__.*\\.\\.)|\\1# \\2|" $f reinplace -E "s|^( *)(os.path.join.*\\.\\.)|\\1# \\2|" $f reinplace -E "s|^( *)(SUMO_HOME =)|\\1 # \\2|" $f reinplace -E "s|^(if .*SUMO_HOME)|if True: # \\1|" $f reinplace -E "s|^( +)(.*os.path.join.*SUMO_HOME)|\\1# \\2|" $f reinplace -E "s#^( *)from (assign|costMemory|dijkstra|duaIterate|elements|inputs|network|outputs|routeChoices|statisticsElements|tables)#\\1from sumolib.assign.\\2#" $f reinplace -E "s#^( *)from (miscutils|OrderedMultiSet|output|testUtil)#\\1from sumolib.\\2#" $f reinplace -E "s#^import (detector|route2trips|xsd|xml2csv|collectinghandler|connections|netshiftadaptor|route_departOffset|sort_routes|turndefinitions|rmsd|xml2protobuf)#from sumolib import \\1#" $f reinplace -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) # available in the next release: # tools/tlsCoordinator.py set python_scripts [list \ tools/districts2poly.py \ tools/edgesInDistricts.py \ tools/generateBidiDistricts.py \ tools/pedestrianFlow.py \ tools/randomTrips.py \ tools/route2trips.py \ tools/route2sel.py \ tools/traceExporter.py \ tools/assign/Assignment.py \ tools/assign/cadytsIterate.py \ tools/assign/costFunctionChecker.py \ tools/assign/duaIterate.py \ tools/assign/duaIterate_analysis.py \ tools/assign/matrixDailyToHourly.py \ tools/assign/networkStatistics.py \ tools/assign/one-shot.py \ tools/traceExporter.py \ tools/detector/aggregateFlows.py \ tools/detector/deleteUnusedDetectors.py \ tools/detector/flowFromRoutes.py \ tools/detector/flowrouter.py \ tools/detector/validate.py \ tools/district/countConnectionsInDistricts.py \ tools/district/districtMapper.py \ tools/net/0103to0110.py \ tools/net/0123to0130.py \ tools/net/batch0103to0110.py \ tools/net/createRoundaboutConnections.py \ tools/net/netcheck.py \ tools/net/netdiff.py \ tools/net/netduplicate.py \ tools/net/netextract.py \ tools/net/netextract_subPart.py \ tools/net/netmatch.py \ tools/net/netstats.py \ tools/net/network_statistics.py \ tools/net/odConnectionsCheck.py \ tools/net/patchNetFiles.py \ tools/net/prepareVISUM.py \ tools/net/reprojectpolys.py \ tools/net/visum_mapDistricts.py \ tools/net/xmlconnections_mapEdges.py \ tools/net/xmledges_applyOffset.py \ tools/net/xmlnodes_applyOffset.py \ tools/output/accelerations.py \ tools/output/analyze_teleports.py \ tools/output/generateITetrisIntersectionMetrics.py \ tools/output/generateITetrisNetworkMetrics.py \ tools/output/generateMeanDataDefinitions.py \ tools/output/generateTLSE1Detectors.py \ tools/output/generateTLSE2Detectors.py \ tools/output/generateTLSE3Detectors.py \ tools/output/netdumpdiff.py \ tools/output/netdumpmean.py \ tools/output/timingStats.py \ tools/output/vehLanes.py \ tools/output/vehroute2amitranOD.py \ tools/output/vehrouteDiff.py \ tools/purgatory/10to11.py \ tools/purgatory/findUTurns.py \ tools/purgatory/kShortest.py \ tools/purgatory/routes2OD.py \ tools/route/cutRoutes.py \ tools/route/route2alts.py \ tools/route/route2poly.py \ tools/route/routeDiffStats.py \ tools/route/route_1htoDay.py \ tools/route/route_departOffset.py \ tools/route/routecheck.py \ tools/route/routecompare.py \ tools/route/routes_Join.py \ tools/route/sort_routes.py \ tools/route/tracegenerator.py \ tools/route/tracemapper.py \ tools/route/vehicle2flow.py \ tools/shapes/CSV2polyconvertXML.py \ tools/shapes/circlePolygon.py \ tools/shapes/poi_alongRoads.py \ tools/shapes/poi_atTLS.py \ tools/shapes/pois2inductionLoops.py \ tools/tls/tls_check.py \ tools/tls/tls_csv2SUMO.py \ tools/traci/rebuildConstants.py \ tools/traci/traciToHex.py \ tools/trigger/csv2vss.py \ tools/turn-defs/generateTurnDefs.py \ tools/visualization/mpl_dump_onNet.py \ tools/visualization/mpl_dump_timeline.py \ tools/visualization/mpl_dump_twoAgainst.py \ tools/visualization/mpl_tripinfos_twoAgainst.py \ tools/visualization/plot_csv_bars.py \ tools/visualization/plot_csv_pie.py \ tools/visualization/plot_csv_timeline.py \ tools/visualization/plot_net_dump.py \ tools/visualization/plot_net_selection.py \ tools/visualization/plot_net_speeds.py \ tools/visualization/plot_net_trafficLights.py \ tools/visualization/plot_summary.py \ tools/visualization/plot_tripinfo_distributions.py \ tools/xml/binary2plain.py \ tools/xml/csv2xml.py \ tools/xml/protobuf2xml.py \ tools/xml/rebuildSchemata.py \ tools/xml/schemaCheck.py \ tools/xml/xml2csv.py \ tools/xml/xml2protobuf.py \ ] set python_libs [list \ tools/route2trips.py \ tools/assign/assign.py \ tools/assign/costMemory.py \ tools/assign/dijkstra.py \ tools/assign/elements.py \ tools/assign/inputs.py \ tools/assign/network.py \ tools/assign/outputs.py \ tools/assign/run.py \ tools/assign/statisticsElements.py \ tools/assign/tables.py \ tools/net/netshiftadaptor.py \ tools/net/OrderedMultiSet.py \ tools/route/route_departOffset.py \ tools/sumolib/geomhelper.py \ tools/trigger/csv2vss.py \ tools/turn-defs/connections.py \ tools/turn-defs/turndefinitions.py \ tools/xml/xml2csv.py \ tools/xml/xml2protobuf.py \ tools/xml/xsd.py \ ] set python_tutorials [list \ docs/tutorial/city_mobil/constants.py \ docs/tutorial/city_mobil/statistics.py \ docs/tutorial/hello/runner.py \ docs/tutorial/output_parsing/runner.py \ docs/tutorial/quickstart/runner.py \ docs/tutorial/san_pablo_dam/runner.py \ docs/tutorial/traci_tls/runner.py \ ] # 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 } post-destroot { xinstall -m 755 -d ${destroot}${python_lib} file copy ${worksrcpath}/tools/sumolib ${destroot}${python_lib}/ if {![variant_isset no_traci]} { file copy ${worksrcpath}/tools/traci ${destroot}${python_lib}/ } file copy ${worksrcpath}/tools/assign ${destroot}${python_lib}/sumolib/ touch ${destroot}${python_lib}/sumolib/assign/__init__.py file copy ${worksrcpath}/tools/turn-defs/connections.py ${destroot}${python_lib}/sumolib/ file copy ${worksrcpath}/tools/turn-defs/turndefinitions.py ${destroot}${python_lib}/sumolib/ xinstall -m 755 ${worksrcpath}/tools/detector/detector.py ${destroot}${python_lib}/sumolib/ xinstall -m 755 ${worksrcpath}/tools/route/sort_routes.py ${destroot}${python_lib}/sumolib/ xinstall -m 755 ${worksrcpath}/tools/turn-defs/collectinghandler.py ${destroot}${python_lib}/sumolib/ xinstall -m 755 ${worksrcpath}/tools/lib/rmsd.py ${destroot}${python_lib}/sumolib/ xinstall -m 755 ${worksrcpath}/tools/lib/play.png ${destroot}${python_lib}/sumolib/ xinstall -m 755 ${worksrcpath}/tools/lib/stop.png ${destroot}${python_lib}/sumolib/ xinstall -m 755 ${worksrcpath}/tools/lib/testUtil.py ${destroot}${python_lib}/sumolib/ foreach f $python_libs { xinstall -m 755 ${worksrcpath}/${f} ${destroot}${python_lib}/sumolib/ } foreach f [list {*}$python_scripts] { # convert file names to use dash rather than underscore and remove trailing .py or .pl set x [string map [list _ -] [file rootname [file tail ${f}]]] xinstall -m 755 ${worksrcpath}/${f} ${destroot}${bindir}/sumo-${x} } xinstall -m 755 -d ${destroot}${sharedir} foreach d [list emissions typemap xsd] { file copy ${worksrcpath}/data/${d} ${destroot}${sharedir}/${d}/ } # tests/ is not included in the source tarball # file copy ${worksrcpath}/tests ${destroot}${sharedir}/ xinstall -m 755 -d ${destroot}${docdir} file copy ${worksrcpath}/README ${destroot}${docdir}/ file copy ${worksrcpath}/README.macosx ${destroot}${docdir}/ file copy ${worksrcpath}/docs/examples ${destroot}${docdir}/ file copy ${worksrcpath}/docs/tutorial ${destroot}${docdir}/ file copy ${worksrcpath}/data ${destroot}${sharedir}/data/ } notes " *** Many program names are prefixed by sumo- for this port. *** See ${docdir}/README.macosx for additional notes. " livecheck.regex ${name}-src-(\[0-9.\]+)${extract.suffix}