2021-01-10 19:09:06 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
|
|
class MacfuseRequirement < Requirement
|
|
|
|
|
fatal true
|
|
|
|
|
|
|
|
|
|
satisfy(build_env: false) { self.class.binary_osxfuse_installed? }
|
|
|
|
|
|
|
|
|
|
def self.binary_osxfuse_installed?
|
|
|
|
|
File.exist?("/usr/local/include/fuse.h") &&
|
|
|
|
|
!File.symlink?("/usr/local/include")
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
env do
|
|
|
|
|
ENV.append_path "PKG_CONFIG_PATH", HOMEBREW_LIBRARY/"Homebrew/os/mac/pkgconfig/fuse"
|
|
|
|
|
|
|
|
|
|
unless HOMEBREW_PREFIX.to_s == "/usr/local"
|
|
|
|
|
ENV.append_path "HOMEBREW_LIBRARY_PATHS", "/usr/local/lib"
|
|
|
|
|
ENV.append_path "HOMEBREW_INCLUDE_PATHS", "/usr/local/include"
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def message
|
2021-04-26 12:33:24 +08:00
|
|
|
"This formula requires MacFUSE. Please run `brew install --cask macfuse` first."
|
2021-01-10 19:09:06 +08:00
|
|
|
end
|
|
|
|
|
end
|