51 | | use_autoreconf yes |
| 55 | # py27-matplotlib requires perl so let it choose which version |
| 56 | depends_lib-append \ |
| 57 | port:python27 \ |
| 58 | port:py27-matplotlib |
| 59 | |
| 60 | set sharedir ${prefix}/share/${name} |
| 61 | set docdir ${prefix}/share/doc/${name} |
| 62 | set python_bin ${frameworks_dir}/Python.framework/Versions/2.7/bin/python2.7 |
| 63 | set python_lib ${frameworks_dir}/Python.framework/Versions/2.7/lib/python2.7/site-packages |
| 64 | set perl_bin "/usr/bin/env perl" |
| 65 | |
| 66 | post-patch { |
| 67 | # reinplace "s#std::getenv(\"SUMO_HOME\")#\"${sharedir}\"#" src/utils/xml/SUMOSAXReader.cpp |
| 68 | reinplace "s#\./PHEMlight/#${sharedir}/data/PHEMlight/#" src/microsim/MSFrame.cpp |
| 69 | reinplace "s#\./PHEMlight/#${sharedir}/data/PHEMlight/#" src/router/ROFrame.cpp |
| 70 | reinplace -locale C "s#./PHEMlight/#${sharedir}/data/PHEMlight/#" src/tools/emissionsDrivingCycle_main.cpp |
| 71 | reinplace -locale C "s#./PHEMlight/#${sharedir}/data/PHEMlight/#" src/tools/emissionsMap_main.cpp |
| 72 | set python_bin ${frameworks_dir}/Python.framework/Versions/2.7/bin/python2.7 |
| 73 | foreach f $python_scripts { |
| 74 | reinplace "s#/usr/bin/env python#${python_bin}#" $f |
| 75 | reinplace -E "s|^(sys.path.append)|# \\1|" $f |
| 76 | reinplace -E "s#^from (dijkstra|inputs)#from assign.\\1#" $f |
| 77 | reinplace -E "s#^import (xsd|collectinghandler|connections|turndefinitions|rmsd)#from sumolib import \\1#" $f |
| 78 | reinplace -E "s#^import (os,.*), helpers#import \\1, sumolib.helpers as helpers#" $f |
| 79 | } |
| 80 | foreach f $perl_scripts { |
| 81 | reinplace "s#/usr/bin/perl#${perl_bin}#" $f |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | # List of all python scripts. Used later to ensure usage of python27 |
| 86 | # (instead of the currently active python) |
| 87 | set python_scripts [ list \ |
| 88 | tools/bin/traceExporter.py \ |
| 89 | tools/assign/Assignment.py \ |
| 90 | tools/assign/cadytsIterate.py \ |
| 91 | tools/assign/costFunctionChecker.py \ |
| 92 | tools/assign/duaIterate.py \ |
| 93 | tools/assign/duaIterate_analysis.py \ |
| 94 | tools/assign/matrixDailyToHourly.py \ |
| 95 | tools/assign/networkStatistics.py \ |
| 96 | tools/assign/one-shot.py \ |
| 97 | tools/assign/run.py \ |
| 98 | tools/detector/aggregateFlows.py \ |
| 99 | tools/detector/deleteUnusedDetectors.py \ |
| 100 | tools/detector/flowFromRoutes.py \ |
| 101 | tools/net/0103to0110.py \ |
| 102 | tools/net/0123to0130.py \ |
| 103 | tools/net/batch0103to0110.py \ |
| 104 | tools/net/createRoundaboutConnections.py \ |
| 105 | tools/net/netcheck.py \ |
| 106 | tools/net/netdiff.py \ |
| 107 | tools/net/netduplicate.py \ |
| 108 | tools/net/netextract.py \ |
| 109 | tools/net/netextract_subPart.py \ |
| 110 | tools/net/netmatch.py \ |
| 111 | tools/net/netshiftadaptor.py \ |
| 112 | tools/net/netstats.py \ |
| 113 | tools/net/network_statistics.py \ |
| 114 | tools/net/odConnectionsCheck.py \ |
| 115 | tools/net/OrderedMultiSet.py \ |
| 116 | tools/net/patchNetFiles.py \ |
| 117 | tools/net/prepareVISUM.py \ |
| 118 | tools/net/reprojectpolys.py \ |
| 119 | tools/net/visum_mapDistricts.py \ |
| 120 | tools/net/xmlconnections_mapEdges.py \ |
| 121 | tools/net/xmledges_applyOffset.py \ |
| 122 | tools/net/xmlnodes_applyOffset.py \ |
| 123 | tools/output/accelerations.py \ |
| 124 | tools/output/analyze_teleports.py \ |
| 125 | tools/output/generateITetrisIntersectionMetrics.py \ |
| 126 | tools/output/generateITetrisNetworkMetrics.py \ |
| 127 | tools/output/generateMeanDataDefinitions.py \ |
| 128 | tools/output/generateTLSE1Detectors.py \ |
| 129 | tools/output/generateTLSE2Detectors.py \ |
| 130 | tools/output/generateTLSE3Detectors.py \ |
| 131 | tools/output/netdumpdiff.py \ |
| 132 | tools/output/netdumpmean.py \ |
| 133 | tools/output/timingStats.py \ |
| 134 | tools/output/vehLanes.py \ |
| 135 | tools/output/vehrouteDiff.py \ |
| 136 | tools/route/cutRoutes.py \ |
| 137 | tools/route/extract_route_edges.py \ |
| 138 | tools/route/findUTurns.py \ |
| 139 | tools/route/kShortest.py \ |
| 140 | tools/route/route2alts.py \ |
| 141 | tools/route/route2poly.py \ |
| 142 | tools/route/route_1htoDay.py \ |
| 143 | tools/route/route_departOffset.py \ |
| 144 | tools/route/routecheck.py \ |
| 145 | tools/route/routecompare.py \ |
| 146 | tools/route/routes2OD.py \ |
| 147 | tools/route/routes_Join.py \ |
| 148 | tools/route/sort_routes.py \ |
| 149 | tools/route/tracegenerator.py \ |
| 150 | tools/route/tracemapper.py \ |
| 151 | tools/route/vehicle2flow.py \ |
| 152 | tools/shapes/circlePolygon.py \ |
| 153 | tools/shapes/CSV2polyconvertXML.py \ |
| 154 | tools/shapes/poi_alongRoads.py \ |
| 155 | tools/shapes/poi_atTLS.py \ |
| 156 | tools/shapes/pois2inductionLoops.py \ |
| 157 | tools/trigger/csv2vss.py \ |
| 158 | tools/trip/randomTrips.py \ |
| 159 | tools/trip/generateTripsXml.py \ |
| 160 | tools/trip/route2trips.py \ |
| 161 | tools/turn-defs/generateTurnDefs.py \ |
| 162 | tools/visualization/mpl_dump_onNet.py \ |
| 163 | tools/visualization/mpl_dump_timeline.py \ |
| 164 | tools/visualization/mpl_dump_twoAgainst.py \ |
| 165 | tools/visualization/mpl_tripinfos_twoAgainst.py \ |
| 166 | tools/visualization/plot_csv_bars.py \ |
| 167 | tools/visualization/plot_csv_pie.py \ |
| 168 | tools/visualization/plot_csv_timeline.py \ |
| 169 | tools/visualization/plot_net_dump.py \ |
| 170 | tools/visualization/plot_net_selection.py \ |
| 171 | tools/visualization/plot_net_speeds.py \ |
| 172 | tools/visualization/plot_net_trafficLights.py \ |
| 173 | tools/visualization/plot_summary.py \ |
| 174 | tools/visualization/plot_tripinfo_distributions.py \ |
| 175 | tools/xml/addSchema.py \ |
| 176 | tools/xml/binary2plain.py \ |
| 177 | tools/xml/csv2xml.py \ |
| 178 | tools/xml/protobuf2xml.py \ |
| 179 | tools/xml/rebuildSchemata.py \ |
| 180 | tools/xml/schemaCheck.py \ |
| 181 | tools/xml/xml2csv.py \ |
| 182 | tools/xml/xml2protobuf.py \ |
| 183 | tools/xml/xsd.py ] |
| 184 | |
| 185 | set perl_scripts [ list \ |
| 186 | tools/trip/removeGeometryInTrips.pl \ |
| 187 | tools/trip/removeTripsIfNotInInterval.pl \ |
| 188 | tools/trip/splitTripsByHours.pl ] |
| 223 | |
| 224 | post-destroot { |
| 225 | xinstall -m 755 -d ${destroot}${python_lib} |
| 226 | file copy ${worksrcpath}/tools/sumolib ${destroot}${python_lib}/ |
| 227 | if {![variant_isset no_traci]} { |
| 228 | file copy ${worksrcpath}/tools/traci ${destroot}${python_lib}/ |
| 229 | } |
| 230 | file copy ${worksrcpath}/tools/assign ${destroot}${python_lib}/sumolib/ |
| 231 | touch ${destroot}${python_lib}/sumolib/assign/__init__.py |
| 232 | file copy ${worksrcpath}/tools/turn-defs/connections.py ${destroot}${python_lib}/sumolib/ |
| 233 | file copy ${worksrcpath}/tools/turn-defs/turndefinitions.py ${destroot}${python_lib}/sumolib/ |
| 234 | # xinstall -m 755 -d ${destroot}${python_lib}/detector |
| 235 | xinstall -m 755 ${worksrcpath}/tools/detector/detector.py ${destroot}${python_lib}/sumolib/ |
| 236 | xinstall -m 755 ${worksrcpath}/tools/turn-defs/collectinghandler.py ${destroot}${python_lib}/sumolib/ |
| 237 | xinstall -m 755 ${worksrcpath}/tools/visualization/helpers.py ${destroot}${python_lib}/sumolib/ |
| 238 | xinstall -m 755 ${worksrcpath}/tools/lib/rmsd.py ${destroot}${python_lib}/sumolib/ |
| 239 | xinstall -m 755 ${worksrcpath}/tools/lib/play.png ${destroot}${python_lib}/sumolib/ |
| 240 | xinstall -m 755 ${worksrcpath}/tools/lib/stop.png ${destroot}${python_lib}/sumolib/ |
| 241 | xinstall -m 755 ${worksrcpath}/tools/lib/testUtil.py ${destroot}${python_lib}/sumolib/ |
| 242 | |
| 243 | foreach f [list {*}$python_scripts {*}$perl_scripts] { |
| 244 | # convert file names to use dash rather than underscore and remove trailing .py or .pl |
| 245 | set x [string map [list _ -] [file rootname [file tail ${f}]]] |
| 246 | xinstall -m 755 ${worksrcpath}/${f} ${destroot}${prefix}/bin/sumo-${x} |
| 247 | } |
| 248 | |
| 249 | xinstall -m 755 -d ${destroot}${sharedir} |
| 250 | foreach d [list emissions typemap xsd] { |
| 251 | file copy ${worksrcpath}/data/${d} ${destroot}${sharedir}/${d}/ |
| 252 | } |
| 253 | # tests/ is not included in the source tarball |
| 254 | # file copy ${worksrcpath}/tests ${destroot}${sharedir}/ |
| 255 | |
| 256 | xinstall -m 755 -d ${destroot}${docdir} |
| 257 | xinstall ${worksrcpath}/README ${destroot}${docdir}/ |
| 258 | # svn does not have a full set of docs |
| 259 | # file copy ${worksrcpath}/docs/examples ${destroot}${docdir}/ |
| 260 | # file copy ${worksrcpath}/docs/tutorial ${destroot}${docdir}/ |
| 261 | file copy ${worksrcpath}/data ${destroot}${sharedir}/data/ |
| 262 | } |