relocation_formulae: Poured bottles depend on gcc [Linux]
This commit is contained in:
parent
e3f5450ac3
commit
605e61095a
@ -13,6 +13,9 @@ branches:
|
|||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
|
env:
|
||||||
|
- HOMEBREW_FORCE_HOMEBREW_ON_LINUX=1
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- HOMEBREW_REPOSITORY="$(brew --repo)"
|
- HOMEBREW_REPOSITORY="$(brew --repo)"
|
||||||
- sudo chown -R "$USER" "$HOMEBREW_REPOSITORY"
|
- sudo chown -R "$USER" "$HOMEBREW_REPOSITORY"
|
||||||
|
|||||||
@ -83,4 +83,17 @@ class Keg
|
|||||||
def self.relocation_formulae
|
def self.relocation_formulae
|
||||||
["patchelf"]
|
["patchelf"]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.bottle_dependencies
|
||||||
|
@bottle_dependencies ||= begin
|
||||||
|
formulae = relocation_formulae
|
||||||
|
gcc = Formula["gcc"]
|
||||||
|
if !ENV["HOMEBREW_FORCE_HOMEBREW_ON_LINUX"] &&
|
||||||
|
DevelopmentTools.non_apple_gcc_version("gcc") < gcc.version.to_i
|
||||||
|
formulae += gcc.recursive_dependencies.map(&:name)
|
||||||
|
formulae << gcc.name
|
||||||
|
end
|
||||||
|
formulae
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -489,14 +489,20 @@ class FormulaInstaller
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if pour_bottle && !Keg.relocation_formulae.include?(formula.name)
|
if pour_bottle && !Keg.bottle_dependencies.empty?
|
||||||
bottle_deps = Keg.relocation_formulae
|
bottle_deps = if !Keg.bottle_dependencies.include?(formula.name)
|
||||||
.map { |formula| Dependency.new(formula) }
|
Keg.bottle_dependencies
|
||||||
|
elsif !Keg.relocation_formulae.include?(formula.name)
|
||||||
|
Keg.relocation_formulae
|
||||||
|
else
|
||||||
|
[]
|
||||||
|
end
|
||||||
|
bottle_deps = bottle_deps.map { |formula| Dependency.new(formula) }
|
||||||
.reject do |dep|
|
.reject do |dep|
|
||||||
inherited_options[dep.name] |= inherited_options_for(dep)
|
inherited_options[dep.name] |= inherited_options_for(dep)
|
||||||
dep.satisfied? inherited_options[dep.name]
|
dep.satisfied? inherited_options[dep.name]
|
||||||
end
|
end
|
||||||
expanded_deps = Dependency.merge_repeats(bottle_deps + expanded_deps) unless bottle_deps.empty?
|
expanded_deps = Dependency.merge_repeats(bottle_deps + expanded_deps)
|
||||||
end
|
end
|
||||||
|
|
||||||
expanded_deps.map { |dep| [dep, inherited_options[dep.name]] }
|
expanded_deps.map { |dep| [dep, inherited_options[dep.name]] }
|
||||||
|
|||||||
@ -187,6 +187,10 @@ class Keg
|
|||||||
def self.relocation_formulae
|
def self.relocation_formulae
|
||||||
[]
|
[]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.bottle_dependencies
|
||||||
|
relocation_formulae
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
require "extend/os/keg_relocate"
|
require "extend/os/keg_relocate"
|
||||||
|
|||||||
@ -18,6 +18,7 @@ describe FormulaInstaller do
|
|||||||
expect(formula).to pour_bottle
|
expect(formula).to pour_bottle
|
||||||
|
|
||||||
stub_formula_loader formula
|
stub_formula_loader formula
|
||||||
|
stub_formula_loader formula("gcc") { url "gcc-1.0" }
|
||||||
stub_formula_loader formula("patchelf") { url "patchelf-1.0" }
|
stub_formula_loader formula("patchelf") { url "patchelf-1.0" }
|
||||||
allow(Formula["patchelf"]).to receive(:installed?).and_return(true)
|
allow(Formula["patchelf"]).to receive(:installed?).and_return(true)
|
||||||
described_class.new(formula).install
|
described_class.new(formula).install
|
||||||
|
|||||||
@ -138,6 +138,7 @@ describe Formulary do
|
|||||||
context "with installed Formula" do
|
context "with installed Formula" do
|
||||||
before do
|
before do
|
||||||
allow(described_class).to receive(:loader_for).and_call_original
|
allow(described_class).to receive(:loader_for).and_call_original
|
||||||
|
stub_formula_loader formula("gcc") { url "gcc-1.0" }
|
||||||
stub_formula_loader formula("patchelf") { url "patchelf-1.0" }
|
stub_formula_loader formula("patchelf") { url "patchelf-1.0" }
|
||||||
allow(Formula["patchelf"]).to receive(:installed?).and_return(true)
|
allow(Formula["patchelf"]).to receive(:installed?).and_return(true)
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user