From 67827eec9b9433488e37ec6ab9b7c820f188e6e8 Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Tue, 17 Apr 2012 06:50:31 -0700 Subject: GHC: use a Requirement --- Library/Formula/ghc.rb | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'Library/Formula') diff --git a/Library/Formula/ghc.rb b/Library/Formula/ghc.rb index 2cf26f9dd..47ceb4061 100644 --- a/Library/Formula/ghc.rb +++ b/Library/Formula/ghc.rb @@ -1,5 +1,18 @@ require 'formula' +class NeedsSnowLeopard < Requirement + def satisfied? + MacOS.snow_leopard? + end + + def message; <<-EOS.undent + GHC requires OS X 10.6 or newer. The binary releases no longer work on + Leopard. See the following issue for details: + http://hackage.haskell.org/trac/ghc/ticket/6009 + EOS + end +end + class Ghc < Formula homepage 'http://haskell.org/ghc/' if ARGV.include? '--64bit' @@ -20,6 +33,8 @@ class Ghc < Formula end end + depends_on NeedsSnowLeopard.new + # Avoid stripping the Haskell binaries & libraries. # See: http://hackage.haskell.org/trac/ghc/ticket/2458 skip_clean ['bin', 'lib'] @@ -37,16 +52,6 @@ class Ghc < Formula end def install - if MacOS.leopard? - onoe <<-EOS.undent - GHC requires OS X 10.6 or newer. The binary releases no longer work on - Leopard. See the following issue for details: - - http://hackage.haskell.org/trac/ghc/ticket/6009 - EOS - exit 1 - end - if ARGV.build_devel? opoo "The current version of haskell-platform will NOT work with this version of GHC!" end -- cgit v1.2.3