diff options
| author | Charlie Sharpsteen | 2011-11-29 15:08:34 -0800 |
|---|---|---|
| committer | Charlie Sharpsteen | 2011-11-29 16:13:25 -0800 |
| commit | 7149248451ba9c77cedcf3c91078775e8b3bf59b (patch) | |
| tree | 57b0b823e349233e43a13c3ea99ae93dbf424e9f /Library/Formula | |
| parent | 4250018b8edb8fbf20ed8c4bdfa18a4c99506923 (diff) | |
| download | homebrew-7149248451ba9c77cedcf3c91078775e8b3bf59b.tar.bz2 | |
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.
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/gfortran.rb | 58 |
1 files changed, 40 insertions, 18 deletions
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 <CurlDownloadStrategy +class GfortranPkgDownloadStrategy < CurlDownloadStrategy def stage # The 4.2.4 compiler is distributed as a OS X 10.5 # package- a single flat xar archive instead of a @@ -34,11 +34,18 @@ class Gfortran < Formula end else # Lion - - # Only version released so far is for XCode 4.1 - url 'http://r.research.att.com/gfortran-lion-5666-3.pkg' - md5 '7eb140822c89bec17db5666859868b3b' - version "4.2.4-5666.3" + if MacOS.xcode_version >= '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 |
