From c49cdc260c2bc8b4465204be4bee232c75daa154 Mon Sep 17 00:00:00 2001 From: BingoKingo <24961267+BingoKingo@users.noreply.github.com> Date: Thu, 30 Jan 2025 12:51:58 +0800 Subject: [PATCH 1/3] Update formula_creator.rb --- Library/Homebrew/formula_creator.rb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/formula_creator.rb b/Library/Homebrew/formula_creator.rb index 0a11048186..a289121b27 100644 --- a/Library/Homebrew/formula_creator.rb +++ b/Library/Homebrew/formula_creator.rb @@ -138,7 +138,7 @@ module Homebrew <% elsif @mode == :perl %> uses_from_macos "perl" <% elsif @mode == :python %> - depends_on "python" + depends_on "python@x.y" <% elsif @mode == :ruby %> uses_from_macos "ruby" <% elsif @mode == :rust %> @@ -147,7 +147,7 @@ module Homebrew # depends_on "cmake" => :build <% end %> - <% if @mode == :perl %> + <% if @mode == :perl || :python || :ruby %> # Additional dependency # resource "" do # url "" @@ -201,8 +201,14 @@ module Homebrew virtualenv_install_with_resources <% elsif @mode == :ruby %> ENV["GEM_HOME"] = libexec + + # resources.each do |r| + # system "gem", "install", r.cached_download, "--ignore-dependencies", + # "--no-document", "--install-dir", libexec + # end + system "gem", "build", "\#{name}.gemspec" - system "gem", "install", "\#{name}-\#{@version}.gem" + system "gem", "install", "\#{name}-\#{version}.gem" bin.install libexec/"bin/\#{name}" bin.env_script_all_files(libexec/"bin", GEM_HOME: ENV["GEM_HOME"]) <% elsif @mode == :rust %> From cff9a565b68e6e32b3e9f1903b0507193fd5b87d Mon Sep 17 00:00:00 2001 From: BingoKingo <24961267+BingoKingo@users.noreply.github.com> Date: Thu, 30 Jan 2025 18:22:22 +0800 Subject: [PATCH 2/3] formula_creator.rb: add `bundle install` and additional dependency comment --- Library/Homebrew/formula_creator.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Library/Homebrew/formula_creator.rb b/Library/Homebrew/formula_creator.rb index a289121b27..3369cb4d7b 100644 --- a/Library/Homebrew/formula_creator.rb +++ b/Library/Homebrew/formula_creator.rb @@ -202,11 +202,14 @@ module Homebrew <% elsif @mode == :ruby %> ENV["GEM_HOME"] = libexec + # Additional dependency from gem # resources.each do |r| # system "gem", "install", r.cached_download, "--ignore-dependencies", # "--no-document", "--install-dir", libexec # end + system "bundle", "config", "set", "without", "development", "test" + system "bundle", "install" system "gem", "build", "\#{name}.gemspec" system "gem", "install", "\#{name}-\#{version}.gem" bin.install libexec/"bin/\#{name}" From e99034d8e3ff4c0a133be52a186e4a3c9448f4e6 Mon Sep 17 00:00:00 2001 From: BingoKingo <24961267+BingoKingo@users.noreply.github.com> Date: Sat, 1 Feb 2025 17:23:02 +0800 Subject: [PATCH 3/3] Update formula_creator.rb --- Library/Homebrew/formula_creator.rb | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Library/Homebrew/formula_creator.rb b/Library/Homebrew/formula_creator.rb index 3369cb4d7b..1979134079 100644 --- a/Library/Homebrew/formula_creator.rb +++ b/Library/Homebrew/formula_creator.rb @@ -202,14 +202,7 @@ module Homebrew <% elsif @mode == :ruby %> ENV["GEM_HOME"] = libexec - # Additional dependency from gem - # resources.each do |r| - # system "gem", "install", r.cached_download, "--ignore-dependencies", - # "--no-document", "--install-dir", libexec - # end - - system "bundle", "config", "set", "without", "development", "test" - system "bundle", "install" + system "bundle", "install", "-without", "development", "test" system "gem", "build", "\#{name}.gemspec" system "gem", "install", "\#{name}-\#{version}.gem" bin.install libexec/"bin/\#{name}"