Ticket #44338: Portfile.diff

File Portfile.diff, 5.3 KB (added by lockhart (Thomas Lockhart), 10 years ago)

Patches to add missing python scripts and modify import lines.

  • Portfile

    old new  
    66name                sumo
    77conflicts           sumo-devel
    88version             0.21.0
     9revision            1
    910categories          science devel
    1011platforms           darwin
    1112maintainers         me.com:jens.fahnenbruck \
     
    5354    reinplace -locale C "s#./PHEMlight/#${sharedir}/data/PHEMlight/#" src/tools/emissionsDrivingCycle_main.cpp
    5455    reinplace -locale C "s#./PHEMlight/#${sharedir}/data/PHEMlight/#" src/tools/emissionsMap_main.cpp
    5556    set python_bin ${frameworks_dir}/Python.framework/Versions/2.7/bin/python2.7
    56     foreach f $python_scripts {
     57    foreach f [list {*}$python_scripts {*}$python_libs {*}$python_tutorials] {
    5758        reinplace "s#/usr/bin/env python#${python_bin}#" $f
    5859        reinplace -E "s|^(sys.path.append)|# \\1|" $f
    59         reinplace -E "s#^from (dijkstra|inputs)#from assign.\\1#" $f
     60        reinplace -E "s#^ *from (assign|costMemory|dijkstra|duaIterate|elements|inputs|network|outputs|routeChoices|statisticsElements|tables)#from sumolib.assign.\\1#" $f
     61        reinplace -E "s#^ *from (miscutils|OrderedMultiSet|output|testUtil)#from sumolib.\\1#" $f
    6062        reinplace -E "s#^import (xsd|collectinghandler|connections|turndefinitions|rmsd)#from sumolib import \\1#" $f
    6163        reinplace -E "s#^import (os,.*), helpers#import \\1, sumolib.helpers as helpers#" $f
    6264    }
    6365    foreach f $perl_scripts {
    6466        reinplace "s#/usr/bin/perl#${perl_bin}#" $f
    6567    }
     68    reinplace -E "s#(removeTripsIfNotInInterval).pl#sumo-\\1#" tools/trip/splitTripsByHours.pl
    6669}
    6770
    6871# List of all python scripts. Used later to ensure usage of python27
    6972# (instead of the currently active python)
    70 set python_scripts [ list \
    71     tools/bin/traceExporter.py \
     73set python_scripts [list \
    7274    tools/assign/Assignment.py \
    7375    tools/assign/cadytsIterate.py \
    7476    tools/assign/costFunctionChecker.py \
     
    7779    tools/assign/matrixDailyToHourly.py \
    7880    tools/assign/networkStatistics.py \
    7981    tools/assign/one-shot.py \
    80     tools/assign/run.py \
     82    tools/bin/traceExporter.py \
    8183    tools/detector/aggregateFlows.py \
    8284    tools/detector/deleteUnusedDetectors.py \
    8385    tools/detector/flowFromRoutes.py \
     86    tools/detector/flowrouter.py \
    8487    tools/net/0103to0110.py \
    8588    tools/net/0123to0130.py \
    8689    tools/net/batch0103to0110.py \
     
    9194    tools/net/netextract.py \
    9295    tools/net/netextract_subPart.py \
    9396    tools/net/netmatch.py \
    94     tools/net/netshiftadaptor.py \
    9597    tools/net/netstats.py \
    9698    tools/net/network_statistics.py \
    9799    tools/net/odConnectionsCheck.py \
    98     tools/net/OrderedMultiSet.py \
    99100    tools/net/patchNetFiles.py \
    100101    tools/net/prepareVISUM.py \
    101102    tools/net/reprojectpolys.py \
     
    115116    tools/output/netdumpmean.py \
    116117    tools/output/timingStats.py \
    117118    tools/output/vehLanes.py \
     119    tools/output/vehroute2amitranOD.py \
    118120    tools/output/vehrouteDiff.py \
    119121    tools/route/cutRoutes.py \
    120122    tools/route/extract_route_edges.py \
     
    137139    tools/shapes/poi_alongRoads.py \
    138140    tools/shapes/poi_atTLS.py \
    139141    tools/shapes/pois2inductionLoops.py \
     142    tools/tls/tls_check.py \
     143    tools/tls/tls_csv2SUMO.py \
     144    tools/traci/rebuildConstants.py \
     145    tools/traci/traciToHex.py \
    140146    tools/trigger/csv2vss.py \
    141147    tools/trip/randomTrips.py \
    142148    tools/trip/generateTripsXml.py \
     
    163169    tools/xml/schemaCheck.py \
    164170    tools/xml/xml2csv.py \
    165171    tools/xml/xml2protobuf.py \
    166     tools/xml/xsd.py ]
     172]
     173
     174set python_libs [list \
     175    tools/assign/assign.py \
     176    tools/assign/costMemory.py \
     177    tools/assign/dijkstra.py \
     178    tools/assign/elements.py \
     179    tools/assign/inputs.py \
     180    tools/assign/network.py \
     181    tools/assign/outputs.py \
     182    tools/assign/run.py \
     183    tools/assign/statisticsElements.py \
     184    tools/assign/tables.py \
     185    tools/net/netshiftadaptor.py \
     186    tools/net/OrderedMultiSet.py \
     187    tools/sumolib/geomhelper.py \
     188    tools/trigger/csv2vss.py \
     189    tools/turn-defs/connections.py \
     190    tools/turn-defs/turndefinitions.py \
     191    tools/xml/xml2csv.py \
     192    tools/xml/xsd.py \
     193]
    167194
    168 set perl_scripts [ list \
     195set python_tutorials [list \
     196    docs/tutorial/city_mobil/constants.py \
     197    docs/tutorial/city_mobil/statistics.py \
     198    docs/tutorial/hello/runner.py \
     199    docs/tutorial/output_parsing/runner.py \
     200    docs/tutorial/quickstart/runner.py \
     201    docs/tutorial/san_pablo_dam/runner.py \
     202    docs/tutorial/traci_tls/runner.py \
     203]
     204
     205set perl_scripts [list \
    169206    tools/trip/removeGeometryInTrips.pl \
    170207    tools/trip/removeTripsIfNotInInterval.pl \
    171     tools/trip/splitTripsByHours.pl ]
     208    tools/trip/splitTripsByHours.pl \
     209]
    172210
    173211# required for the gui to be enabled
    174212configure.args-append \
     
    223261    xinstall -m 755 ${worksrcpath}/tools/lib/stop.png ${destroot}${python_lib}/sumolib/
    224262    xinstall -m 755 ${worksrcpath}/tools/lib/testUtil.py ${destroot}${python_lib}/sumolib/
    225263
     264    foreach f $python_libs {
     265        xinstall -m 755 ${worksrcpath}/${f} ${destroot}${python_lib}/sumolib/
     266    }
     267
    226268    foreach f [list {*}$python_scripts {*}$perl_scripts] {
    227269        # convert file names to use dash rather than underscore and remove trailing .py or .pl
    228270        set x [string map [list _ -] [file rootname [file tail ${f}]]]