Skip to content

Instantly share code, notes, and snippets.

@jbeezley
Created March 1, 2012 09:57
Show Gist options
  • Save jbeezley/1948646 to your computer and use it in GitHub Desktop.
Save jbeezley/1948646 to your computer and use it in GitHub Desktop.
A homebrew formula for wrf-fire.
require 'formula'
class WrfFire < Formula
homepage 'http://www.openwfm.org'
head 'https://github.com/jbeezley/wrf-fire.git', :using => :git
depends_on 'netcdf'
def install
unless `/usr/local/bin/nc-config --has-f77`.strip == 'yes'
onoe "This formula requires netcdf built with fortran support."
puts "Reinstall netcdf with --enable-fortran"
exit 1
end
cd "wrfv2_fire" do
system "./configure_auto", "-f", "gfortran", "-c", "gcc"
system "./compile", "-j1", "em_real", "em_fire"
unless File.exist? "main/wrf.exe"
onoe "Build failed!"
exit 1
end
bin.install Dir['main/*.exe']
bin.install 'external/io_netcdf/diffwrf'
for f in Dir['test/**/*.exe']
File.delete f
end
for f in Dir['test/em_real/*','test/em_fire/**']
if File.symlink? f
g=File.readlink f
File.delete f
if File.exists? g
FileUtils.copy_file g,f
end
end
end
wrfreal.install Dir['test/em_real/*']
wrffire.install Dir['test/em_fire/*']
end
end
def wrf; share+"wrf"; end
def wrfreal; wrf+"real"; end
def wrffire; wrf+"fire"; end
def test
system "true"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment