tattempt to install and use imagemagick via Homebrew.jl - Granular.jl - Julia package for granular dynamics simulation
 (HTM) git clone git://src.adamsgaard.dk/Granular.jl
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 16941e6bdbc0bf4e555617da7db0b2a3efa820a8
 (DIR) parent 48271f6efda6a8ef3755618f89f0ee309c07e353
 (HTM) Author: Anders Damsgaard <andersd@riseup.net>
       Date:   Tue,  7 Nov 2017 11:56:38 -0500
       
       attempt to install and use imagemagick via Homebrew.jl
       
       Diffstat:
         M REQUIRE                             |       2 ++
         A deps/build.jl                       |      13 +++++++++++++
         M docs/src/man/installation.md        |      25 +++++++++++++++++++++++--
         M src/io.jl                           |      15 ++++++++++++---
       
       4 files changed, 50 insertions(+), 5 deletions(-)
       ---
 (DIR) diff --git a/REQUIRE b/REQUIRE
       t@@ -2,3 +2,5 @@ julia 0.6
        WriteVTK
        NetCDF
        Documenter
       +@osx Homebrew
       +BinDeps
 (DIR) diff --git a/deps/build.jl b/deps/build.jl
       t@@ -0,0 +1,13 @@
       +#!/usr/bin/env julia
       +using BinDeps
       +
       +@BinDeps.setup
       +
       +imagemagick = library_dependency("imagemagick")
       +
       +if is_apple()
       +    using Homebrew
       +    provides(Homebrew.HB, "imagemagick", imagemagick, os = :Darwin)
       +end
       +
       +@BinDeps.install Dict(:imagemagick => :imagemagick)
 (DIR) diff --git a/docs/src/man/installation.md b/docs/src/man/installation.md
       t@@ -1,6 +1,25 @@
        # Installation
       -Julia includes a very useful package manager which makes it easy to install 
       -packages and their requirements, as well as convenient updating features.
       +
       +## Prerequisites
       +Granular.jl is written as a package for the [Julia programming 
       +language](https://julialang.org), which is a computationally efficient, yet 
       +high-level language. Julia also includes a very useful package manager which 
       +makes it easy to install packages and their requirements, as well as convenient 
       +updating features.
       +
       +### Installing Julia
       +If you do not have Julia installed, download the current release from the 
       +[official Julia download page](https://julialang.org/downloads), or using your 
       +system package manager (e.g. `brew cask install julia` on macOS with the 
       +[Homebrew package manager](https://brew.sh)).  Afterwards, the program `julia` 
       +can be launched from the terminal.
       +
       +### Installing Paraview
       +The core visualization functionality of Granular.jl is based on VTK and 
       +ParaView.  The most recent stable release can be downloaded from the [ParaView 
       +downloads page](https://www.paraview.org/download/).  Alternatively, on macOS 
       +with Homebrew, Paraview can be installed from the terminal with `brew cask 
       +install paraview`.
        
        ## Stable installation (recommended)
        The latest stable release of Granular.jl can be installed directly from the 
       t@@ -51,3 +70,5 @@ julia> Pkg.test("Granular")
        In case any of these tests fail, please open a [Github 
        Issue](https://github.com/anders-dc/Granular.jl/issues) describing the problems 
        so further investigation and diagnosis can follow.
       +
       +
 (DIR) diff --git a/src/io.jl b/src/io.jl
       t@@ -943,19 +943,28 @@ function render(simulation::Simulation; pvpython::String="pvpython",
                        if trim
                            trim_string = "-trim"
                        end
       -                run(`convert $trim_string +repage -delay 10 
       +
       +                # use ImageMagick installed with Homebrew.jl if available,
       +                # otherwise search for convert in $PATH
       +                convert = "convert"
       +                if is_apple()
       +                    import Homebrew
       +                    convert = Homebrew.prefix() * "/bin/convert"
       +                end
       +
       +                run(`$convert $trim_string +repage -delay 10 
                            -transparent-color white 
                            -loop 0 $(simulation.id)/$(simulation.id).'*'.png 
                            $(simulation.id)/$(simulation.id).gif`)
                        if reverse
       -                    run(`convert -trim +repage -delay 10 -transparent-color white 
       +                    run(`$convert -trim +repage -delay 10 -transparent-color white 
                                -loop 0 -reverse
                                $(simulation.id)/$(simulation.id).'*'.png 
                                $(simulation.id)/$(simulation.id)-reverse.gif`)
                        end
                    catch return_signal
                        if isa(return_signal, Base.UVError)
       -                    info("Skipping gif merge since `convert` was not found.")
       +                    info("Skipping gif merge since `$convert` was not found.")
                        end
                    end
                end