1 class Redress < Formula
2 desc "Tool for analyzing stripped Go binaries compiled with the Go compiler"
3 homepage "https://github.com/goretk/redress"
4 url "https://github.com/goretk/redress/archive/refs/tags/v1.2.12.tar.gz"
5 sha256 "1a51dfc4630e4ca61bd5d90c656bc4db4a0a24472a95be96fac1d66b12657db8"
6 license "AGPL-3.0-only"
7 head "https://github.com/goretk/redress.git", branch: "develop"
11 regex(/^v?(\d+(?:\.\d+)+)$/i)
15 sha256 cellar: :any_skip_relocation, arm64_sequoia: "3b7cb876ca963b9d34c0a699d1bbb7f402766a820dbb589a0566282c1973e142"
16 sha256 cellar: :any_skip_relocation, arm64_sonoma: "3b7cb876ca963b9d34c0a699d1bbb7f402766a820dbb589a0566282c1973e142"
17 sha256 cellar: :any_skip_relocation, arm64_ventura: "3b7cb876ca963b9d34c0a699d1bbb7f402766a820dbb589a0566282c1973e142"
18 sha256 cellar: :any_skip_relocation, sonoma: "233e4b6d6a5f054cd5de36ef613ff55c1aa49caa90e33b7418c4532e7b08a4cc"
19 sha256 cellar: :any_skip_relocation, ventura: "233e4b6d6a5f054cd5de36ef613ff55c1aa49caa90e33b7418c4532e7b08a4cc"
20 sha256 cellar: :any_skip_relocation, x86_64_linux: "2f9165b197e0bfe6e0e7f202fe110353b38f673f5e7b704445afbecceeabc5cf"
23 depends_on "go" => :build
26 # https://github.com/goretk/redress/blob/develop/Makefile#L11-L14
27 gore_version = File.read(buildpath/"go.mod").scan(%r{goretk/gore v(\S+)}).flatten.first
31 -X main.redressVersion=#{version}
32 -X main.goreVersion=#{gore_version}
33 -X main.compilerVersion=#{Formula["go"].version}
36 system "go", "build", *std_go_args(ldflags:)
38 generate_completions_from_executable(bin/"redress", "completion")
42 assert_match "Version: #{version}", shell_output("#{bin}/redress version")
44 test_module_root = "github.com/goretk/redress"
45 test_bin_path = bin/"redress"
47 output = shell_output("#{bin}/redress info '#{test_bin_path}'")
48 assert_match(/Main root\s+#{Regexp.escape(test_module_root)}/, output)