homebrew-core/Formula/rakudo-star.rb
2018-10-03 16:36:24 +02:00

47 lines
1.6 KiB
Ruby

class RakudoStar < Formula
desc "Perl 6 compiler"
homepage "https://rakudo.org/"
url "https://rakudo.perl6.org/downloads/star/rakudo-star-2018.06.tar.gz"
sha256 "309fbaaf441866ee9454451e83e90e4a21391944d475eacda93f48c7671da888"
revision 1
bottle do
sha256 "f923414c9bef7029794d7c14ddd86a65feeda75b1cb388d2f04f48da6639d5c3" => :mojave
sha256 "916cc805c8081cd1a5afaffcfd103c0b2d14ad3e3302858b1fa0f3720d1b2c3f" => :high_sierra
sha256 "1dda81452078578e44cfcf50b2bd4241573094b72ae4794771f2d7e5d57a5dae" => :sierra
end
depends_on "gmp"
depends_on "icu4c"
depends_on "libffi"
depends_on "pcre"
conflicts_with "parrot"
def install
libffi = Formula["libffi"]
ENV.remove "CPPFLAGS", "-I#{libffi.include}"
ENV.prepend "CPPFLAGS", "-I#{libffi.lib}/libffi-#{libffi.version}/include"
ENV.deparallelize # An intermittent race condition causes random build failures.
system "perl", "Configure.pl", "--prefix=#{prefix}",
"--backends=moar", "--gen-moar"
system "make"
system "make", "install"
# Panda is now in share/perl6/site/bin, so we need to symlink it too.
bin.install_symlink Dir[share/"perl6/site/bin/*"]
# Move the man pages out of the top level into share.
# Not all backends seem to generate man pages at this point (moar does not, parrot does),
# so we need to check if the directory exists first.
mv "#{prefix}/man", share if File.directory?("#{prefix}/man")
end
test do
out = `#{bin}/perl6 -e 'loop (my $i = 0; $i < 10; $i++) { print $i }'`
assert_equal "0123456789", out
assert_equal 0, $CHILD_STATUS.exitstatus
end
end