2014-08-29 14:05:12 -05:00
|
|
|
require "requirement"
|
|
|
|
|
2015-06-15 09:56:04 +01:00
|
|
|
class OsxfuseRequirement < Requirement
|
2014-08-29 14:05:12 -05:00
|
|
|
fatal true
|
2014-12-25 20:44:43 +00:00
|
|
|
cask "osxfuse"
|
2016-06-30 17:33:59 +01:00
|
|
|
download "https://osxfuse.github.io/"
|
2014-12-25 20:44:43 +00:00
|
|
|
|
2016-09-17 15:32:44 +01:00
|
|
|
satisfy(build_env: false) { self.class.binary_osxfuse_installed? }
|
2014-08-29 14:05:12 -05:00
|
|
|
|
|
|
|
def self.binary_osxfuse_installed?
|
2016-07-10 13:53:56 +01:00
|
|
|
File.exist?("/usr/local/include/osxfuse/fuse.h") &&
|
|
|
|
!File.symlink?("/usr/local/include/osxfuse")
|
2014-08-29 14:05:12 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
env do
|
2016-07-15 21:25:02 +01:00
|
|
|
ENV.append_path "PKG_CONFIG_PATH", HOMEBREW_LIBRARY/"Homebrew/os/mac/pkgconfig/fuse"
|
2014-08-29 14:05:12 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2015-06-15 09:56:04 +01:00
|
|
|
class NonBinaryOsxfuseRequirement < Requirement
|
2014-08-29 14:05:12 -05:00
|
|
|
fatal true
|
2016-09-17 15:32:44 +01:00
|
|
|
satisfy(build_env: false) { HOMEBREW_PREFIX.to_s != "/usr/local" || !OsxfuseRequirement.binary_osxfuse_installed? }
|
2014-08-29 14:05:12 -05:00
|
|
|
|
|
|
|
def message
|
|
|
|
<<-EOS.undent
|
|
|
|
osxfuse is already installed from the binary distribution and
|
|
|
|
conflicts with this formula.
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
end
|