Skip to content

Commit

Permalink
octave*: use libRSVG to generate icons
Browse files Browse the repository at this point in the history
ImageMagick can not properly convert Octave SVG file to PNG.
See http://savannah.gnu.org/bugs/?37062#comment26
  • Loading branch information
MarcusCalhoun-Lopez committed Jul 25, 2017
1 parent 77e4aee commit 0f27393
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 24 deletions.
21 changes: 8 additions & 13 deletions math/octave-devel/Portfile
Expand Up @@ -29,7 +29,7 @@ set version_tip 4.2.0-rc4

if { ${name} eq ${subport} } {
version ${version_tip}
revision 2
revision 3
hg.tag e078f5607762

# see http://savannah.gnu.org/bugs/?48773
Expand All @@ -46,7 +46,7 @@ if { ${name} eq ${subport} } {

subport octave-devel-rc {
version ${version_rc}
revision 3
revision 4
hg.tag 69ac19073ae6

if {${version_rc} eq ${version_release}} {
Expand All @@ -67,7 +67,7 @@ subport octave-devel-rc {

subport octave-devel-release {
version ${version_release}
revision 3
revision 4
hg.tag 00f7b278defd

if {${version_release} eq ${version_rc}} {
Expand Down Expand Up @@ -502,7 +502,7 @@ variant sound description {enable audio support (file I/O and playback)} {
default_variants-append +sound

variant app description "build application bundle to launch ${subport}" {
depends_build-append port:ImageMagick
depends_build-append port:librsvg

if {[vercmp ${xcodeversion} 4.5] < 0} {
# need a way to generate icns file for XCode prior to 4.5
Expand Down Expand Up @@ -572,15 +572,10 @@ variant app description "build application bundle to launch ${subport}" {

set hres [expr 2*${res}]

# find new density so that converted PNG files do not look pixelated
set denw [expr ${dpi}*${res}/${width}]
set denh [expr ${dpi}*${res}/${height}]

set hdenw [expr 2*${denw}]
set hdenh [expr 2*${denh}]

system -W ${worksrcpath} "${prefix}/bin/convert -background transparent -resize ${res}x${res} -density ${denw}x${denh} ${svg} Octave.iconset/icon_${res}x${res}.png"
system -W ${worksrcpath} "${prefix}/bin/convert -background transparent -resize ${hres}x${hres} -density ${hdenw}x${hdenh} ${svg} Octave.iconset/icon_${res}x${res}@2x.png"
# see http://savannah.gnu.org/bugs/?37062
# see http://hg.savannah.gnu.org/hgweb/octave/rev/1687269e31e4
system -W ${worksrcpath} "${prefix}/bin/rsvg-convert -w ${res} ${svg} > Octave.iconset/icon_${res}x${res}.png"
system -W ${worksrcpath} "${prefix}/bin/rsvg-convert -w ${hres} ${svg} > Octave.iconset/icon_${res}x${res}@2x.png"
}

if {[vercmp ${xcodeversion} 4.5] >= 0} {
Expand Down
17 changes: 6 additions & 11 deletions math/octave/Portfile
Expand Up @@ -12,7 +12,7 @@ compiler.blacklist-append {*gcc-4.6} {clang < 700}

name octave
version 4.2.1
revision 3
revision 4
categories math science
platforms darwin
license GPL-3+
Expand Down Expand Up @@ -410,7 +410,7 @@ variant sound description {enable audio support (file I/O and playback)} {
default_variants-append +sound

variant app description "build application bundle to launch ${subport}" {
depends_build-append port:ImageMagick
depends_build-append port:librsvg

if {[vercmp ${xcodeversion} 4.5] < 0} {
# need a way to generate icns file for XCode prior to 4.5
Expand Down Expand Up @@ -481,15 +481,10 @@ variant app description "build application bundle to launch ${subport}" {

set hres [expr 2*${res}]

# find new density so that converted PNG files do not look pixelated
set denw [expr ${dpi}*${res}/${width}]
set denh [expr ${dpi}*${res}/${height}]

set hdenw [expr 2*${denw}]
set hdenh [expr 2*${denh}]

system -W ${worksrcpath} "${prefix}/bin/convert -background transparent -resize ${res}x${res} -density ${denw}x${denh} ${svg} Octave.iconset/icon_${res}x${res}.png"
system -W ${worksrcpath} "${prefix}/bin/convert -background transparent -resize ${hres}x${hres} -density ${hdenw}x${hdenh} ${svg} Octave.iconset/icon_${res}x${res}@2x.png"
# see http://savannah.gnu.org/bugs/?37062
# see http://hg.savannah.gnu.org/hgweb/octave/rev/1687269e31e4
system -W ${worksrcpath} "${prefix}/bin/rsvg-convert -w ${res} ${svg} > Octave.iconset/icon_${res}x${res}.png"
system -W ${worksrcpath} "${prefix}/bin/rsvg-convert -w ${hres} ${svg} > Octave.iconset/icon_${res}x${res}@2x.png"
}

if {[vercmp ${xcodeversion} 4.5] >= 0} {
Expand Down

0 comments on commit 0f27393

Please sign in to comment.