2020-10-10 14:16:11 +02:00
|
|
|
# typed: false
|
2019-04-19 15:38:03 +09:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-02-20 09:42:43 -08:00
|
|
|
require "requirement"
|
|
|
|
|
|
|
|
class OsxfuseRequirement < Requirement
|
2020-10-20 12:03:48 +02:00
|
|
|
extend T::Sig
|
|
|
|
|
2017-02-20 09:42:43 -08:00
|
|
|
download "https://osxfuse.github.io/"
|
|
|
|
|
|
|
|
satisfy(build_env: false) { self.class.binary_osxfuse_installed? }
|
|
|
|
|
2020-10-20 12:03:48 +02:00
|
|
|
sig { returns(T::Boolean) }
|
2017-02-20 09:42:43 -08:00
|
|
|
def self.binary_osxfuse_installed?
|
|
|
|
File.exist?("/usr/local/include/osxfuse/fuse.h") &&
|
|
|
|
!File.symlink?("/usr/local/include/osxfuse")
|
|
|
|
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/osxfuse"
|
|
|
|
end
|
|
|
|
end
|
2020-11-01 12:26:18 -05:00
|
|
|
|
|
|
|
def message
|
|
|
|
"FUSE for macOS is required for this software. #{super}"
|
|
|
|
end
|
2017-02-20 09:42:43 -08:00
|
|
|
end
|