-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchdig.rb
38 lines (33 loc) · 1.26 KB
/
chdig.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
class Chdig < Formula
desc "Dig into ClickHouse with TUI interface"
homepage "https://github.com/azat/chdig"
url "https://github.com/azat/chdig/archive/refs/tags/v24.4.1.tar.gz"
sha256 "3e8017849224af96a40eecfde375651d9b7c0df44e44f0e2f6bccfa68bc9667b"
license "MIT"
head "https://github.com/azat/chdig.git", branch: "main"
livecheck do
url :stable
regex(%r{^chdig/v?(\d+(?:\.\d+)+)$}i)
end
depends_on "pyoxidizer" => [:build]
depends_on "[email protected]" => [:build]
depends_on "rust" => [:build]
def install
# workaround for [1], copy pyoxidizer binary to temporary directory (since
# sometimes pyoxidizer uses directory where binary lies for temporary data,
# but you cannot write to under brew, you will got EPERM)
#
# [1]: https://github.com/indygreg/PyOxidizer/issues/730
mkdir_p ".build"
pyoxidizer_cmd = which("pyoxidizer")
ln_sf pyoxidizer_cmd, ".build/pyoxidizer"
ENV.prepend_path "PATH", "#{buildpath}/.build"
system "make", "chdig", "build_completion", "deploy-binary"
bin.install "target/chdig"
bash_completion.install "target/chdig.bash-completion" => "chdig"
end
test do
# Sometimes even if the compilation is OK, binary may not work, let's try.
system bin/"chdig", "--help"
end
end