-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Portfile
326 lines (296 loc) · 12.7 KB
/
Portfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
# -*- 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
PortSystem 1.0
name sumo
version 0.32.0
revision 2
categories science devel
platforms darwin
maintainers {gmail.com:tlockhart1976 @lockhart} 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 a52574c70170f93b80dafb115a0d1a4892c5f48b \
sha256 00753ca57a9911f0c99202505a6b05b1777168134842d7924fd827766642608a
default_variants +subseconds +messages
depends_build path:libexec/coreutils/libstdbuf.so:coreutils
depends_lib-append \
port:fox \
port:gdal \
port:libtool \
port:proj4 \
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 -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/extractTest.py \
tools/generateBidiDistricts.py \
tools/osmBuild.py \
tools/osmGet.py \
tools/osmWebWizard.py \
tools/pedestrianFlow.py \
tools/randomTrips.py \
tools/route2sel.py \
tools/route2trips.py \
tools/showDepartsAndArrivalsPerEdge.py \
tools/tlsCoordinator.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/flowFromRoutes.py \
tools/detector/flowrouter.py \
tools/detector/validate.py \
tools/district/countConnectionsInDistricts.py \
tools/district/districtMapper.py \
tools/import/osm/osmPopulationExtractor.py \
tools/import/vissim/convert_detectors2SUMO.py \
tools/import/vissim/convert_vissimXML_flows_statRoutes.py \
tools/import/vissim/tls_vissimXML2SUMOnet_update.py \
tools/import/vissim/vissim_parseBusStops.py \
tools/import/vissim/vissim_parseRoutes.py \
tools/import/visum/visum_convertEdgeTypes.py \
tools/import/visum/visum_convertRoutes.py \
tools/import/visum/visum_convertTurnPercentages.py \
tools/import/visum/visum_parseZaehlstelle.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/implausibleRoutes.py \
tools/route/route2alts.py \
tools/route/route2poly.py \
tools/route/routeStats.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.md ${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}