Skip to content
Snippets Groups Projects
Commit f4aeb3e9 authored by EricFromCanada's avatar EricFromCanada
Browse files

arch_requirement: update and add to JSON representation of formulae

parent 6a2331b7
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment