diff options
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/aria2.rb | 3 | ||||
| -rw-r--r-- | Library/Formula/capnp.rb | 18 | ||||
| -rw-r--r-- | Library/Formula/gringo.rb | 5 | ||||
| -rw-r--r-- | Library/Formula/libcppa.rb | 11 | ||||
| -rw-r--r-- | Library/Formula/mal4s.rb | 3 | ||||
| -rw-r--r-- | Library/Formula/mkvtoolnix.rb | 23 | ||||
| -rw-r--r-- | Library/Formula/sdcv.rb | 9 | ||||
| -rw-r--r-- | Library/Homebrew/compilers.rb | 29 | ||||
| -rw-r--r-- | Library/Homebrew/formula.rb | 7 |
9 files changed, 46 insertions, 62 deletions
diff --git a/Library/Formula/aria2.rb b/Library/Formula/aria2.rb index d45754613..02b2e3200 100644 --- a/Library/Formula/aria2.rb +++ b/Library/Formula/aria2.rb @@ -13,7 +13,8 @@ class Aria2 < Formula end depends_on 'pkg-config' => :build - depends_on :macos => :lion # Needs a c++11 compiler + + needs :cxx11 def install args = %W[ diff --git a/Library/Formula/capnp.rb b/Library/Formula/capnp.rb index b08b04262..f8e0700e7 100644 --- a/Library/Formula/capnp.rb +++ b/Library/Formula/capnp.rb @@ -5,23 +5,7 @@ class Capnp < Formula url 'http://capnproto.org/capnproto-c++-0.4.1.tar.gz' sha1 '18ce1a404c2bf68e6625e44927bfe6b67186cb15' - # TODO add fails_with statements for FSF GCC - fails_with :gcc do - cause "Cap'n Proto requires C++11 support" - end - - fails_with :gcc_4_0 do - cause "Cap'n Proto requires C++11 support" - end - - fails_with :clang do - build 425 - cause "Clang 3.2 or newer is required to build Cap'n Proto" - end - - fails_with :llvm do - cause "Cap'n Proto requires C++11 support" - end + needs :cxx11 def install system "./configure", "--disable-debug", diff --git a/Library/Formula/gringo.rb b/Library/Formula/gringo.rb index 24bbd82e8..cbcced99e 100644 --- a/Library/Formula/gringo.rb +++ b/Library/Formula/gringo.rb @@ -13,11 +13,8 @@ class Gringo < Formula depends_on 're2c' => :build depends_on 'scons' => :build depends_on 'bison' => :build - depends_on :macos => :lion - # Needs C++11 - fails_with :gcc - fails_with :gcc_4_0 + needs :cxx11 # Fixes missing include; fixed upstream: # http://sourceforge.net/p/potassco/code/8274/tree//trunk/gringo/app/gringo/main.cc?diff=5083e8f9bfc09e133b25ad84:8273 diff --git a/Library/Formula/libcppa.rb b/Library/Formula/libcppa.rb index bf082c3f6..9972594aa 100644 --- a/Library/Formula/libcppa.rb +++ b/Library/Formula/libcppa.rb @@ -5,20 +5,13 @@ class Libcppa < Formula url 'https://github.com/Neverlord/libcppa/archive/V0.8.1.tar.gz' sha1 'd4f096aae2bb72e254ad6df45edf3fb62370acaa' - depends_on :macos => :lion depends_on 'cmake' => :build + needs :cxx11 + option 'with-opencl', 'Build with OpenCL actors' option 'with-examples', 'Build examples' - fails_with :gcc do - cause 'libcppa requires a C++11 compliant compiler.' - end - - fails_with :llvm do - cause 'libcppa requires a C++11 compliant compiler.' - end - def install args = %W[ --prefix=#{prefix} diff --git a/Library/Formula/mal4s.rb b/Library/Formula/mal4s.rb index 7a7a64b4b..9f2a064c6 100644 --- a/Library/Formula/mal4s.rb +++ b/Library/Formula/mal4s.rb @@ -7,7 +7,6 @@ class Mal4s < Formula head 'https://github.com/secure411dotorg/mal4s.git' - depends_on :macos => :mavericks depends_on :automake depends_on :autoconf depends_on :libtool @@ -23,6 +22,8 @@ class Mal4s < Formula depends_on 'sdl2_image' depends_on 'sdl2_mixer' + needs :cxx11 + def install args = ["--disable-dependency-tracking", "--prefix=#{prefix}"] diff --git a/Library/Formula/mkvtoolnix.rb b/Library/Formula/mkvtoolnix.rb index a4f24c77d..dc39ec63d 100644 --- a/Library/Formula/mkvtoolnix.rb +++ b/Library/Formula/mkvtoolnix.rb @@ -47,28 +47,7 @@ class Mkvtoolnix < Formula depends_on 'libebml' => 'c++11' end - fails_with :clang do - build 425 - cause 'Mkvtoolnix requires a C++11 compliant compiler.' - end - - fails_with :gcc do - build 5666 - cause 'Mkvtoolnix requires a C++11 compliant compiler.' - end - - fails_with :gcc => '4.5.4' do - cause 'Mkvtoolnix requires a C++11 compliant compiler.' - end - - fails_with :gcc_4_0 do - cause 'Mkvtoolnix requires a C++11 compliant compiler.' - end; - - fails_with :llvm do - build 2336 - cause 'Mkvtoolnix requires a C++11 compliant compiler.' - end + needs :cxx11 def install ENV.cxx11 diff --git a/Library/Formula/sdcv.rb b/Library/Formula/sdcv.rb index 8babd32f0..4912f9ec1 100644 --- a/Library/Formula/sdcv.rb +++ b/Library/Formula/sdcv.rb @@ -13,14 +13,7 @@ class Sdcv < Formula depends_on 'readline' # see: https://github.com/Homebrew/homebrew/issues/26321 - fails_with :clang do - build 425 - cause "clang 425 does not provide complete enough C++11 features" - end - - fails_with :gcc - fails_with :llvm - fails_with :gcc_4_0 + needs :cxx11 def install mkdir 'build' do diff --git a/Library/Homebrew/compilers.rb b/Library/Homebrew/compilers.rb index bd3fde698..7473f12a7 100644 --- a/Library/Homebrew/compilers.rb +++ b/Library/Homebrew/compilers.rb @@ -28,6 +28,35 @@ class CompilerFailure attr_reader :compiler, :major_version attr_rw :cause, :version + MESSAGES = { + :cxx11 => 'This compiler does not support C++11' + } + + COLLECTIONS = { + :cxx11 => [ + [:gcc_4_0, proc { cause MESSAGES[:cxx11] }], + [:gcc, proc { cause MESSAGES[:cxx11] }], + [:clang, proc { build 425; cause MESSAGES[:cxx11] }], + [{:gcc => '4.3'}, proc { cause MESSAGES[:cxx11] }], + [{:gcc => '4.4'}, proc { cause MESSAGES[:cxx11] }], + [{:gcc => '4.5'}, proc { cause MESSAGES[:cxx11] }], + [{:gcc => '4.6'}, proc { cause MESSAGES[:cxx11] }] + ], + :openmp => [ + [:clang, proc { cause 'clang does not support OpenMP' }] + ] + } + + def self.for_standard standard + failures = COLLECTIONS.fetch(standard) do + raise ArgumentError, "\"#{standard}\" is not a recognized standard" + end + + failures.map do |compiler, block| + CompilerFailure.new(compiler, &block) + end + end + def initialize compiler, &block # Non-Apple compilers are in the format fails_with compiler => version if compiler.is_a? Hash diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 49271b76d..2fe485909 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -761,6 +761,13 @@ class Formula @cc_failures << CompilerFailure.new(compiler, &block) end + def needs *standards + @cc_failures ||= Set.new + standards.each do |standard| + @cc_failures.merge CompilerFailure.for_standard standard + end + end + def require_universal_deps specs.each { |spec| spec.build.universal = true } end |
