aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGaëtan Lehmann2014-03-14 11:35:57 +0100
committerMike McQuaid2014-03-24 17:22:42 +0000
commit90f8dbb20259db82de4d848b3c93cd99901762c3 (patch)
tree8f470224494ad5f29632a21120128623daff9297
parent27c3e82a333fc664f2712982c09caf9f5c1896d6 (diff)
downloadhomebrew-90f8dbb20259db82de4d848b3c93cd99901762c3.tar.bz2
fsharp 3.1.1.6 (new formula)
-rw-r--r--Library/Formula/fsharp.rb44
1 files changed, 44 insertions, 0 deletions
diff --git a/Library/Formula/fsharp.rb b/Library/Formula/fsharp.rb
new file mode 100644
index 000000000..b4e86d486
--- /dev/null
+++ b/Library/Formula/fsharp.rb
@@ -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