Skip to content

Commit

Permalink
binocle 0.3.2 (new formula)
Browse files Browse the repository at this point in the history
Signed-off-by: Rui Chen <[email protected]>

binocle: update test

Signed-off-by: Rui Chen <[email protected]>
  • Loading branch information
MagicalDrizzle authored and chenrui333 committed Jan 21, 2025
1 parent e2ce6d1 commit 20012c1
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions Formula/b/binocle.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
class Binocle < Formula
desc "Graphical tool to visualize binary data"
homepage "https://github.com/sharkdp/binocle"
url "https://github.com/sharkdp/binocle/archive/refs/tags/v0.3.2.tar.gz"
sha256 "b58d450f343539242b9f146606f5e70d0d183e12ce03e1b003c5197e6e41727b"
license any_of: ["Apache-2.0", "MIT"]
head "https://github.com/sharkdp/binocle.git", branch: "master"

depends_on "rust" => :build

on_linux do
depends_on "libx11"
depends_on "libxcursor"
depends_on "libxrandr"
end

def install
system "cargo", "install", *std_cargo_args
end

test do
assert_match version.to_s, shell_output("#{bin}/binocle --version")

# Fails in Linux CI with
# "Failed to initialize any backend! Wayland status: XdgRuntimeDirNotSet X11 status: XOpenDisplayFailed"
return if OS.linux? && ENV["HOMEBREW_GITHUB_ACTIONS"]

expected = if Hardware::CPU.arm?
"Error: No such file or directory"
else
"Error: No suitable `wgpu::Adapter` found."
end

assert_match expected, shell_output("#{bin}/binocle test.txt 2>&1", 1)
end
end

0 comments on commit 20012c1

Please sign in to comment.