Ticket #44015: Portfile.diff

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

Full patch including changes in #43544

  • Portfile

    old new  
    11# -*- 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
    2 # $Id: Portfile 119599 2014-05-02 07:55:38Z ryandesign@macports.org $
     2# $Id: Portfile 119083 2014-04-16 20:47:35Z macsforever2000@macports.org $
    33
    44PortSystem          1.0
    55
    66name                sumo
    77conflicts           sumo-devel
    8 version             0.20.0
     8version             0.21.0
    99categories          science devel
    1010platforms           darwin
    1111maintainers         me.com:jens.fahnenbruck \
     
    2525distname            ${name}-src-${version}
    2626worksrcdir          ${name}-${version}
    2727
    28 checksums           rmd160  28be6fa3d9aac3b92e3a04fd2f7ffcdd8a281179 \
    29                     sha256  5728955cbcc2daf7b751c2274f4dd0f0f9459fd940e69ce6e07a2ee09d00e254
     28checksums           rmd160  acd3bbae2d2cbe1d03c57c5b7f42f4b464fa5fc5 \
     29                    sha256  51be256e6f104b450361e8809535cb93df8e2a942cfbe2f1ea5031f13590d215
    3030
    3131depends_lib-append \
    3232    port:fox \
     
    3535    port:proj \
    3636    port:xercesc
    3737
     38# py27-matplotlib requires perl so let it choose which version
     39depends_lib-append \
     40    port:python27 \
     41    port:py27-matplotlib
     42
     43set sharedir          ${prefix}/share/${name}
     44set docdir            ${prefix}/share/doc/${name}
     45set python_bin        ${frameworks_dir}/Python.framework/Versions/2.7/bin/python2.7
     46set python_lib        ${frameworks_dir}/Python.framework/Versions/2.7/lib/python2.7/site-packages
     47set perl_bin          "/usr/bin/env perl"
     48
     49post-patch {
     50    reinplace "s#std::getenv(\"SUMO_HOME\")#\"${sharedir}\"#" src/utils/xml/SUMOSAXReader.cpp
     51    reinplace "s#\./PHEMlight/#${sharedir}/data/PHEMlight/#" src/microsim/MSFrame.cpp
     52    reinplace "s#\./PHEMlight/#${sharedir}/data/PHEMlight/#" src/router/ROFrame.cpp
     53    reinplace -locale C "s#./PHEMlight/#${sharedir}/data/PHEMlight/#" src/tools/emissionsDrivingCycle_main.cpp
     54    reinplace -locale C "s#./PHEMlight/#${sharedir}/data/PHEMlight/#" src/tools/emissionsMap_main.cpp
     55    set python_bin ${frameworks_dir}/Python.framework/Versions/2.7/bin/python2.7
     56    foreach f $python_scripts {
     57        reinplace "s#/usr/bin/env python#${python_bin}#" $f
     58        reinplace -E "s|^(sys.path.append)|# \\1|" $f
     59        reinplace -E "s#^from (dijkstra|inputs)#from assign.\\1#" $f
     60        reinplace -E "s#^import (xsd|collectinghandler|connections|turndefinitions|rmsd)#from sumolib import \\1#" $f
     61        reinplace -E "s#^import (os,.*), helpers#import \\1, sumolib.helpers as helpers#" $f
     62    }
     63    foreach f $perl_scripts {
     64        reinplace "s#/usr/bin/perl#${perl_bin}#" $f
     65    }
     66}
     67
     68# List of all python scripts. Used later to ensure usage of python27
     69# (instead of the currently active python)
     70set python_scripts [ list \
     71    tools/bin/traceExporter.py \
     72    tools/assign/Assignment.py \
     73    tools/assign/cadytsIterate.py \
     74    tools/assign/costFunctionChecker.py \
     75    tools/assign/duaIterate.py \
     76    tools/assign/duaIterate_analysis.py \
     77    tools/assign/matrixDailyToHourly.py \
     78    tools/assign/networkStatistics.py \
     79    tools/assign/one-shot.py \
     80    tools/assign/run.py \
     81    tools/detector/aggregateFlows.py \
     82    tools/detector/deleteUnusedDetectors.py \
     83    tools/detector/flowFromRoutes.py \
     84    tools/net/0103to0110.py \
     85    tools/net/0123to0130.py \
     86    tools/net/batch0103to0110.py \
     87    tools/net/createRoundaboutConnections.py \
     88    tools/net/netcheck.py \
     89    tools/net/netdiff.py \
     90    tools/net/netduplicate.py \
     91    tools/net/netextract.py \
     92    tools/net/netextract_subPart.py \
     93    tools/net/netmatch.py \
     94    tools/net/netshiftadaptor.py \
     95    tools/net/netstats.py \
     96    tools/net/network_statistics.py \
     97    tools/net/odConnectionsCheck.py \
     98    tools/net/OrderedMultiSet.py \
     99    tools/net/patchNetFiles.py \
     100    tools/net/prepareVISUM.py \
     101    tools/net/reprojectpolys.py \
     102    tools/net/visum_mapDistricts.py \
     103    tools/net/xmlconnections_mapEdges.py \
     104    tools/net/xmledges_applyOffset.py \
     105    tools/net/xmlnodes_applyOffset.py \
     106    tools/output/accelerations.py \
     107    tools/output/analyze_teleports.py \
     108    tools/output/generateITetrisIntersectionMetrics.py \
     109    tools/output/generateITetrisNetworkMetrics.py \
     110    tools/output/generateMeanDataDefinitions.py \
     111    tools/output/generateTLSE1Detectors.py \
     112    tools/output/generateTLSE2Detectors.py \
     113    tools/output/generateTLSE3Detectors.py \
     114    tools/output/netdumpdiff.py \
     115    tools/output/netdumpmean.py \
     116    tools/output/timingStats.py \
     117    tools/output/vehLanes.py \
     118    tools/output/vehrouteDiff.py \
     119    tools/route/cutRoutes.py \
     120    tools/route/extract_route_edges.py \
     121    tools/route/findUTurns.py \
     122    tools/route/kShortest.py \
     123    tools/route/route2alts.py \
     124    tools/route/route2poly.py \
     125    tools/route/route_1htoDay.py \
     126    tools/route/route_departOffset.py \
     127    tools/route/routecheck.py \
     128    tools/route/routecompare.py \
     129    tools/route/routes2OD.py \
     130    tools/route/routes_Join.py \
     131    tools/route/sort_routes.py \
     132    tools/route/tracegenerator.py \
     133    tools/route/tracemapper.py \
     134    tools/route/vehicle2flow.py \
     135    tools/shapes/circlePolygon.py \
     136    tools/shapes/CSV2polyconvertXML.py \
     137    tools/shapes/poi_alongRoads.py \
     138    tools/shapes/poi_atTLS.py \
     139    tools/shapes/pois2inductionLoops.py \
     140    tools/trigger/csv2vss.py \
     141    tools/trip/randomTrips.py \
     142    tools/trip/generateTripsXml.py \
     143    tools/trip/route2trips.py \
     144    tools/turn-defs/generateTurnDefs.py \
     145    tools/visualization/mpl_dump_onNet.py \
     146    tools/visualization/mpl_dump_timeline.py \
     147    tools/visualization/mpl_dump_twoAgainst.py \
     148    tools/visualization/mpl_tripinfos_twoAgainst.py \
     149    tools/visualization/plot_csv_bars.py \
     150    tools/visualization/plot_csv_pie.py \
     151    tools/visualization/plot_csv_timeline.py \
     152    tools/visualization/plot_net_dump.py \
     153    tools/visualization/plot_net_selection.py \
     154    tools/visualization/plot_net_speeds.py \
     155    tools/visualization/plot_net_trafficLights.py \
     156    tools/visualization/plot_summary.py \
     157    tools/visualization/plot_tripinfo_distributions.py \
     158    tools/xml/addSchema.py \
     159    tools/xml/binary2plain.py \
     160    tools/xml/csv2xml.py \
     161    tools/xml/protobuf2xml.py \
     162    tools/xml/rebuildSchemata.py \
     163    tools/xml/schemaCheck.py \
     164    tools/xml/xml2csv.py \
     165    tools/xml/xml2protobuf.py \
     166    tools/xml/xsd.py ]
     167
     168set perl_scripts [ list \
     169    tools/trip/removeGeometryInTrips.pl \
     170    tools/trip/removeTripsIfNotInInterval.pl \
     171    tools/trip/splitTripsByHours.pl ]
     172
    38173# required for the gui to be enabled
    39174configure.args-append \
    40175    --with-fox=${prefix}
     
    69204        --disable-traci
    70205}
    71206
    72 livecheck.regex     /${name}-all-(\[0-9.\]+)${extract.suffix}
     207post-destroot {
     208    xinstall -m 755 -d ${destroot}${python_lib}
     209    file copy ${worksrcpath}/tools/sumolib ${destroot}${python_lib}/
     210    if {![variant_isset no_traci]} {
     211        file copy ${worksrcpath}/tools/traci ${destroot}${python_lib}/
     212    }
     213    file copy ${worksrcpath}/tools/assign ${destroot}${python_lib}/sumolib/
     214    touch ${destroot}${python_lib}/sumolib/assign/__init__.py
     215    file copy ${worksrcpath}/tools/turn-defs/connections.py ${destroot}${python_lib}/sumolib/
     216    file copy ${worksrcpath}/tools/turn-defs/turndefinitions.py ${destroot}${python_lib}/sumolib/
     217    # xinstall -m 755 -d ${destroot}${python_lib}/detector
     218    xinstall -m 755 ${worksrcpath}/tools/detector/detector.py ${destroot}${python_lib}/sumolib/
     219    xinstall -m 755 ${worksrcpath}/tools/turn-defs/collectinghandler.py ${destroot}${python_lib}/sumolib/
     220    xinstall -m 755 ${worksrcpath}/tools/visualization/helpers.py ${destroot}${python_lib}/sumolib/
     221    xinstall -m 755 ${worksrcpath}/tools/lib/rmsd.py ${destroot}${python_lib}/sumolib/
     222    xinstall -m 755 ${worksrcpath}/tools/lib/play.png ${destroot}${python_lib}/sumolib/
     223    xinstall -m 755 ${worksrcpath}/tools/lib/stop.png ${destroot}${python_lib}/sumolib/
     224    xinstall -m 755 ${worksrcpath}/tools/lib/testUtil.py ${destroot}${python_lib}/sumolib/
     225
     226    foreach f [list {*}$python_scripts {*}$perl_scripts] {
     227        # convert file names to use dash rather than underscore and remove trailing .py or .pl
     228        set x [string map [list _ -] [file rootname [file tail ${f}]]]
     229        xinstall -m 755 ${worksrcpath}/${f} ${destroot}${prefix}/bin/sumo-${x}
     230    }
     231
     232    xinstall -m 755 -d ${destroot}${sharedir}
     233    foreach d [list emissions typemap xsd] {
     234        file copy ${worksrcpath}/data/${d} ${destroot}${sharedir}/${d}/
     235    }
     236    # tests/ is not included in the source tarball
     237    # file copy ${worksrcpath}/tests ${destroot}${sharedir}/
     238
     239    xinstall -m 755 -d ${destroot}${docdir}
     240    xinstall ${worksrcpath}/README ${destroot}${docdir}/
     241    file copy ${worksrcpath}/docs/examples ${destroot}${docdir}/
     242    file copy ${worksrcpath}/docs/tutorial ${destroot}${docdir}/
     243    file copy ${worksrcpath}/data ${destroot}${sharedir}/data/
     244}