2012-01-23 19:34:07 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Rust < Formula
|
|
|
|
homepage 'http://www.rust-lang.org/'
|
2012-07-29 18:20:24 +00:00
|
|
|
url 'http://dl.rust-lang.org/dist/rust-0.3.1.tar.gz'
|
|
|
|
sha256 'eb99ff2e745ecb6eaf01d4caddebce397a2b4cda6836a051cb2d493b9cedd018'
|
2012-01-23 19:34:07 +00:00
|
|
|
|
2012-03-18 20:33:24 +00:00
|
|
|
fails_with :clang do
|
|
|
|
build 318
|
|
|
|
cause "cannot initialize a parameter of type 'volatile long long *' with an rvalue of type 'int *'"
|
|
|
|
end
|
|
|
|
|
2012-08-26 03:28:54 +00:00
|
|
|
def patches
|
|
|
|
# fix for Mountain Lion's clang 4.0
|
|
|
|
# should be part of next release (commit 50f2db4)
|
2012-09-26 22:33:40 +00:00
|
|
|
# fix for Mountain Lion's clang 4.1
|
|
|
|
# should be part of next release (commit 25bc65b)
|
2012-08-26 03:28:54 +00:00
|
|
|
DATA
|
|
|
|
end
|
|
|
|
|
2012-01-23 19:34:07 +00:00
|
|
|
def install
|
2012-08-26 03:28:54 +00:00
|
|
|
args = ["--prefix=#{prefix}"]
|
|
|
|
args << "--enable-clang" if ENV.compiler == :clang
|
|
|
|
system "./configure", *args
|
2012-01-23 19:34:07 +00:00
|
|
|
system "make"
|
|
|
|
system "make install"
|
|
|
|
end
|
|
|
|
|
|
|
|
def test
|
|
|
|
system "#{bin}/rustc"
|
|
|
|
system "#{bin}/rustdoc"
|
|
|
|
system "#{bin}/cargo"
|
|
|
|
end
|
|
|
|
end
|
2012-08-26 03:28:54 +00:00
|
|
|
|
|
|
|
__END__
|
|
|
|
diff --git a/configure b/configure
|
|
|
|
index 06bddcc..040bae9 100755
|
|
|
|
--- a/configure
|
|
|
|
+++ b/configure
|
|
|
|
@@ -400,7 +400,7 @@ then
|
|
|
|
| cut -d ' ' -f 2)
|
|
|
|
|
|
|
|
case $CFG_CLANG_VERSION in
|
|
|
|
- (3.0svn | 3.0 | 3.1)
|
2012-09-26 22:33:40 +00:00
|
|
|
+ (3.0svn | 3.0 | 3.1 | 4.0 | 4.1)
|
2012-08-26 03:28:54 +00:00
|
|
|
step_msg "found ok version of CLANG: $CFG_CLANG_VERSION"
|
|
|
|
CFG_C_COMPILER="clang"
|
|
|
|
;;
|