homebrew-core/Formula/gcsfuse.rb

56 lines
1.6 KiB
Ruby

class Gcsfuse < Formula
desc "User-space file system for interacting with Google Cloud"
homepage "https://github.com/googlecloudplatform/gcsfuse"
url "https://github.com/GoogleCloudPlatform/gcsfuse/archive/v0.41.7.tar.gz"
sha256 "07aee73827f06ca823f29020b273969d93494647bf2990847e809c643914c667"
license "Apache-2.0"
head "https://github.com/GoogleCloudPlatform/gcsfuse.git", branch: "master"
bottle do
sha256 cellar: :any_skip_relocation, x86_64_linux: "c40d4ec48be72166f8091b734b3475bedb2a022826242ac2732776e347ad5247"
end
depends_on "go" => :build
on_macos do
disable! date: "2021-04-08", because: "requires closed-source macFUSE"
end
on_linux do
depends_on "libfuse"
end
def install
# Build the build_gcsfuse tool. Ensure that it doesn't pick up any
# libraries from the user's GOPATH; it should have no dependencies.
ENV.delete("GOPATH")
system "go", "build", "./tools/build_gcsfuse"
# Use that tool to build gcsfuse itself.
gcsfuse_version = build.head? ? Utils.git_short_head : version
system "./build_gcsfuse", buildpath, prefix, gcsfuse_version
end
def caveats
on_macos do
<<~EOS
The reasons for disabling this formula can be found here:
https://github.com/Homebrew/homebrew-core/pull/64491
An external tap may provide a replacement formula. See:
https://docs.brew.sh/Interesting-Taps-and-Forks
EOS
end
end
test do
system "#{bin}/gcsfuse", "--help"
separator = if OS.mac?
"_"
else
"."
end
system "#{sbin}/mount#{separator}gcsfuse", "--help"
end
end