homebrew-fuse/Formula/gcsfuse-mac.rb
Adrian Ho edbd1103b1 gcsfuse-mac 2.11.1
Closes #110.

Signed-off-by: Adrian Ho <215702+gromgit@users.noreply.github.com>
2025-03-20 14:22:53 +00:00

71 lines
2.2 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/refs/tags/v2.11.1.tar.gz"
sha256 "caaabfa18eb74fc47417bf3ff90d1b5386a465bc6c8edf593318ed444055a27c"
license "Apache-2.0"
head "https://github.com/GoogleCloudPlatform/gcsfuse.git", branch: "master"
livecheck do
url :stable
strategy :github_latest
end
bottle do
root_url "https://ghcr.io/v2/gromgit/fuse"
sha256 cellar: :any_skip_relocation, arm64_sonoma: "c8f7304abcba44cd4734c325d8911230fc97fe43bda38810d5722962010f3b20"
sha256 cellar: :any_skip_relocation, ventura: "0f8300a8b354a2d770e09dfa3142078662f35929285ddd38cc9f1e1015053384"
end
depends_on "go" => :build
depends_on MacfuseRequirement
depends_on :macos
patch do
url "https://raw.githubusercontent.com/gromgit/formula-patches/4c36aab39be3efbb406b756e60f0359cdf64bca5/gcsfuse-mac/macos.patch?full_index=1"
sha256 "518e94c31f3fcba5bb3455f86b42250fcea03bcfe3a883c8364f685defb6fe2f"
end
patch :DATA
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.to_s
system "./build_gcsfuse", buildpath, prefix, gcsfuse_version
end
def caveats
<<~EOS
Upstream doesn't actively support macOS (https://github.com/GoogleCloudPlatform/gcsfuse/issues/1299).
EOS
end
test do
system bin/"gcsfuse", "--help"
system "#{sbin}/mount_gcsfuse", "--help"
end
end
__END__
diff --git a/tools/build_gcsfuse/main.go b/tools/build_gcsfuse/main.go
index b1a4022..678f747 100644
--- a/tools/build_gcsfuse/main.go
+++ b/tools/build_gcsfuse/main.go
@@ -134,8 +134,6 @@ func buildBinaries(dstDir, srcDir, version string, buildArgs []string) (err erro
cmd := exec.Command(
"go",
"build",
- "-C",
- srcDir,
"-o",
path.Join(dstDir, bin.outputPath))