Make nimrod usable

Closes Homebrew/homebrew#20078.
master
Adam Vandenberg 2013-05-29 10:26:30 -07:00
parent d6f88c1f6c
commit 7997bf68a6
1 changed files with 19 additions and 1 deletions

View File

@ -7,9 +7,27 @@ class Nimrod < Formula
head 'https://github.com/Araq/Nimrod.git'
# Install to libexec until an upstream fix appears for
# https://github.com/Araq/Nimrod/issues/459
def install
system "/bin/sh", "./build.sh"
inreplace 'install.sh', '$1/nimrod', '$1'
system "/bin/sh", "./install.sh", prefix
system "/bin/sh", "./install.sh", libexec
end
test do
(testpath/'hello.nim').write <<-EOS.undent
echo("Hi!")
EOS
system "#{libexec}/bin/nimrod compile --run hello.nim"
end
def caveats; <<-EOS.undent
Nimrod has been installed to #{libexec}.
The compiler will currently fail to find system.nim if called through a
symlink. To compile nim files, specify the full path to the compiler:
#{libexec}/bin/nimrod compile --run hello.nim
EOS
end
end