2014-06-29 10:42:53 +00:00
|
|
|
class Mercury < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Logic/functional programming language"
|
2014-06-29 10:42:53 +00:00
|
|
|
homepage "http://mercurylang.org/"
|
2015-02-26 17:31:44 +00:00
|
|
|
url "http://dl.mercurylang.org/release/mercury-srcdist-14.01.1.tar.gz"
|
2015-08-03 12:55:31 +00:00
|
|
|
sha256 "98f7cbde7a7425365400feef3e69f1d6a848b25dc56ba959050523d546c4e88b"
|
2014-06-29 10:42:53 +00:00
|
|
|
|
|
|
|
bottle do
|
2015-03-03 12:41:20 +00:00
|
|
|
sha1 "82730c120043d0a741d8deeceb79c82b7e232549" => :yosemite
|
|
|
|
sha1 "70e9c006f0287ff012441f469d1fa39b6ec5a291" => :mavericks
|
|
|
|
sha1 "0ab2f708f25879f4b894d89a271ddb23be0d984e" => :mountain_lion
|
2014-06-29 10:42:53 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
depends_on "erlang" => :optional
|
|
|
|
depends_on "homebrew/science/hwloc" => :optional
|
|
|
|
depends_on "mono" => :optional
|
|
|
|
|
|
|
|
def install
|
|
|
|
args = ["--prefix=#{prefix}",
|
|
|
|
"--mandir=#{man}",
|
|
|
|
"--infodir=#{info}",
|
|
|
|
"--disable-dependency-tracking",
|
|
|
|
"--enable-java-grade"]
|
|
|
|
|
|
|
|
args << "--enable-erlang-grade" if build.with? "erlang"
|
|
|
|
args << "--with-hwloc" if build.with? "hwloc"
|
2014-08-14 17:37:45 +00:00
|
|
|
args << "--enable-csharp-grade" if build.with? "mono"
|
2014-06-29 10:42:53 +00:00
|
|
|
|
|
|
|
system "./configure", *args
|
|
|
|
|
|
|
|
# The build system doesn't quite honour the mandir/infodir autoconf
|
|
|
|
# parameters.
|
2015-02-26 17:31:44 +00:00
|
|
|
system "make", "install", "PARALLEL=-j",
|
|
|
|
"INSTALL_MAN_DIR=#{man}",
|
|
|
|
"INSTALL_INFO_DIR=#{info}"
|
2014-06-29 10:42:53 +00:00
|
|
|
|
|
|
|
# Remove batch files for windows.
|
2015-02-26 17:31:44 +00:00
|
|
|
rm Dir.glob("#{bin}/*.bat")
|
2014-06-29 10:42:53 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
test_string = "Hello Homebrew\n"
|
|
|
|
path = testpath/"hello.m"
|
|
|
|
path.write <<-EOS
|
|
|
|
:- module hello.
|
|
|
|
:- interface.
|
|
|
|
:- import_module io.
|
|
|
|
:- pred main(io::di, io::uo) is det.
|
|
|
|
:- implementation.
|
|
|
|
main(IOState_in, IOState_out) :-
|
|
|
|
io.write_string("#{test_string}", IOState_in, IOState_out).
|
|
|
|
EOS
|
|
|
|
system "#{bin}/mmc", "--make", "hello"
|
|
|
|
assert File.exist?(testpath/"hello")
|
|
|
|
|
2015-02-26 17:31:44 +00:00
|
|
|
assert_equal test_string, shell_output("#{testpath}/hello")
|
2014-06-29 10:42:53 +00:00
|
|
|
end
|
|
|
|
end
|