2018-12-04 17:51:45 +00:00
|
|
|
class Moarvm < Formula
|
|
|
|
desc "Virtual machine for NQP and Rakudo Perl 6"
|
|
|
|
homepage "https://moarvm.org"
|
2019-03-11 08:40:54 +00:00
|
|
|
url "https://moarvm.org/releases/MoarVM-2019.03.tar.gz"
|
|
|
|
sha256 "24b00e5228894fa6f70e9caa73114e5c6ec3686b6305e6e463807a93f70ffc04"
|
2018-12-04 17:51:45 +00:00
|
|
|
|
2019-01-04 07:02:49 +00:00
|
|
|
bottle do
|
2019-03-11 09:27:38 +00:00
|
|
|
sha256 "704a22721fb2a0d96d90903cdd4a6dd9c6da63ed1be33f466d26ffe5380d4024" => :mojave
|
|
|
|
sha256 "c2f02994cca5fd03fc1a4a294dad62369c7169795cf197d780c4f8b0f2f683cc" => :high_sierra
|
|
|
|
sha256 "516d7401ebabc18938e221c2e272b8a1435938f304846ed364c18d3c6464634c" => :sierra
|
2019-01-04 07:02:49 +00:00
|
|
|
end
|
|
|
|
|
2018-12-04 17:51:45 +00:00
|
|
|
depends_on "libatomic_ops"
|
|
|
|
depends_on "libffi"
|
|
|
|
depends_on "libtommath"
|
|
|
|
depends_on "libuv"
|
|
|
|
|
2019-03-11 08:40:54 +00:00
|
|
|
resource("nqp-2019.03") do
|
|
|
|
url "https://rakudo.perl6.org/downloads/nqp/nqp-2019.03.tar.gz"
|
|
|
|
sha256 "03ddced47583189a5ff316c05350f6f39c15f75ce44d38b409a4bb1128857fa0"
|
2018-12-04 17:51:45 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def install
|
|
|
|
libffi = Formula["libffi"]
|
|
|
|
ENV.prepend "CPPFLAGS", "-I#{libffi.opt_lib}/libffi-#{libffi.version}/include"
|
|
|
|
configure_args = %W[
|
|
|
|
--has-libatomic_ops
|
|
|
|
--has-libffi
|
|
|
|
--has-libtommath
|
|
|
|
--has-libuv
|
|
|
|
--optimize
|
|
|
|
--prefix=#{prefix}
|
|
|
|
]
|
|
|
|
system "perl", "Configure.pl", *configure_args
|
|
|
|
system "make", "realclean"
|
|
|
|
system "make"
|
|
|
|
system "make", "install"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
2019-03-11 08:40:54 +00:00
|
|
|
testpath.install resource("nqp-2019.03")
|
2018-12-04 17:51:45 +00:00
|
|
|
out = Dir.chdir("src/vm/moar/stage0") do
|
|
|
|
shell_output("#{bin}/moar nqp.moarvm -e 'for (0,1,2,3,4,5,6,7,8,9) { print($_) }'")
|
|
|
|
end
|
|
|
|
assert_equal "0123456789", out
|
|
|
|
end
|
|
|
|
end
|