fsharp 3.1.1.6 (new formula)

master
Gaëtan Lehmann 2014-03-14 11:35:57 +01:00 committed by Mike McQuaid
parent 6059b631bd
commit f154ece53b
1 changed files with 44 additions and 0 deletions

44
Formula/fsharp.rb Normal file
View File

@ -0,0 +1,44 @@
require "formula"
class Fsharp < Formula
homepage "http://fsharp.org/"
url "https://github.com/fsharp/fsharp.git", :tag => "3.1.1.6"
depends_on :automake
depends_on :autoconf
depends_on "pkg-config" => :build
depends_on "mono"
def install
system "./autogen.sh", "--prefix=#{prefix}"
system "make"
system "make", "install"
end
test do
test_str = "Hello Homebrew"
# fsharpi and fsharpc needs mono to be in the PATH
ENV.prepend_path 'PATH', Formula["mono"].bin
output = `echo 'printfn "#{test_str}"; exit 0' | #{bin}/fsharpi`
assert $?.success?
assert output.include? test_str
hello = (testpath/"hello.fs")
hello.write("printfn \"#{test_str}\"\n")
`#{bin}/fsharpc #{hello}`
assert $?.success?
# make sure to find the fsharp assemblies even if the user has not set
# MONO_GAC_PREFIX to HOMEBREW_PREFIX
ENV["MONO_GAC_PREFIX"] = prefix
output = `#{Formula["mono"].bin}/mono hello.exe`
assert $?.success?
assert_equal test_str, output.strip
end
def caveats; <<-EOS.undent
To run programs built with fsharpc you need to set:
export MONO_GAC_PREFIX="#{HOMEBREW_PREFIX}"
EOS
end
end