Ignore:
Timestamp:
Aug 15, 2011, 4:00:04 PM (8 years ago)
Author:
ryandesign@…
Message:

app-1.0.tcl: use variable tracing magic to automatically add makeicns build dependency if needed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/_resources/port1.0/group/app-1.0.tcl

    r82536 r82546  
    253253}
    254254
    255 # TODO: automatically add depends_build-append port:makeicns
     255
     256# Trace writes to app.icon and add or remove makeicns dependency as necessary.
     257trace variable app.icon w app._icon_trace
     258
     259proc app._icon_trace {optionName unusedIndex unusedOperation} {
     260    global depends_build
     261    upvar ${optionName} option
     262    set has_dep [expr {[lsearch ${depends_build} port:makeicns] != -1}]
     263    set needs_dep [expr {[file extension ${option}] != ".icns"}]
     264    if {${has_dep} && !${needs_dep}} {
     265        depends_build-delete port:makeicns
     266    } elseif {${needs_dep} && !${has_dep}} {
     267        depends_build-append port:makeicns
     268    }
     269}
     270
     271
    256272# TODO: for Tiger we probably need our own lreverse implementation e.g. http://wiki.tcl.tk/17188
Note: See TracChangeset for help on using the changeset viewer.