Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update formula_creator.rb #19173

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions Library/Homebrew/formula_creator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class #{Formulary.class_s(name)} < Formula
<% elsif @mode == :perl %>
uses_from_macos "perl"
<% elsif @mode == :python %>
depends_on "python"
depends_on "python@x.y"
BingoKingo marked this conversation as resolved.
Show resolved Hide resolved
<% elsif @mode == :ruby %>
uses_from_macos "ruby"
<% elsif @mode == :rust %>
Expand All @@ -147,7 +147,7 @@ class #{Formulary.class_s(name)} < Formula
# depends_on "cmake" => :build
<% end %>

<% if @mode == :perl %>
<% if @mode == :perl || :python || :ruby %>
# Additional dependency
# resource "" do
# url ""
Expand Down Expand Up @@ -201,8 +201,17 @@ def install
virtualenv_install_with_resources
<% 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

Comment on lines +206 to +210
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should almost never be needed for Ruby and bundle install should be used instead.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, this is provided for those formula with resource sections and it is commented out.

  resource "#{name}" do
    url "https://rubygems.org/downloads/#{name}-#{version}.gem"
    sha256 ""
  end

system "bundle", "config", "set", "without", "development", "test"
system "bundle", "install"
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 %>
Expand Down
Loading