2011-01-27 14:40:04 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Nimrod < Formula
|
2013-01-04 16:11:25 +00:00
|
|
|
homepage 'http://nimrod-code.org/'
|
2013-05-24 00:25:20 +00:00
|
|
|
url 'http://nimrod-code.org/download/nimrod_0.9.2.zip'
|
|
|
|
sha1 '326ecd61d6df45afdc04cb8685ef46f8fb8f9e47'
|
2012-02-15 15:28:21 +00:00
|
|
|
|
|
|
|
head 'https://github.com/Araq/Nimrod.git'
|
2011-01-27 14:40:04 +00:00
|
|
|
|
2013-05-29 17:26:30 +00:00
|
|
|
# Install to libexec until an upstream fix appears for
|
|
|
|
# https://github.com/Araq/Nimrod/issues/459
|
2011-01-27 14:40:04 +00:00
|
|
|
def install
|
|
|
|
system "/bin/sh", "./build.sh"
|
|
|
|
inreplace 'install.sh', '$1/nimrod', '$1'
|
2013-05-29 17:26:30 +00:00
|
|
|
system "/bin/sh", "./install.sh", libexec
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
(testpath/'hello.nim').write <<-EOS.undent
|
|
|
|
echo("Hi!")
|
|
|
|
EOS
|
2013-06-09 02:26:24 +00:00
|
|
|
system "#{libexec}/bin/nimrod", "compile", "--run", "hello.nim"
|
2013-05-29 17:26:30 +00:00
|
|
|
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
|
2011-01-27 14:40:04 +00:00
|
|
|
end
|
|
|
|
end
|