diff options
| author | Adam C. Foltzer | 2015-01-15 14:24:35 -0800 |
|---|---|---|
| committer | Jack Nagel | 2015-01-20 22:13:48 -0500 |
| commit | c5a214ce3e8cb93cef7557e7f97ad173e31e3ec4 (patch) | |
| tree | 16a861809642fb26e6328660d1fcb9ce9fcd2097 /Library/Formula | |
| parent | 5e2945ad5b2d1b91a615a33ac7751da6ca6d3df7 (diff) | |
| download | homebrew-c5a214ce3e8cb93cef7557e7f97ad173e31e3ec4.tar.bz2 | |
improve the idris formula
- Add a distinction between stable and HEAD
- Add a recommended dependency on libffi so that the interpreter can
execute IO actions dynamically
- Add the release flag to stable builds
Closes #35918.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/idris.rb | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/Library/Formula/idris.rb b/Library/Formula/idris.rb index 21273b97f..a6c6ce362 100644 --- a/Library/Formula/idris.rb +++ b/Library/Formula/idris.rb @@ -1,4 +1,3 @@ -require "formula" require "language/haskell" class Idris < Formula @@ -19,8 +18,14 @@ class Idris < Formula depends_on "cabal-install" => :build depends_on "gmp" + depends_on "libffi" => :recommended + depends_on "pkg-config" => :build if build.with? "libffi" + def install - install_cabal_package + flags = [] + flags << "-f FFI" if build.with? "libffi" + flags << "-f release" if build.stable? + install_cabal_package flags end test do @@ -32,5 +37,11 @@ class Idris < Formula shell_output "#{bin}/idris #{testpath}/hello.idr -o #{testpath}/hello" result = shell_output "#{testpath}/hello" assert_match /Hello, Homebrew!/, result + + if build.with? "libffi" + cmd = "#{bin}/idris --exec 'putStrLn \"Hello, interpreter!\"'" + result = shell_output cmd + assert_match /Hello, interpreter!/, result + end end end |
