homebrew-fuse/Formula/gcsfuse-mac.rb
2023-06-07 00:17:31 +08:00

48 lines
1.7 KiB
Ruby

require_relative "../require/macfuse"
class GcsfuseMac < 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.42.5.tar.gz"
sha256 "272ad522ebbbfe3da87ee00aeff5fe347d25a4a49499c254e482a59bbed5c692"
license "Apache-2.0"
head "https://github.com/GoogleCloudPlatform/gcsfuse.git"
livecheck do
url :stable
regex(/^v?(\d+(?:\.\d+)+)$/i)
end
bottle do
root_url "https://github.com/gromgit/homebrew-fuse/releases/download/gcsfuse-mac-0.42.5"
sha256 cellar: :any_skip_relocation, arm64_monterey: "4c8fe0405b5bd69ad29b9a2d64034c332a190d5c6772fd51c83a40e431ad9ac2"
sha256 cellar: :any_skip_relocation, big_sur: "7aae298075c4ab1a56635d3bec54360e6986c59596b66a132fcc2cdba8633a14"
end
depends_on "go" => :build
depends_on MacfuseRequirement
depends_on :macos
# Review for removal on next release
patch do
url "https://github.com/GoogleCloudPlatform/gcsfuse/commit/c2abca911ff03b84ab64214b6717d8d7cc74c10f.patch?full_index=1"
sha256 "62930a0ae8322a071d489b1dd386206742b962123312b1368589c731867945b4"
end
def install
setup_fuse
# 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, "-buildvcs=false"
end
test do
system "#{bin}/gcsfuse", "--help"
system "#{sbin}/mount_gcsfuse", "--help"
end
end