formula: add std_cargo_args
This commit is contained in:
parent
a89b56598b
commit
8a62f891e1
@ -1354,6 +1354,11 @@ class Formula
|
|||||||
"#<Formula #{name} (#{active_spec_sym}) #{path}>"
|
"#<Formula #{name} (#{active_spec_sym}) #{path}>"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Standard parameters for cargo builds.
|
||||||
|
def std_cargo_args
|
||||||
|
["--locked", "--root", prefix, "--path", "."]
|
||||||
|
end
|
||||||
|
|
||||||
# Standard parameters for CMake builds.
|
# Standard parameters for CMake builds.
|
||||||
# Setting `CMAKE_FIND_FRAMEWORK` to "LAST" tells CMake to search for our
|
# Setting `CMAKE_FIND_FRAMEWORK` to "LAST" tells CMake to search for our
|
||||||
# libraries before trying to utilize Frameworks, many of which will be from
|
# libraries before trying to utilize Frameworks, many of which will be from
|
||||||
@ -1930,6 +1935,8 @@ class Formula
|
|||||||
case cmd
|
case cmd
|
||||||
when "./configure"
|
when "./configure"
|
||||||
pretty_args -= %w[--disable-dependency-tracking --disable-debug --disable-silent-rules]
|
pretty_args -= %w[--disable-dependency-tracking --disable-debug --disable-silent-rules]
|
||||||
|
when "cargo"
|
||||||
|
pretty_args -= std_cargo_args
|
||||||
when "cmake"
|
when "cmake"
|
||||||
pretty_args -= std_cmake_args
|
pretty_args -= std_cmake_args
|
||||||
when "go"
|
when "go"
|
||||||
|
@ -175,7 +175,7 @@ module Homebrew
|
|||||||
bin.install libexec/"bin/\#{name}"
|
bin.install libexec/"bin/\#{name}"
|
||||||
bin.env_script_all_files(libexec/"bin", :GEM_HOME => ENV["GEM_HOME"])
|
bin.env_script_all_files(libexec/"bin", :GEM_HOME => ENV["GEM_HOME"])
|
||||||
<% elsif mode == :rust %>
|
<% elsif mode == :rust %>
|
||||||
system "cargo", "install", "--locked", "--root", prefix, "--path", "."
|
system "cargo", "install", *std_cargo_args
|
||||||
<% else %>
|
<% else %>
|
||||||
# Remove unrecognized options if warned by configure
|
# Remove unrecognized options if warned by configure
|
||||||
system "./configure", "--disable-debug",
|
system "./configure", "--disable-debug",
|
||||||
|
@ -60,7 +60,7 @@ module RuboCop
|
|||||||
end
|
end
|
||||||
|
|
||||||
find_method_with_args(body_node, :system, "cargo", "build") do
|
find_method_with_args(body_node, :system, "cargo", "build") do
|
||||||
problem "use \"cargo\", \"install\", \"--root\", prefix, \"--path\", \".\""
|
problem "use \"cargo\", \"install\", *std_cargo_args"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -210,7 +210,7 @@ describe RuboCop::Cop::FormulaAudit::Text do
|
|||||||
|
|
||||||
def install
|
def install
|
||||||
system "cargo", "build"
|
system "cargo", "build"
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^ use \"cargo\", \"install\", \"--root\", prefix, \"--path\", \".\"
|
^^^^^^^^^^^^^^^^^^^^^^^ use \"cargo\", \"install\", *std_cargo_args
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
RUBY
|
RUBY
|
||||||
|
Loading…
x
Reference in New Issue
Block a user