-
-
Notifications
You must be signed in to change notification settings - Fork 12.1k
/
innotop.rb
71 lines (60 loc) 路 2.97 KB
/
innotop.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
class Innotop < Formula
desc "Top clone for MySQL"
homepage "https://github.com/innotop/innotop/"
url "https://github.com/innotop/innotop/archive/refs/tags/v1.13.0.tar.gz"
sha256 "6ec91568e32bda3126661523d9917c7fbbd4b9f85db79224c01b2a740727a65c"
license any_of: ["GPL-2.0-only", "Artistic-1.0-Perl"]
revision 8
head "https://github.com/innotop/innotop.git"
bottle do
sha256 cellar: :any, arm64_ventura: "19a5d996ec45c87b8639c2641121742dbf9383d47b61aeac79d0bcf64b5390b6"
sha256 cellar: :any, arm64_monterey: "a1bde73682665ff3331799993f7bee539efca85e79ade7804d1a37ad8696d407"
sha256 cellar: :any, ventura: "d3c191fd2250b1d1e07610c8d4a3ebc2dba3328ca815fb47718eaa345cb31d0a"
sha256 cellar: :any, monterey: "c883c153c280fff10b19abcb897ae12abff6bee5c150fe338ff4ed66f8b461bf"
sha256 cellar: :any_skip_relocation, x86_64_linux: "41891fbf349f6e699ecdd8e18139303f9f80918df350f0d27c4fb9ea90972e95"
end
depends_on "mysql-client"
depends_on "openssl@3"
uses_from_macos "perl"
resource "Devel::CheckLib" do
url "https://cpan.metacpan.org/authors/id/M/MA/MATTN/Devel-CheckLib-1.16.tar.gz"
sha256 "869d38c258e646dcef676609f0dd7ca90f085f56cf6fd7001b019a5d5b831fca"
end
resource "DBI" do
url "https://cpan.metacpan.org/authors/id/T/TI/TIMB/DBI-1.643.tar.gz"
sha256 "8a2b993db560a2c373c174ee976a51027dd780ec766ae17620c20393d2e836fa"
end
resource "DBD::mysql" do
url "https://cpan.metacpan.org/authors/id/D/DV/DVEEDEN/DBD-mysql-5.004.tar.gz"
sha256 "33a6bf1b685cc50c46eb1187a3eb259ae240917bc189d26b81418790aa6da5df"
end
resource "TermReadKey" do
url "https://cpan.metacpan.org/authors/id/J/JS/JSTOWE/TermReadKey-2.38.tar.gz"
sha256 "5a645878dc570ac33661581fbb090ff24ebce17d43ea53fd22e105a856a47290"
end
def install
ENV.prepend_create_path "PERL5LIB", libexec/"lib/perl5"
resources.each do |r|
r.stage do
system "perl", "Makefile.PL", "INSTALL_BASE=#{libexec}"
# Work around restriction on 10.15+ where .bundle files cannot be loaded
# from a relative path -- while in the middle of our build we need to
# refer to them by their full path. Workaround adapted from:
# https://github.com/fink/fink-distributions/issues/461#issuecomment-563331868
inreplace "Makefile", "blib/", "$(shell pwd)/blib/" if OS.mac? && r.name == "TermReadKey"
system "make", "install"
end
end
# Disable dynamic selection of perl which may cause segfault when an
# incompatible perl is picked up.
inreplace "innotop", "#!/usr/bin/env perl", "#!/usr/bin/perl"
system "perl", "Makefile.PL", "INSTALL_BASE=#{prefix}"
system "make", "install"
share.install prefix/"man"
bin.env_script_all_files(libexec/"bin", PERL5LIB: ENV["PERL5LIB"])
end
test do
# Calling commands throws up interactive GUI, which is a pain.
assert_match version.to_s, shell_output("#{bin}/innotop --version")
end
end