From 7149248451ba9c77cedcf3c91078775e8b3bf59b Mon Sep 17 00:00:00 2001 From: Charlie Sharpsteen Date: Tue, 29 Nov 2011 15:08:34 -0800 Subject: GFortran: Update for XCode 4.2+ New builds of GFortran from r.research.att.com. The latest package installs all of GCC, so we throw out all compilers other than GFortran after installation. Fixes #8173. --- Library/Formula/gfortran.rb | 58 +++++++++++++++++++++++++++++++-------------- 1 file changed, 40 insertions(+), 18 deletions(-) (limited to 'Library/Formula') diff --git a/Library/Formula/gfortran.rb b/Library/Formula/gfortran.rb index 10d64d8c7..fe7c107a1 100644 --- a/Library/Formula/gfortran.rb +++ b/Library/Formula/gfortran.rb @@ -1,6 +1,6 @@ require 'formula' -class GfortranPkgDownloadStrategy = '4.2' + # This version contains an entire Apple-GCC 4.2 (i386/x86_64) build for + # Lion. After installation, we will remove all compilers other than + # GFortran. + url 'http://r.research.att.com/tools/gcc-42-5666.3-darwin11.pkg' + md5 '3ccf46da27aaba17706b420711fb997e' + version '4.2.4-5666.3' + else + url 'http://r.research.att.com/gfortran-lion-5666-3.pkg' + md5 '7eb140822c89bec17db5666859868b3b' + version "4.2.4-5666.3" + end end homepage 'http://r.research.att.com/tools/' @@ -48,7 +55,7 @@ class Gfortran < Formula end # Shouldn't strip compiler binaries. - skip_clean [ 'bin', 'lib', 'libexec' ] + skip_clean :all def install # The version of pax jumped 16 years in development between OS X 10.5 @@ -75,19 +82,34 @@ class Gfortran < Formula safe_system "pax --insecure -rz -f Payload.gz -s ',./usr,#{prefix},'" safe_system "ln -sf #{man1}/gfortran-4.2.1 #{man1}/gfortran.1" else - onoe <<-EOS.undent - Currently the gfortran compiler provided by this brew is only supported - for: + if MacOS.xcode_version >= '4.2' + ohai "Installing gfortran 4.2.4 for XCode 4.2 (build 5666)" + safe_system "pax --insecure -rz -f Payload.gz -s ',./usr,#{prefix},'" - - XCode 3.1.4 on OS X 10.5.x - - XCode 3.2.2/3.2.3 -- 4.0 on OS X 10.6.x - - XCode 4.1 on OS X 10.7.x + safe_system "ln -sf #{man1}/gfortran-4.2.1 #{man1}/gfortran.1" + # This package installs a whole GCC suite. Remove non-fortran + # components. + bin.children.reject{|p| p.basename.to_s.match /gfortran/}.each{|p| rm p} + man1.children.reject{|p| p.basename.to_s.match /gfortran/}.each{|p| rm p} + (include + 'gcc').rmtree + # This package does not contain the gfortran->gfortran-4.2 symlink + safe_system "ln -sf #{bin}/gfortran-4.2 #{bin}/gfortran" + else + onoe <<-EOS.undent + Currently the gfortran compiler provided by this brew is only supported + for: - The AppStore and Software Update can help upgrade your copy of XCode. - The latest version of XCode is also available from: + - XCode 3.1.4 on OS X 10.5.x + - XCode 3.2.2/3.2.3 -- 4.0 on OS X 10.6.x + - XCode 4.1/4.2 on OS X 10.7.x - http://developer.apple.com/technologies/xcode.html - EOS + The AppStore and Software Update can help upgrade your copy of XCode. + The latest version of XCode is also available from: + + http://developer.apple.com/technologies/xcode.html + EOS + exit + end end end @@ -102,6 +124,6 @@ class Gfortran < Formula ... end - EOS + EOS end end -- cgit v1.2.3