arch_requirement: update and add to JSON representation of formulae
This commit is contained in:
parent
6a2331b7e0
commit
f4aeb3e956
@ -1772,7 +1772,7 @@ class Formula
|
||||
"name" => req.name,
|
||||
"cask" => req.cask,
|
||||
"download" => req.download,
|
||||
"version" => req.try(:version),
|
||||
"version" => req.try(:version) || req.try(:arch),
|
||||
"contexts" => req.tags,
|
||||
}
|
||||
end
|
||||
|
||||
@ -9,6 +9,8 @@ require "requirement"
|
||||
class ArchRequirement < Requirement
|
||||
fatal true
|
||||
|
||||
attr_reader :arch
|
||||
|
||||
def initialize(tags)
|
||||
@arch = tags.shift
|
||||
super(tags)
|
||||
@ -16,8 +18,8 @@ class ArchRequirement < Requirement
|
||||
|
||||
satisfy(build_env: false) do
|
||||
case @arch
|
||||
when :x86_64 then Hardware::CPU.is_64_bit?
|
||||
when :intel, :ppc then Hardware::CPU.type == @arch
|
||||
when :x86_64 then Hardware::CPU.intel? && Hardware::CPU.is_64_bit?
|
||||
when :arm, :intel, :ppc then Hardware::CPU.type == @arch
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user