Skip to content

Commit

Permalink
allow use on non-OSX
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbyrne committed Jul 27, 2018
1 parent 27f44de commit 7eab064
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ os: osx
osx_image: xcode7.3
julia:
- 0.6
- 0.7
- nightly
notifications:
email: false
Expand Down
6 changes: 4 additions & 2 deletions deps/build.jl
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
using Homebrew
Homebrew.update()
@static if VERSION < v"0.7-" ? is_apple() : Sys.isapple()
using Homebrew
Homebrew.update()
end
21 changes: 16 additions & 5 deletions src/Homebrew.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,22 @@ need is downloaded/installed, then calls `update_env()` to set the environment
properly so that packages being installed can find their binaries.
"""
function __init__()
# Let's see if Homebrew is installed. If not, let's do that first!
(isdir(brew_prefix) && isdir(tappath)) || install_brew()

# Update environment variables such as PATH, DL_LOAD_PATH, etc...
update_env()
if VERSION < v"0.7-" ? is_apple() : Sys.isapple()
# Let's see if Homebrew is installed. If not, let's do that first!
(isdir(brew_prefix) && isdir(tappath)) || install_brew()

# Update environment variables such as PATH, DL_LOAD_PATH, etc...
update_env()
else
# change this to an error in future
warning("""
Homebrew.jl can only be used on Apple macOS. Suggested usage is
@static if Sys.isapple()
using Homebrew
# Homebrew specific code goes here
end
""")
end


Expand Down

0 comments on commit 7eab064

Please sign in to comment.