2014-11-04 20:11:27 +00:00
|
|
|
require "language/haskell"
|
|
|
|
|
|
|
|
class Idris < Formula
|
|
|
|
include Language::Haskell::Cabal
|
|
|
|
|
|
|
|
homepage "http://www.idris-lang.org"
|
2015-01-15 18:13:15 +00:00
|
|
|
url "https://github.com/idris-lang/Idris-dev/archive/v0.9.16.tar.gz"
|
|
|
|
sha1 "01f794c4e516454b8352266c26c92549e90c708f"
|
2014-11-04 20:11:27 +00:00
|
|
|
head "https://github.com/idris-lang/Idris-dev.git"
|
|
|
|
|
2014-11-05 17:22:21 +00:00
|
|
|
bottle do
|
2015-01-17 20:36:36 +00:00
|
|
|
sha1 "c25ba4b91264c187485111c5b8c18670c7f0441b" => :yosemite
|
|
|
|
sha1 "df1773cb1800d6c629db9ba194666faf0019de31" => :mavericks
|
|
|
|
sha1 "bbbe93cbd829bb02a9cdbb680805470f29702bbb" => :mountain_lion
|
2014-11-05 17:22:21 +00:00
|
|
|
end
|
|
|
|
|
2014-11-04 20:11:27 +00:00
|
|
|
depends_on "ghc" => :build
|
|
|
|
depends_on "cabal-install" => :build
|
|
|
|
depends_on "gmp"
|
|
|
|
|
2015-01-15 22:24:35 +00:00
|
|
|
depends_on "libffi" => :recommended
|
|
|
|
depends_on "pkg-config" => :build if build.with? "libffi"
|
|
|
|
|
2014-11-04 20:11:27 +00:00
|
|
|
def install
|
2015-01-15 22:24:35 +00:00
|
|
|
flags = []
|
|
|
|
flags << "-f FFI" if build.with? "libffi"
|
|
|
|
flags << "-f release" if build.stable?
|
|
|
|
install_cabal_package flags
|
2014-11-04 20:11:27 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
(testpath/"hello.idr").write <<-EOS.undent
|
|
|
|
module Main
|
|
|
|
main : IO ()
|
|
|
|
main = putStrLn "Hello, Homebrew!"
|
|
|
|
EOS
|
2014-11-06 22:40:28 +00:00
|
|
|
shell_output "#{bin}/idris #{testpath}/hello.idr -o #{testpath}/hello"
|
|
|
|
result = shell_output "#{testpath}/hello"
|
2014-11-04 20:11:27 +00:00
|
|
|
assert_match /Hello, Homebrew!/, result
|
2015-01-15 22:24:35 +00:00
|
|
|
|
|
|
|
if build.with? "libffi"
|
|
|
|
cmd = "#{bin}/idris --exec 'putStrLn \"Hello, interpreter!\"'"
|
|
|
|
result = shell_output cmd
|
|
|
|
assert_match /Hello, interpreter!/, result
|
|
|
|
end
|
2014-11-04 20:11:27 +00:00
|
|
|
end
|
|
|
|
end
|