Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow use on non-OSX #239

Merged
merged 1 commit into from
Jul 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
22 changes: 17 additions & 5 deletions src/Homebrew.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,23 @@ 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
end


Expand Down