Skip to content

Commit

Permalink
Merge pull request #197276 from Homebrew/percona-toolkit-use-macos-dbi
Browse files Browse the repository at this point in the history
percona-toolkit: use macOS DBI, remove unneeded files
  • Loading branch information
BrewTestBot authored Nov 11, 2024
2 parents 83f14b4 + e347b7e commit 08e2379
Showing 1 changed file with 33 additions and 14 deletions.
47 changes: 33 additions & 14 deletions Formula/p/percona-toolkit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ class PerconaToolkit < Formula
end

bottle do
sha256 cellar: :any, arm64_sequoia: "a1134b153a117ab438762c198f47170b24eb8b09aa4bc5eecfd0c5511dc6e8e4"
sha256 cellar: :any, arm64_sonoma: "5f0de6236a3b694a6d6789fd33546ccbbf7fafd3926f6c428693c67bfba1c6de"
sha256 cellar: :any, arm64_ventura: "b2946e3784bab092642da4a5031e9ca0607accd6952584d026c5b00b46e2bee6"
sha256 cellar: :any, sonoma: "6d42bf7568d502d97272e1ebbf7a3cf5c7b996b46d028310acdcf38ad0cb601a"
sha256 cellar: :any, ventura: "7f01e906b9474648465bb533e93ed918b27f295e6ad00b056e0ce03b1687c829"
sha256 cellar: :any_skip_relocation, x86_64_linux: "7ebe3d5dc418029eb174269d47e4b2d7f74bff8581f11653b5de8b48a6514a00"
rebuild 1
sha256 cellar: :any, arm64_sequoia: "3980109fd839e015ba0374ce6ab91d38b1e3dbf19adbd0dbd9419ff22c6d7c6b"
sha256 cellar: :any, arm64_sonoma: "132b777b091235c5cfb076fcb1e598779b9c85b5474ab4bd835a41505bf90913"
sha256 cellar: :any, arm64_ventura: "8d602577ed2a44397000a5f7c6681fedd6d877ae216397832ca56845e1605db3"
sha256 cellar: :any, sonoma: "dc1b543213e20d1c89fa03feed8db8c1d4389d9af301bd09f53ab7ec8b7465df"
sha256 cellar: :any, ventura: "e02f9d93dc0f420f69948e2ec983cf448b6e4ab65b32f111e1b7ba99d124f70c"
sha256 cellar: :any_skip_relocation, x86_64_linux: "7b3d4c95c44bb34b52568ea62819f57a19988ba50622c5c87b82a7a236606407"
end

depends_on "go" => :build
Expand All @@ -33,18 +34,22 @@ class PerconaToolkit < Formula
end

resource "DBI" do
url "https://cpan.metacpan.org/authors/id/T/TI/TIMB/DBI-1.643.tar.gz"
sha256 "8a2b993db560a2c373c174ee976a51027dd780ec766ae17620c20393d2e836fa"
on_linux do
url "https://cpan.metacpan.org/authors/id/H/HM/HMBRAND/DBI-1.645.tgz"
sha256 "e38b7a5efee129decda12383cf894963da971ffac303f54cc1b93e40e3cf9921"
end
end

resource "DBD::mysql" do
url "https://cpan.metacpan.org/authors/id/D/DV/DVEEDEN/DBD-mysql-5.008.tar.gz"
sha256 "a2324566883b6538823c263ec8d7849b326414482a108e7650edc0bed55bcd89"
url "https://cpan.metacpan.org/authors/id/D/DV/DVEEDEN/DBD-mysql-5.009.tar.gz"
sha256 "8552d90dfddee9ef36e7a696da126ee1b42a1a00fbf2c6f3ce43ca2c63a5b952"
end

resource "JSON" do
url "https://cpan.metacpan.org/authors/id/I/IS/ISHIGAKI/JSON-4.10.tar.gz"
sha256 "df8b5143d9a7de99c47b55f1a170bd1f69f711935c186a6dc0ab56dd05758e35"
on_linux do
url "https://cpan.metacpan.org/authors/id/I/IS/ISHIGAKI/JSON-4.10.tar.gz"
sha256 "df8b5143d9a7de99c47b55f1a170bd1f69f711935c186a6dc0ab56dd05758e35"
end
end

def install
Expand All @@ -60,10 +65,24 @@ def install
libexec
end

# Skip installing man pages for libexec perl modules to reduce disk usage
system "perl", "Makefile.PL", "INSTALL_BASE=#{install_base}",
"INSTALLMAN1DIR=none", "INSTALLMAN3DIR=none",
"NO_PERLLOCAL=1", "NO_PACKLIST=1"

make_args = []
make_args << "OTHERLDFLAGS=-Wl,-dead_strip_dylibs" if r.name == "DBD::mysql" && OS.mac?
if OS.mac? && r.name == "DBD::mysql"
# Reduce overlinking on macOS
make_args << "OTHERLDFLAGS=-Wl,-dead_strip_dylibs"
# Work around macOS DBI generating broken Makefile
inreplace "Makefile" do |s|
old_dbi_instarch_dir = s.get_make_var("DBI_INSTARCH_DIR")
new_dbi_instarch_dir = "#{MacOS.sdk_path_if_needed}#{old_dbi_instarch_dir}"
s.change_make_var! "DBI_INSTARCH_DIR", new_dbi_instarch_dir
s.gsub! " #{old_dbi_instarch_dir}/Driver_xst.h", " #{new_dbi_instarch_dir}/Driver_xst.h"
end
end

system "perl", "Makefile.PL", "INSTALL_BASE=#{install_base}", "NO_PERLLOCAL=1", "NO_PACKLIST=1"
system "make", "install", *make_args
end
end
Expand Down

0 comments on commit 08e2379

Please sign in to comment.