<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[141782] trunk/dports/science/sumo</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="https://trac.macports.org/changeset/141782">141782</a></dd>
<dt>Author</dt> <dd>khindenburg@macports.org</dd>
<dt>Date</dt> <dd>2015-10-28 06:45:45 -0700 (Wed, 28 Oct 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>sumo: Add new utility programs, README.macosx and fix paths - maintainer #49397</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkdportssciencesumoPortfile">trunk/dports/science/sumo/Portfile</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>trunk/dports/science/sumo/files/</li>
<li><a href="#trunkdportssciencesumofilesREADMEmacosx">trunk/dports/science/sumo/files/README.macosx</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkdportssciencesumoPortfile"></a>
<div class="modfile"><h4>Modified: trunk/dports/science/sumo/Portfile (141781 => 141782)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/science/sumo/Portfile        2015-10-28 07:48:25 UTC (rev 141781)
+++ trunk/dports/science/sumo/Portfile        2015-10-28 13:45:45 UTC (rev 141782)
</span><span class="lines">@@ -5,7 +5,7 @@
</span><span class="cx"> 
</span><span class="cx"> name                sumo
</span><span class="cx"> version             0.24.0
</span><del>-revision            1
</del><ins>+revision            2
</ins><span class="cx"> categories          science devel
</span><span class="cx"> platforms           darwin
</span><span class="cx"> maintainers         nomaintainer
</span><span class="lines">@@ -27,6 +27,8 @@
</span><span class="cx"> checksums           rmd160  712b8fc05dcc230940abe4d897357bb49d418e00 \
</span><span class="cx">                     sha256  b9fe97bdd0981098b3136456954b6ece718e5efb6a782b0f98f519ccf28a8429
</span><span class="cx"> 
</span><ins>+default_variants    +subseconds +messages
+
</ins><span class="cx"> depends_lib-append \
</span><span class="cx">     port:fox \
</span><span class="cx">     port:gdal \
</span><span class="lines">@@ -40,11 +42,17 @@
</span><span class="cx">     port:py27-matplotlib \
</span><span class="cx">     port:py27-protobuf
</span><span class="cx"> 
</span><ins>+set bindir            ${prefix}/bin
+set libdir            ${prefix}/lib
</ins><span class="cx"> set sharedir          ${prefix}/share/${name}
</span><span class="cx"> set docdir            ${prefix}/share/doc/${name}
</span><span class="cx"> set python_bin        ${frameworks_dir}/Python.framework/Versions/2.7/bin/python2.7
</span><span class="cx"> set python_lib        ${frameworks_dir}/Python.framework/Versions/2.7/lib/python2.7/site-packages
</span><span class="cx"> 
</span><ins>+post-extract {
+    copy ${filespath}/README.macosx ${worksrcpath}/
+}
+
</ins><span class="cx"> post-patch {
</span><span class="cx">     reinplace &quot;s#std::getenv(\&quot;SUMO_HOME\&quot;)#\&quot;${sharedir}\&quot;#&quot; src/utils/xml/SUMOSAXReader.cpp
</span><span class="cx">     reinplace &quot;s#\./PHEMlight/#${sharedir}/data/PHEMlight/#&quot; src/microsim/MSFrame.cpp
</span><span class="lines">@@ -54,17 +62,36 @@
</span><span class="cx">     set python_bin ${frameworks_dir}/Python.framework/Versions/2.7/bin/python2.7
</span><span class="cx">     foreach f [list {*}$python_scripts {*}$python_libs {*}$python_tutorials] {
</span><span class="cx">         reinplace &quot;s#/usr/bin/env python#${python_bin}#&quot; $f
</span><del>-        reinplace -E &quot;s|^(sys.path.append)|# \\1|&quot; $f
</del><ins>+        reinplace -E &quot;s|^( *)(sys.path.append)|\\1# \\2|&quot; $f
+        reinplace -E &quot;s|^( *)(.*__file__.*\\.\\.)|\\1# \\2|&quot; $f
+        reinplace -E &quot;s|^( *)(os.path.join.*\\.\\.)|\\1# \\2|&quot; $f
+        reinplace -E &quot;s|^( *)(SUMO_HOME =)|\\1  # \\2|&quot; $f
+        reinplace -E &quot;s|^(if .*SUMO_HOME)|if True:  # \\1|&quot; $f
+        reinplace -E &quot;s|^( +)(.*os.path.join.*SUMO_HOME)|\\1# \\2|&quot; $f
</ins><span class="cx">         reinplace -E &quot;s#^( *)from (assign|costMemory|dijkstra|duaIterate|elements|inputs|network|outputs|routeChoices|statisticsElements|tables)#\\1from sumolib.assign.\\2#&quot; $f
</span><span class="cx">         reinplace -E &quot;s#^( *)from (miscutils|OrderedMultiSet|output|testUtil)#\\1from sumolib.\\2#&quot; $f
</span><del>-        reinplace -E &quot;s#^import (xsd|xml2csv|collectinghandler|connections|netshiftadaptor|route_departOffset|turndefinitions|rmsd|xml2protobuf)#from sumolib import \\1#&quot; $f
</del><ins>+        reinplace -E &quot;s#^import (detector|route2trips|xsd|xml2csv|collectinghandler|connections|netshiftadaptor|route_departOffset|sort_routes|turndefinitions|rmsd|xml2protobuf)#from sumolib import \\1#&quot; $f
</ins><span class="cx">         reinplace -E &quot;s#^import (os,.*), helpers#import \\1, sumolib.helpers as helpers#&quot; $f
</span><span class="cx">     }
</span><ins>+    reinplace -E &quot;s#@BINDIR@#${bindir}#&quot; README.macosx
+    reinplace -E &quot;s#@LIBDIR@#${libdir}#&quot; README.macosx
+    reinplace -E &quot;s#@DOCDIR@#${docdir}#&quot; README.macosx
+    reinplace -E &quot;s#@PYTHON_LIBDIR@#${python_lib}#&quot; README.macosx
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> # List of all python scripts. Used later to ensure usage of python27
</span><span class="cx"> # (instead of the currently active python)
</span><ins>+# available in the next release:
+# tools/tlsCoordinator.py
</ins><span class="cx"> set python_scripts [list \
</span><ins>+    tools/districts2poly.py \
+    tools/edgesInDistricts.py \
+    tools/generateBidiDistricts.py \
+    tools/pedestrianFlow.py \
+    tools/randomTrips.py \
+    tools/route2trips.py \
+    tools/route2sel.py \
+    tools/traceExporter.py \
</ins><span class="cx">     tools/assign/Assignment.py \
</span><span class="cx">     tools/assign/cadytsIterate.py \
</span><span class="cx">     tools/assign/costFunctionChecker.py \
</span><span class="lines">@@ -156,7 +183,6 @@
</span><span class="cx">     tools/visualization/plot_net_trafficLights.py \
</span><span class="cx">     tools/visualization/plot_summary.py \
</span><span class="cx">     tools/visualization/plot_tripinfo_distributions.py \
</span><del>-    tools/xml/addSchema.py \
</del><span class="cx">     tools/xml/binary2plain.py \
</span><span class="cx">     tools/xml/csv2xml.py \
</span><span class="cx">     tools/xml/protobuf2xml.py \
</span><span class="lines">@@ -167,6 +193,7 @@
</span><span class="cx"> ]
</span><span class="cx"> 
</span><span class="cx"> set python_libs [list \
</span><ins>+    tools/route2trips.py \
</ins><span class="cx">     tools/assign/assign.py \
</span><span class="cx">     tools/assign/costMemory.py \
</span><span class="cx">     tools/assign/dijkstra.py \
</span><span class="lines">@@ -244,6 +271,7 @@
</span><span class="cx">     file copy ${worksrcpath}/tools/turn-defs/connections.py ${destroot}${python_lib}/sumolib/
</span><span class="cx">     file copy ${worksrcpath}/tools/turn-defs/turndefinitions.py ${destroot}${python_lib}/sumolib/
</span><span class="cx">     xinstall -m 755 ${worksrcpath}/tools/detector/detector.py ${destroot}${python_lib}/sumolib/
</span><ins>+    xinstall -m 755 ${worksrcpath}/tools/route/sort_routes.py ${destroot}${python_lib}/sumolib/
</ins><span class="cx">     xinstall -m 755 ${worksrcpath}/tools/turn-defs/collectinghandler.py ${destroot}${python_lib}/sumolib/
</span><span class="cx">     xinstall -m 755 ${worksrcpath}/tools/lib/rmsd.py ${destroot}${python_lib}/sumolib/
</span><span class="cx">     xinstall -m 755 ${worksrcpath}/tools/lib/play.png ${destroot}${python_lib}/sumolib/
</span><span class="lines">@@ -257,7 +285,7 @@
</span><span class="cx">     foreach f [list {*}$python_scripts] {
</span><span class="cx">         # convert file names to use dash rather than underscore and remove trailing .py or .pl
</span><span class="cx">         set x [string map [list _ -] [file rootname [file tail ${f}]]]
</span><del>-        xinstall -m 755 ${worksrcpath}/${f} ${destroot}${prefix}/bin/sumo-${x}
</del><ins>+        xinstall -m 755 ${worksrcpath}/${f} ${destroot}${bindir}/sumo-${x}
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     xinstall -m 755 -d ${destroot}${sharedir}
</span><span class="lines">@@ -268,10 +296,16 @@
</span><span class="cx">     # file copy ${worksrcpath}/tests ${destroot}${sharedir}/
</span><span class="cx"> 
</span><span class="cx">     xinstall -m 755 -d ${destroot}${docdir}
</span><del>-    xinstall ${worksrcpath}/README ${destroot}${docdir}/
</del><ins>+    file copy ${worksrcpath}/README ${destroot}${docdir}/
+    file copy ${worksrcpath}/README.macosx ${destroot}${docdir}/
</ins><span class="cx">     file copy ${worksrcpath}/docs/examples ${destroot}${docdir}/
</span><span class="cx">     file copy ${worksrcpath}/docs/tutorial ${destroot}${docdir}/
</span><span class="cx">     file copy ${worksrcpath}/data ${destroot}${sharedir}/data/
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+notes &quot;
+    *** Many program names are prefixed by sumo- for this port.
+    *** See ${docdir}/README.macosx for additional notes.
+&quot;
+
</ins><span class="cx"> livecheck.regex     ${name}-src-(\[0-9.\]+)${extract.suffix}
</span></span></pre></div>
<a id="trunkdportssciencesumofilesREADMEmacosx"></a>
<div class="addfile"><h4>Added: trunk/dports/science/sumo/files/README.macosx (0 => 141782)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/science/sumo/files/README.macosx                                (rev 0)
+++ trunk/dports/science/sumo/files/README.macosx        2015-10-28 13:45:45 UTC (rev 141782)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+Notes for the MacOS port
+========================
+
+Executables including Python scripts are in @BINDIR@ per MacPorts conventions.
+All executables (there are over 100) are prefixed by &quot;sumo-&quot; to avoid name collisions
+and underscores in names are replaced by dashes.
+Python scripts have the trailing &quot;.py&quot; removed from their names.
+So, for example, &quot;poi_alongRoads.py&quot; becomes &quot;sumo-poi-alongRoads&quot;.
+
+Compiled libraries are in @LIBDIR@ per MacPorts conventions.
+
+python27 is currently used by this port. All SUMO python libraries are collected
+and installed underneath @PYTHON_LIBDIR@/sumolib/.
+
+Examples can be found underneath @DOCDIR@ in tutorials/ and examples/.
+Note that many require writing intermediate files or logs which is prohibited in @DOCDIR@.
+Copy the directories to your own working area to run these examples.
</ins></span></pre>
</div>
</div>

</body>
</html>