[141782] trunk/dports/science/sumo

khindenburg at macports.org khindenburg at macports.org
Sat Dec 12 02:59:10 PST 2015


Revision: 141782
          https://trac.macports.org/changeset/141782
Author:   khindenburg at macports.org
Date:     2015-10-28 06:45:45 -0700 (Wed, 28 Oct 2015)
Log Message:
-----------
sumo: Add new utility programs, README.macosx and fix paths - maintainer #49397

Modified Paths:
--------------
    trunk/dports/science/sumo/Portfile

Added Paths:
-----------
    trunk/dports/science/sumo/files/
    trunk/dports/science/sumo/files/README.macosx

Modified: trunk/dports/science/sumo/Portfile
===================================================================
--- 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)
@@ -5,7 +5,7 @@
 
 name                sumo
 version             0.24.0
-revision            1
+revision            2
 categories          science devel
 platforms           darwin
 maintainers         nomaintainer
@@ -27,6 +27,8 @@
 checksums           rmd160  712b8fc05dcc230940abe4d897357bb49d418e00 \
                     sha256  b9fe97bdd0981098b3136456954b6ece718e5efb6a782b0f98f519ccf28a8429
 
+default_variants    +subseconds +messages
+
 depends_lib-append \
     port:fox \
     port:gdal \
@@ -40,11 +42,17 @@
     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
@@ -54,17 +62,36 @@
     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|" $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 (xsd|xml2csv|collectinghandler|connections|netshiftadaptor|route_departOffset|turndefinitions|rmsd|xml2protobuf)#from sumolib import \\1#" $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 \
@@ -156,7 +183,6 @@
     tools/visualization/plot_net_trafficLights.py \
     tools/visualization/plot_summary.py \
     tools/visualization/plot_tripinfo_distributions.py \
-    tools/xml/addSchema.py \
     tools/xml/binary2plain.py \
     tools/xml/csv2xml.py \
     tools/xml/protobuf2xml.py \
@@ -167,6 +193,7 @@
 ]
 
 set python_libs [list \
+    tools/route2trips.py \
     tools/assign/assign.py \
     tools/assign/costMemory.py \
     tools/assign/dijkstra.py \
@@ -244,6 +271,7 @@
     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/
@@ -257,7 +285,7 @@
     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}${prefix}/bin/sumo-${x}
+        xinstall -m 755 ${worksrcpath}/${f} ${destroot}${bindir}/sumo-${x}
     }
 
     xinstall -m 755 -d ${destroot}${sharedir}
@@ -268,10 +296,16 @@
     # file copy ${worksrcpath}/tests ${destroot}${sharedir}/
 
     xinstall -m 755 -d ${destroot}${docdir}
-    xinstall ${worksrcpath}/README ${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}

Added: trunk/dports/science/sumo/files/README.macosx
===================================================================
--- 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)
@@ -0,0 +1,17 @@
+Notes for the MacOS port
+========================
+
+Executables including Python scripts are in @BINDIR@ per MacPorts conventions.
+All executables (there are over 100) are prefixed by "sumo-" to avoid name collisions
+and underscores in names are replaced by dashes.
+Python scripts have the trailing ".py" removed from their names.
+So, for example, "poi_alongRoads.py" becomes "sumo-poi-alongRoads".
+
+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 at .
+Copy the directories to your own working area to run these examples.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20151212/f86b56e1/attachment-0001.html>


More information about the macports-changes mailing list