Ticket #49397: Portfile.diff
File Portfile.diff, 5.9 KB (added by lockhart (Thomas Lockhart), 9 years ago) |
---|
-
Portfile
old new 5 5 6 6 name sumo 7 7 version 0.24.0 8 revision 18 revision 2 9 9 categories science devel 10 10 platforms darwin 11 11 maintainers nomaintainer … … 27 27 checksums rmd160 712b8fc05dcc230940abe4d897357bb49d418e00 \ 28 28 sha256 b9fe97bdd0981098b3136456954b6ece718e5efb6a782b0f98f519ccf28a8429 29 29 30 default_variants +subseconds +messages 31 30 32 depends_lib-append \ 31 33 port:fox \ 32 34 port:gdal \ … … 40 42 port:py27-matplotlib \ 41 43 port:py27-protobuf 42 44 45 set bindir ${prefix}/bin 46 set libdir ${prefix}/lib 43 47 set sharedir ${prefix}/share/${name} 44 48 set docdir ${prefix}/share/doc/${name} 45 49 set python_bin ${frameworks_dir}/Python.framework/Versions/2.7/bin/python2.7 46 50 set python_lib ${frameworks_dir}/Python.framework/Versions/2.7/lib/python2.7/site-packages 47 51 52 post-extract { 53 copy ${filespath}/README.macosx ${worksrcpath}/ 54 } 55 48 56 post-patch { 49 57 reinplace "s#std::getenv(\"SUMO_HOME\")#\"${sharedir}\"#" src/utils/xml/SUMOSAXReader.cpp 50 58 reinplace "s#\./PHEMlight/#${sharedir}/data/PHEMlight/#" src/microsim/MSFrame.cpp … … 54 62 set python_bin ${frameworks_dir}/Python.framework/Versions/2.7/bin/python2.7 55 63 foreach f [list {*}$python_scripts {*}$python_libs {*}$python_tutorials] { 56 64 reinplace "s#/usr/bin/env python#${python_bin}#" $f 57 reinplace -E "s|^(sys.path.append)|# \\1|" $f 65 reinplace -E "s|^( *)(sys.path.append)|\\1# \\2|" $f 66 reinplace -E "s|^( *)(.*__file__.*\\.\\.)|\\1# \\2|" $f 67 reinplace -E "s|^( *)(os.path.join.*\\.\\.)|\\1# \\2|" $f 68 reinplace -E "s|^( *)(SUMO_HOME =)|\\1 # \\2|" $f 69 reinplace -E "s|^(if .*SUMO_HOME)|if True: # \\1|" $f 70 reinplace -E "s|^( +)(.*os.path.join.*SUMO_HOME)|\\1# \\2|" $f 58 71 reinplace -E "s#^( *)from (assign|costMemory|dijkstra|duaIterate|elements|inputs|network|outputs|routeChoices|statisticsElements|tables)#\\1from sumolib.assign.\\2#" $f 59 72 reinplace -E "s#^( *)from (miscutils|OrderedMultiSet|output|testUtil)#\\1from sumolib.\\2#" $f 60 reinplace -E "s#^import ( xsd|xml2csv|collectinghandler|connections|netshiftadaptor|route_departOffset|turndefinitions|rmsd|xml2protobuf)#from sumolib import \\1#" $f73 reinplace -E "s#^import (detector|route2trips|xsd|xml2csv|collectinghandler|connections|netshiftadaptor|route_departOffset|sort_routes|turndefinitions|rmsd|xml2protobuf)#from sumolib import \\1#" $f 61 74 reinplace -E "s#^import (os,.*), helpers#import \\1, sumolib.helpers as helpers#" $f 62 75 } 76 reinplace -E "s#@BINDIR@#${bindir}#" README.macosx 77 reinplace -E "s#@LIBDIR@#${libdir}#" README.macosx 78 reinplace -E "s#@DOCDIR@#${docdir}#" README.macosx 79 reinplace -E "s#@PYTHON_LIBDIR@#${python_lib}#" README.macosx 63 80 } 64 81 65 82 # List of all python scripts. Used later to ensure usage of python27 66 83 # (instead of the currently active python) 84 # available in the next release: 85 # tools/tlsCoordinator.py 67 86 set python_scripts [list \ 87 tools/districts2poly.py \ 88 tools/edgesInDistricts.py \ 89 tools/generateBidiDistricts.py \ 90 tools/pedestrianFlow.py \ 91 tools/randomTrips.py \ 92 tools/route2trips.py \ 93 tools/route2sel.py \ 94 tools/traceExporter.py \ 68 95 tools/assign/Assignment.py \ 69 96 tools/assign/cadytsIterate.py \ 70 97 tools/assign/costFunctionChecker.py \ … … 156 183 tools/visualization/plot_net_trafficLights.py \ 157 184 tools/visualization/plot_summary.py \ 158 185 tools/visualization/plot_tripinfo_distributions.py \ 159 tools/xml/addSchema.py \160 186 tools/xml/binary2plain.py \ 161 187 tools/xml/csv2xml.py \ 162 188 tools/xml/protobuf2xml.py \ … … 165 191 tools/xml/xml2csv.py \ 166 192 tools/xml/xml2protobuf.py \ 167 193 ] 194 # not needed for an installation: 195 # tools/xml/addSchema.py 168 196 169 197 set python_libs [list \ 198 tools/route2trips.py \ 170 199 tools/assign/assign.py \ 171 200 tools/assign/costMemory.py \ 172 201 tools/assign/dijkstra.py \ … … 244 273 file copy ${worksrcpath}/tools/turn-defs/connections.py ${destroot}${python_lib}/sumolib/ 245 274 file copy ${worksrcpath}/tools/turn-defs/turndefinitions.py ${destroot}${python_lib}/sumolib/ 246 275 xinstall -m 755 ${worksrcpath}/tools/detector/detector.py ${destroot}${python_lib}/sumolib/ 276 xinstall -m 755 ${worksrcpath}/tools/route/sort_routes.py ${destroot}${python_lib}/sumolib/ 247 277 xinstall -m 755 ${worksrcpath}/tools/turn-defs/collectinghandler.py ${destroot}${python_lib}/sumolib/ 248 278 xinstall -m 755 ${worksrcpath}/tools/lib/rmsd.py ${destroot}${python_lib}/sumolib/ 249 279 xinstall -m 755 ${worksrcpath}/tools/lib/play.png ${destroot}${python_lib}/sumolib/ … … 257 287 foreach f [list {*}$python_scripts] { 258 288 # convert file names to use dash rather than underscore and remove trailing .py or .pl 259 289 set x [string map [list _ -] [file rootname [file tail ${f}]]] 260 xinstall -m 755 ${worksrcpath}/${f} ${destroot}${ prefix}/bin/sumo-${x}290 xinstall -m 755 ${worksrcpath}/${f} ${destroot}${bindir}/sumo-${x} 261 291 } 262 292 263 293 xinstall -m 755 -d ${destroot}${sharedir} … … 268 298 # file copy ${worksrcpath}/tests ${destroot}${sharedir}/ 269 299 270 300 xinstall -m 755 -d ${destroot}${docdir} 271 xinstall ${worksrcpath}/README ${destroot}${docdir}/ 301 file copy ${worksrcpath}/README ${destroot}${docdir}/ 302 file copy ${worksrcpath}/README.macosx ${destroot}${docdir}/ 272 303 file copy ${worksrcpath}/docs/examples ${destroot}${docdir}/ 273 304 file copy ${worksrcpath}/docs/tutorial ${destroot}${docdir}/ 274 305 file copy ${worksrcpath}/data ${destroot}${sharedir}/data/ 275 306 } 276 307 308 post-install { 309 ui_msg "" 310 ui_msg "*** Many program names are prefixed by sumo- for this port." 311 ui_msg "*** See ${docdir}/README.macosx for additional notes." 312 ui_msg "" 313 } 314 277 315 livecheck.regex ${name}-src-(\[0-9.\]+)${extract.suffix}