Open IanButterworth opened 5 years ago
I'm not certain what you're asking? Could you be a little bit more specific? Are you seeing some kind of error?
You're right, apologies for lack of detail. The errors I'm experiencing in using the example are
1) @osx_only
is depreciated in 1.0
2) The code below seems to attempt to install GraphViz with every build. I assumed that it would install once and detect from thereon
using BinDeps
@BinDeps.setup
graphviz = library_dependency("graphviz")
@static if Sys.isapple()
using Homebrew
if !Homebrew.installed("graphviz")
println("Installing GraphViz in local homebrew environment")
provides( Homebrew.HB, "graphviz", graphviz, os = :Darwin )
else
println("GraphViz already installed in local homebrew environment")
end
end
The intention for this package is to have these commands within your deps/build.jl
file. That file gets run once at Pkg.build()
time, which typically happens directly after package installation. If you think the README can be worded better (it probably can) I would be happy to merge a documentation fix.
Indeed, the code I mentioned resides in deps/build.jl
. I'm referring to the build process detecting whether a Homebrew package is installed already and acting accordingly.
i.e. Homebrew.installed("graphviz")
is perpetually false
when the package is built and rebuilt.
Or is that expected behavior? Is the Homebrew installation environment local to the package itself and thus destroyed at the start of a rebuild? (I had assumed it was a local julia-wide environment, thus sustained outside of packages)
Hmmm, no, Homebrew.jl
should definitely be installing into a Homebrew-version-specific directory. E.g. packages/Homebrew.jl/<homebrew/julia version hash>/deps/usr
. So if you Homebrew.add("graphviz")
, unless something goes wrong, Homebrew.installed("graphviz")
should be true.
Indeed, Homebrew.add(pkg)
does result in the package installing and being detectable. However the provides(
line in the example doesn’t seem to invoke the installation of graphviz.
That's correct; it only registers Homebrew as one possible provider of graphviz
. You need a BinDeps.@install
at the bottom of your installation script to actually do the installation. I've added that to the README now.
Apart from the depreciated
@osx_only
macro, is there anything else outdated on thebuild.jl
code on the readme? @staticfloat