diff --git a/Formula/goofys-mac.rb b/Formula/goofys-mac.rb new file mode 100644 index 0000000..cd5d14b --- /dev/null +++ b/Formula/goofys-mac.rb @@ -0,0 +1,40 @@ +require_relative "../require/macfuse" + +class GoofysMac < Formula + desc "Filey-System interface to Amazon S3" + homepage "https://github.com/kahing/goofys" + url "https://github.com/kahing/goofys.git", + tag: "v0.24.0", + revision: "45b8d78375af1b24604439d2e60c567654bcdf88" + license "Apache-2.0" + head "https://github.com/kahing/goofys.git" + + bottle do + root_url "https://github.com/gromgit/homebrew-fuse/releases/download/goofys-mac-0.24.0" + sha256 cellar: :any_skip_relocation, big_sur: "f3f73dc39927ee0a94a26a3bc8ae4b097e083d48e311b79274a85ac7f547e85a" + end + + depends_on "go@1.14" => :build + depends_on MacfuseRequirement + depends_on :macos + + def install + contents = Dir["*"] + gopath = buildpath/"gopath" + (gopath/"src/github.com/kahing/goofys").install contents + + ENV["GOPATH"] = gopath + + goofys_version = build.head? ? Utils.git_head : version + cd gopath/"src/github.com/kahing/goofys" do + system "go", "build", *std_go_args, + "-ldflags", "-X main.Version=#{goofys_version}", + "-o", "#{bin}/goofys" + prefix.install_metafiles + end + end + + test do + system "#{bin}/goofys", "--version" + end +end