Ticket #43140: Portfile.diff

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

Patches to use svn head of tree per SUMO developer recommendations.

  • 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 112569 2013-10-26 17:10:56Z ryandesign@macports.org $
     2# $Id: Portfile 119083 2014-04-16 20:47:35Z macsforever2000@macports.org $
    33
    44PortSystem          1.0
    55
    66name                sumo-devel
    77conflicts           sumo
    8 svn.revision        8004
    9 version             0.11.1-r${svn.revision}
     8# svn.revision        8004
     9# version             0.21.0-r${svn.revision}
     10version             svn
    1011categories          science devel
    1112platforms           darwin
    1213maintainers         me.com:jens.fahnenbruck \
    1314                    herbiet.net:guillaume-jean
    14 license             GPL-2
     15license             GPL-3
    1516
    1617description         Development version of Simulation of Urban MObility (SUMO)
    1718long_description \
     
    2021    road networks. It is mainly developed by employees of the Institute of \
    2122    Transportation Systems at the German Aerospace Center.
    2223
    23 homepage            http://sumo.sourceforge.net/
     24homepage            http://sumo-sim.org/
    2425
    2526fetch.type          svn
    2627svn.method          checkout
     
    3637            lappend svn_item_list ${svn_item}
    3738        }
    3839    }
    39     set cmd "${svn.cmd} ${svn.pre_args} update -r ${svn.revision} --set-depth infinity [join ${svn_item_list} { }]"
     40    # set cmd "${svn.cmd} ${svn.pre_args} update -r ${svn.revision} --set-depth infinity [join ${svn_item_list} { }]"
     41    set cmd "${svn.cmd} ${svn.pre_args} update --set-depth infinity [join ${svn_item_list} { }]"
    4042    ui_debug ${cmd}
    4143    system -W ${worksrcpath} ${cmd}
    4244}
    4345
     46use_autoreconf     yes
     47
    4448depends_lib-append \
    4549    port:fox \
    4650    port:gdal \
     
    4852    port:proj \
    4953    port:xercesc
    5054
    51 use_autoreconf     yes
     55# py27-matplotlib requires perl so let it choose which version
     56depends_lib-append \
     57    port:python27 \
     58    port:py27-matplotlib
     59
     60set sharedir          ${prefix}/share/${name}
     61set docdir            ${prefix}/share/doc/${name}
     62set python_bin        ${frameworks_dir}/Python.framework/Versions/2.7/bin/python2.7
     63set python_lib        ${frameworks_dir}/Python.framework/Versions/2.7/lib/python2.7/site-packages
     64set perl_bin          "/usr/bin/env perl"
     65
     66post-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)
     87set 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
     185set perl_scripts [ list \
     186    tools/trip/removeGeometryInTrips.pl \
     187    tools/trip/removeTripsIfNotInInterval.pl \
     188    tools/trip/splitTripsByHours.pl ]
    52189
    53190# required for the gui to be enabled
    54191configure.args-append \
     
    83220    configure.args-append \
    84221        --disable-traci
    85222}
     223
     224post-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}