<pre style='margin:0'>
Eric Le Lay (elelay) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/f7dc431f3d7a5012fd0f59ae07d2a929f9008e00">https://github.com/macports/macports-ports/commit/f7dc431f3d7a5012fd0f59ae07d2a929f9008e00</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit f7dc431f3d7a5012fd0f59ae07d2a929f9008e00
</span>Author: Eric Le Lay <elelay@macports.org>
AuthorDate: Sun Jun 25 16:47:42 2017 +0200
<span style='display:block; white-space:pre;color:#404040;'> app portgroup support SVG app.icon
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Closes: https://trac.macports.org/ticket/40109
</span>---
_resources/port1.0/group/app-1.0.tcl | 31 +++++++++++++++++++++++++------
1 file changed, 25 insertions(+), 6 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/_resources/port1.0/group/app-1.0.tcl b/_resources/port1.0/group/app-1.0.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 4587ff5..6f1982c 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/_resources/port1.0/group/app-1.0.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/_resources/port1.0/group/app-1.0.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -86,8 +86,10 @@ default app.executable {${name}}
</span> # The default is empty; if no icon graphic is available for this software, this
# is fine. You can supply the path to an existing .icns file, or the path to a
# .png or other graphic file that the makeicns program can convert. A build
<span style='display:block; white-space:pre;background:#ffe0e0;'>-# dependency on makeicns will be automatically added if needed. Paths may
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-# absolute or relative to ${worksrcpath}.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# dependency on makeicns will be automatically added if needed. You can also
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# supply the path to a .svg file and it will be rasterized to the different icon
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# formats. A build dependency on librsvg will be automatically added if needed.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Paths may be absolute or relative to ${worksrcpath}.
</span> #
# Relates to Info.plist key CFBundleIconFile.
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -183,9 +185,23 @@ platform macosx {
</span> if {[file extension ${icon}] == ".icns"} {
xinstall -m 644 ${icon} ${destroot}${applications_dir}/${app.name}.app/Contents/Resources/${app.name}.icns
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ # If app.icon is svg, rasterize and convert it.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } elseif {[file extension ${icon}] == ".svg"} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set makeicnsargs {}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach w {16 32 128 256 512} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ lappend makeicnsargs -$w ${worksrcpath}/${w}.png
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[catch {system -W ${worksrcpath} "${prefix}/bin/rsvg-convert -w $w -h $w ${icon} > ${worksrcpath}/$w.png" }]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return -code error "app.icon ${app.icon} could not be converted to png: $::errorInfo"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[catch {system -W ${worksrcpath} "${prefix}/bin/makeicns $makeicnsargs -out ${destroot}${applications_dir}/${app.name}.app/Contents/Resources/${app.name}.icns 2>@1"}]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return -code error "app.icns could not be created: $::errorInfo"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> # If app.icon is another type of image file, convert it.
} else {
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[catch {exec ${prefix}/bin/makeicns -in ${icon} -out ${destroot}${applications_dir}/${app.name}.app/Contents/Resources/${app.name}.icns 2>@1}]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[catch {system -W ${worksrcpath} "${prefix}/bin/makeicns -in ${icon} -out ${destroot}${applications_dir}/${app.name}.app/Contents/Resources/${app.name}.icns 2>@1"}]} {
</span> return -code error "app.icon ${app.icon} could not be converted to ${app.name}.icns: $::errorInfo"
}
}
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -266,13 +282,16 @@ trace variable app.icon w app._icon_trace
</span> proc app._icon_trace {optionName unusedIndex unusedOperation} {
global depends_build
upvar ${optionName} option
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set has_dep [expr {[info exists depends_build] ? [lsearch ${depends_build} port:makeicns] != -1 : 0}]
</span> set needs_dep [expr {[file extension ${option}] != ".icns"}]
<span style='display:block; white-space:pre;background:#ffe0e0;'>- if {${has_dep} && !${needs_dep}} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {${needs_dep}} {
</span> depends_build-delete port:makeicns
<span style='display:block; white-space:pre;background:#ffe0e0;'>- } elseif {${needs_dep} && !${has_dep}} {
</span> depends_build-append port:makeicns
}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+ set needs_dep [expr {[file extension ${option}] == ".svg"}]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {${needs_dep}} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ depends_build-delete port:librsvg
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ depends_build-append port:librsvg
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span> }
</pre><pre style='margin:0'>
</pre>