aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/qrupdate.rb
blob: 0fdce851b0358baff10a29ccd19e72d3ed9825b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
require 'formula'

class Qrupdate < Formula
  homepage 'http://sourceforge.net/projects/qrupdate/'
  url 'http://downloads.sourceforge.net/qrupdate/qrupdate-1.1.1.tar.gz'
  sha1 '8fbaba202b0d4bf80852b2dc6c8d1d4b90b816d4'

  depends_on 'dotwrp'

  def install
    ENV.fortran
    ENV['PREFIX'] = prefix
    inreplace 'Makeconf' do |s|
      # as per the caveats in the gfortran formula:
      s.gsub! /^(FC=).*/, "\\1#{HOMEBREW_PREFIX}/bin/gfortran"
      s.gsub! /^(FFLAGS=).*/, "\\1"+ENV["FCFLAGS"]
      s.gsub! /^(BLAS=).*/, "\\1#{ENV["LDFLAGS"]} -ldotwrp -framework Accelerate"
      s.gsub! /^(LAPACK=).*/, "\\1#{ENV["LDFLAGS"]} -ldotwrp -framework Accelerate"
    end
    cd "./src"
    inreplace 'Makefile' do |s|
      s.gsub! 'install -D', 'install'
    end
    lib.mkpath
    system "make -j 1 install"
  end
end