homebrew-fuse/Formula/rclone-mac.rb
Adrian Ho 1895d51783
Some checks are pending
brew test-bot / test-bot (macos-13) (push) Waiting to run
brew test-bot / test-bot (macos-14) (push) Waiting to run
rclone-mac: update 1.69.3 bottle.
2025-06-11 05:15:09 +00:00

59 lines
2.3 KiB
Ruby

require_relative "../require/macfuse"
class RcloneMac < Formula
desc "Rsync for cloud storage (with macOS FUSE mount support)"
homepage "https://rclone.org/"
url "https://github.com/rclone/rclone/archive/refs/tags/v1.69.3.tar.gz"
sha256 "ff6d17d187dd23648bfd33f20ff48902f7f08d2d9231f1f11825109903356b21"
license "MIT"
head "https://github.com/rclone/rclone.git"
bottle do
root_url "https://ghcr.io/v2/gromgit/fuse"
sha256 cellar: :any_skip_relocation, arm64_sonoma: "af8e6a75dcc7df184f914d3841eb4dc1391b1a7b6d33d5f7d415e50e26b2f703"
sha256 cellar: :any_skip_relocation, ventura: "78f811201150440ff994d8487bfc3a3331cd71849ffae5451a589ab5205271cf"
end
depends_on "go" => :build
depends_on MacfuseRequirement
depends_on :macos
def install
setup_fuse
system "go", "build",
"-ldflags", "-s -X github.com/rclone/rclone/fs.Version=v#{version}",
"-tags", "cmount", *std_go_args
(libexec/"rclone").install_symlink bin/name.to_s => "rclone"
man1.install "rclone.1" => "#{name}.1"
system bin/name.to_s, "genautocomplete", "bash", "rclone.bash"
system bin/name.to_s, "genautocomplete", "bash", "#{name}.bash"
system bin/name.to_s, "genautocomplete", "zsh", "_rclone"
system bin/name.to_s, "genautocomplete", "zsh", "_#{name}"
bash_completion.install "rclone.bash" => "rclone"
bash_completion.install "#{name}.bash" => name.to_s
zsh_completion.install "_rclone"
zsh_completion.install "_#{name}"
end
def caveats
<<~EOS
The rclone binary has been installed as `#{name}`,
to avoid conflict with the core `rclone` formula.
If you need to use it as `rclone`, add the "rclone" directory
to your PATH like:
PATH="#{opt_libexec}/rclone:$PATH"
`#{name}` supports the `mount` command on macOS, unlike the
Homebrew core `rclone`. If you don't need `mount`, please
`brew install rclone` instead.
EOS
end
test do
(testpath/"file1.txt").write "Test!"
system bin/name.to_s, "copy", testpath/"file1.txt", testpath/"dist"
assert_match File.read(testpath/"file1.txt"), File.read(testpath/"dist/file1.txt")
system opt_libexec/"rclone/rclone", "copy", testpath/"file1.txt", testpath/"dast"
assert_match File.read(testpath/"file1.txt"), File.read(testpath/"dast/file1.txt")
end
end