Merge pull request #207020 from Homebrew/bump-qpdf-11.10.0
[Homebrew/homebrew-core.git] / Formula / g / grc.rb
blob025f9266c5c66c4dd061433afef1c9e8a5d3d7d8
1 class Grc < Formula
2   include Language::Python::Shebang
4   desc "Colorize logfiles and command output"
5   homepage "https://kassiopeia.juls.savba.sk/~garabik/software/grc.html"
6   url "https://github.com/garabik/grc/archive/refs/tags/v1.13.tar.gz"
7   sha256 "a7b10d4316b59ca50f6b749f1d080cea0b41cb3b7258099c3eb195659d1f144f"
8   license "GPL-2.0-or-later"
9   revision 1
10   head "https://github.com/garabik/grc.git", branch: "devel"
12   bottle do
13     rebuild 4
14     sha256 cellar: :any_skip_relocation, all: "c53a320fd40831dbfd74a3add881c94b5d8bca074b6826c190f35c1a3316d96d"
15   end
17   depends_on "python@3.13"
19   def install
20     # fix non-standard prefix installs
21     inreplace "grc", "/usr/local/etc/", "#{etc}/"
22     inreplace "grc.1", " /etc/", " #{etc}/"
23     inreplace ["grcat", "grcat.1"], "/usr/local/share/grc/", "#{pkgshare}/"
25     # so that the completions don't end up in etc/profile.d
26     inreplace "install.sh",
27       "mkdir -p $PROFILEDIR\ncp -fv grc.sh $PROFILEDIR", ""
29     rewrite_shebang detected_python_shebang, "grc", "grcat"
31     system "./install.sh", prefix, HOMEBREW_PREFIX
32     etc.install "grc.sh"
33     etc.install "grc.zsh"
34     etc.install "grc.fish"
35     zsh_completion.install "_grc"
36   end
38   test do
39     actual = pipe_output("#{bin}/grcat #{pkgshare}/conf.ls", "hello root")
40     assert_equal "\e[0mhello \e[0m\e[1m\e[37m\e[41mroot\e[0m", actual.chomp
41   end
42 end