aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorPhilip Wernersbach2014-12-14 17:44:39 -0500
committerMisty De Meo2014-12-14 21:59:08 -0800
commitee66a7cd8f0d64f67a469dd437cb657ae7b5bcf3 (patch)
tree089efc577398925fa86f3876f05808fa4b0cfa53 /Library/Formula
parentc5157ca4977f6c1e3472bf952ac9931480a936ca (diff)
downloadhomebrew-ee66a7cd8f0d64f67a469dd437cb657ae7b5bcf3.tar.bz2
nimrod 0.9.6, add HEAD
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/nimrod.rb69
1 files changed, 50 insertions, 19 deletions
diff --git a/Library/Formula/nimrod.rb b/Library/Formula/nimrod.rb
index 3749c8563..96291696e 100644
--- a/Library/Formula/nimrod.rb
+++ b/Library/Formula/nimrod.rb
@@ -1,33 +1,64 @@
require 'formula'
class Nimrod < Formula
- homepage 'http://nimrod-code.org/'
- url 'http://nimrod-code.org/download/nimrod_0.9.2.zip'
- sha1 '326ecd61d6df45afdc04cb8685ef46f8fb8f9e47'
+ homepage "http://nimrod-lang.org/"
- head 'https://github.com/Araq/Nimrod.git'
+ stable do
+ url "http://nimrod-lang.org/download/nimrod_0.9.6.zip"
+ sha1 "a0be99cd67ca2283c6cf076bb7edee74d2f32dc5"
+
+ # This patch fixes an OS X-specific codegen issue.
+ # See http://github.com/Araq/Nimrod/issues/1701
+ patch :DATA
+ end
+
+ head "https://github.com/Araq/Nimrod.git", :branch => "devel"
- # 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", libexec
+ # For some reason the mingw variable doesn't get passed through,
+ # so hardcode it. This is fixed in HEAD.
+ inreplace "compiler/nimrod.ini", "${mingw}", "mingw32" unless build.head?
+
+ system "/bin/sh", "build.sh"
+ system "/bin/sh", "install.sh", prefix
+
+ if build.stable?
+ (prefix/"nimrod").install "compiler"
+ bin.install_symlink prefix/"nimrod/bin/nimrod"
+ else
+ (prefix/"nim").install "compiler"
+ bin.install_symlink prefix/"nim/bin/nim"
+ bin.install_symlink prefix/"nim/bin/nim" => "nimrod"
+ end
end
test do
- (testpath/'hello.nim').write <<-EOS.undent
+ (testpath/"hello.nim").write <<-EOS.undent
echo("Hi!")
EOS
- system "#{libexec}/bin/nimrod", "compile", "--run", "hello.nim"
+ system "#{bin}/nimrod", "compile", "--run", "hello.nim"
end
+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:
+__END__
+--- a/lib/pure/concurrency/cpuinfo.nim
++++ b/lib/pure/concurrency/cpuinfo.nim
+@@ -20,15 +20,15 @@ when defined(linux):
+ import linux
- #{libexec}/bin/nimrod compile --run hello.nim
- EOS
- end
-end
+ when defined(freebsd) or defined(macosx):
+- {.emit:"#include <sys/types.h>".}
++ {.emit:"#include <sys/types.h>\n".}
+
+ when defined(openbsd) or defined(netbsd):
+- {.emit:"#include <sys/param.h>".}
++ {.emit:"#include <sys/param.h>\n".}
+
+ when defined(macosx) or defined(bsd):
+ # we HAVE to emit param.h before sysctl.h so we cannot use .header here
+ # either. The amount of archaic bullshit in Poonix based OSes is just insane.
+- {.emit:"#include <sys/sysctl.h>".}
++ {.emit:"#include <sys/sysctl.h>\n".}
+ const
+ CTL_HW = 6
+ HW_AVAILCPU = 25