diff --git a/Library/Homebrew/build_options.rb b/Library/Homebrew/build_options.rb index 44b6440dc6..d9020ecbad 100644 --- a/Library/Homebrew/build_options.rb +++ b/Library/Homebrew/build_options.rb @@ -84,13 +84,6 @@ class BuildOptions include?("c++11") && option_defined?("c++11") end - # True if a {Formula} is being built in 32-bit/x86 mode. - # This is needed for some use-cases though we prefer to build Universal - # when a 32-bit version is needed. - def build_32_bit? - include?("32-bit") && option_defined?("32-bit") - end - # @private def used_options @options & @args diff --git a/Library/Homebrew/compat.rb b/Library/Homebrew/compat.rb index 0b81e037ab..5d78c715f1 100644 --- a/Library/Homebrew/compat.rb +++ b/Library/Homebrew/compat.rb @@ -19,3 +19,6 @@ require "compat/xcode" require "compat/software_spec" require "compat/utils" require "compat/json" +require "compat/ARGV" +require "compat/build_options" +require "compat/tab" diff --git a/Library/Homebrew/compat/ARGV.rb b/Library/Homebrew/compat/ARGV.rb new file mode 100644 index 0000000000..23d02ce1a4 --- /dev/null +++ b/Library/Homebrew/compat/ARGV.rb @@ -0,0 +1,6 @@ +module HomebrewArgvExtension + def build_32_bit? + # odeprecated "ARGV.build_32_bit?" + include? "--32-bit" + end +end diff --git a/Library/Homebrew/compat/build_options.rb b/Library/Homebrew/compat/build_options.rb new file mode 100644 index 0000000000..52aa9b9516 --- /dev/null +++ b/Library/Homebrew/compat/build_options.rb @@ -0,0 +1,6 @@ +class BuildOptions + def build_32_bit? + # odeprecated "build.build_32_bit?" + include?("32-bit") && option_defined?("32-bit") + end +end diff --git a/Library/Homebrew/compat/tab.rb b/Library/Homebrew/compat/tab.rb new file mode 100644 index 0000000000..58fdc49137 --- /dev/null +++ b/Library/Homebrew/compat/tab.rb @@ -0,0 +1,6 @@ +class Tab < OpenStruct + def build_32_bit? + # odeprecated "Tab.build_32_bit?" + include?("32-bit") + end +end diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index 540925947d..b01335f83f 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -448,8 +448,13 @@ class FormulaAuditor def audit_options formula.options.each do |o| + if o.name != "32-bit" + problem "macOS has been 64-bit only since 10.6 so 32-bit options are deprecated." + end + next unless @strict - if o.name !~ /with(out)?-/ && o.name != "c++11" && o.name != "universal" && o.name != "32-bit" + + if o.name !~ /with(out)?-/ && o.name != "c++11" && o.name != "universal" problem "Options should begin with with/without. Migrate '--#{o.name}' with `deprecated_option`." end diff --git a/Library/Homebrew/extend/ARGV.rb b/Library/Homebrew/extend/ARGV.rb index 3e4e7f5c7a..d361a99a8f 100644 --- a/Library/Homebrew/extend/ARGV.rb +++ b/Library/Homebrew/extend/ARGV.rb @@ -229,13 +229,6 @@ module HomebrewArgvExtension include? "--universal" end - # Request a 32-bit only build. - # This is needed for some use-cases though we prefer to build Universal - # when a 32-bit version is needed. - def build_32_bit? - include? "--32-bit" - end - def build_bottle? include?("--build-bottle") || !ENV["HOMEBREW_BUILD_BOTTLE"].nil? end @@ -294,7 +287,6 @@ module HomebrewArgvExtension build_flags << "--HEAD" if build_head? build_flags << "--universal" if build_universal? - build_flags << "--32-bit" if build_32_bit? build_flags << "--build-bottle" if build_bottle? build_flags << "--build-from-source" if build_from_source? diff --git a/Library/Homebrew/software_spec.rb b/Library/Homebrew/software_spec.rb index 0c230f643d..fb07f6c550 100644 --- a/Library/Homebrew/software_spec.rb +++ b/Library/Homebrew/software_spec.rb @@ -13,9 +13,8 @@ class SoftwareSpec extend Forwardable PREDEFINED_OPTIONS = { - :universal => Option.new("universal", "Build a universal binary"), - :cxx11 => Option.new("c++11", "Build using C++11 mode"), - "32-bit" => Option.new("32-bit", "Build 32-bit only"), + universal: Option.new("universal", "Build a universal binary"), + cxx11: Option.new("c++11", "Build using C++11 mode"), }.freeze attr_reader :name, :full_name, :owner diff --git a/Library/Homebrew/tab.rb b/Library/Homebrew/tab.rb index d355e838d7..40626bad1e 100644 --- a/Library/Homebrew/tab.rb +++ b/Library/Homebrew/tab.rb @@ -218,10 +218,6 @@ class Tab < OpenStruct include?("c++11") end - def build_32_bit? - include?("32-bit") - end - def head? spec == :head end