From 249aae177f3e6fb100c391c1f4562cc331c69d2e Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Mon, 21 Apr 2014 18:50:22 +0100 Subject: [PATCH] formula: move cxxstdlib methods to the class. This allows disabling this checks when e.g. pouring bottles. --- Library/Homebrew/compat/formula.rb | 8 ++++++++ Library/Homebrew/cxxstdlib.rb | 2 +- Library/Homebrew/formula.rb | 24 ++++++++++++------------ 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/Library/Homebrew/compat/formula.rb b/Library/Homebrew/compat/formula.rb index 509ff5d180..bbccb7a44f 100644 --- a/Library/Homebrew/compat/formula.rb +++ b/Library/Homebrew/compat/formula.rb @@ -16,6 +16,14 @@ class Formula "-DCMAKE_INSTALL_PREFIX='#{prefix}' -DCMAKE_BUILD_TYPE=None -DCMAKE_FIND_FRAMEWORK=LAST -Wno-dev" end + def cxxstdlib + self.class.cxxstdlib + end + + def cxxstdlib_check check_type + self.class.cxxstdlib_check check_type + end + def self.bottle_sha1(*) end diff --git a/Library/Homebrew/cxxstdlib.rb b/Library/Homebrew/cxxstdlib.rb index fba8682773..1ae50c6742 100644 --- a/Library/Homebrew/cxxstdlib.rb +++ b/Library/Homebrew/cxxstdlib.rb @@ -33,7 +33,7 @@ class CxxStdlib end def check_dependencies(formula, deps) - unless formula.cxxstdlib.include? :skip + unless formula.class.cxxstdlib.include? :skip deps.each do |dep| # Software is unlikely to link against anything from its # buildtime deps, so it doesn't matter at all if they link diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index d21fc48b16..9b8de904e8 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -439,12 +439,6 @@ class Formula Requirement.expand(self, &block) end - # Flag for marking whether this formula needs C++ standard library - # compatibility check - def cxxstdlib - @cxxstdlib ||= Set.new - end - def to_hash hsh = { "name" => name, @@ -607,12 +601,6 @@ class Formula active_spec.patches.each(&:apply) end - # Explicitly request changing C++ standard library compatibility check - # settings. Use with caution! - def cxxstdlib_check check_type - cxxstdlib << check_type - end - def self.method_added method case method when :brew @@ -730,6 +718,18 @@ class Formula @keg_only_reason = KegOnlyReason.new(reason, explanation.to_s.chomp) end + # Flag for marking whether this formula needs C++ standard library + # compatibility check + def cxxstdlib + @cxxstdlib ||= Set.new + end + + # Explicitly request changing C++ standard library compatibility check + # settings. Use with caution! + def cxxstdlib_check check_type + cxxstdlib << check_type + end + # For Apple compilers, this should be in the format: # fails_with compiler do # cause "An explanation for why the build doesn't work."