From e49cc7d0ad4f766b3c105ff925117811e2defcbc Mon Sep 17 00:00:00 2001 From: Mitchell Blank Jr Date: Sun, 27 Dec 2020 21:56:08 +0000 Subject: [PATCH] mysql-sandbox: revision * mysql-sandbox: install correctly on Big Sur As discussed with https://github.com/Homebrew/homebrew-core/pull/66370#issuecomment-740856994 Big Sur's system perl changed how "PREFIX=" is treated as an install destination. The more explicit way to control MakeMaker is to set INSTALL_BASE instead, which should result in consistent behavior between different OS/X versions. Even on 10.X, this formula wasn't installing manpages in the correct directory; that is now fixed. * specify osx perl dependency * stable is preferred over head * fix syntax issue Closes #67821. Co-authored-by: chenrui Signed-off-by: chenrui Signed-off-by: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com> --- Formula/mysql-sandbox.rb | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/Formula/mysql-sandbox.rb b/Formula/mysql-sandbox.rb index cc6810172c65f..0784b10d7757c 100644 --- a/Formula/mysql-sandbox.rb +++ b/Formula/mysql-sandbox.rb @@ -4,8 +4,14 @@ class MysqlSandbox < Formula url "https://github.com/datacharmer/mysql-sandbox/archive/3.2.17.tar.gz" sha256 "3af4af111536e4e690042bc80834392f46a7e55c7143332d229ff2eb32321e89" license "Apache-2.0" + revision 1 head "https://github.com/datacharmer/mysql-sandbox.git" + livecheck do + url :stable + strategy :github_latest + end + bottle do cellar :any_skip_relocation sha256 "243b5248bbf998820b15079d4d2228a8289a9f48471723d06764ba4dc4a27a3e" => :catalina @@ -15,15 +21,21 @@ class MysqlSandbox < Formula sha256 "77ab4eb3bbd5d374020081b3505cd7f18de1500019af148f00ebef13a34e4222" => :el_capitan end + uses_from_macos "perl" + def install - ENV["PERL_LIBDIR"] = libexec/"lib/perl5" - ENV.prepend_create_path "PERL5LIB", libexec/"lib/perl5/site_perl" + ENV["PERL_LIBDIR"] = lib/"perl5" + ENV.prepend_create_path "PERL5LIB", lib/"perl5" - system "perl", "Makefile.PL", "PREFIX=#{libexec}" + system "perl", "Makefile.PL", "INSTALL_BASE=#{prefix}", "INSTALLSITEMAN3DIR=#{man3}" system "make", "test", "install" - bin.install Dir["#{libexec}/bin/*"] - bin.env_script_all_files(libexec/"bin", PERL5LIB: ENV["PERL5LIB"]) + Pathname.glob("#{bin}/*") do |file| + next if file.extname == ".sh" + + libexec.install(file) + file.write_env_script(libexec.join(file.basename), PERL5LIB: ENV["PERL5LIB"]) + end end test do