blob: 792644a1e9a54eda10205e7eb830d3570703a0b3 (
plain)
| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
 | require 'formula'
class Rust < Formula
  homepage 'http://www.rust-lang.org/'
  url 'https://static.rust-lang.org/dist/rustc-1.0.0-beta.2-src.tar.gz'
  version "1.0.0-beta.2"
  sha256 '969f20bfec588456af8ab81c9b00ef46df075bf9ac9955e42a87b1f39cb99771'
  head 'https://github.com/rust-lang/rust.git'
  bottle do
    sha256 "b2daf887ed5bd0d52dd5b96d3ddab38901d63c1408534660138bbf05bac922c8" => :yosemite
    sha256 "7c49753fb3e7f80eedea6122652d307f71fe9426a124abbd0936ae91871006e9" => :mavericks
    sha256 "96800a3840fd0e929216d22ff768c839ed7fb3046c62ca67b8793af6e72e9fc3" => :mountain_lion
  end
  def install
    args = ["--prefix=#{prefix}"]
    args << "--disable-rpath" if build.head?
    args << "--enable-clang" if ENV.compiler == :clang
    args << "--release-channel=beta" unless build.head?
    system "./configure", *args
    system "make"
    system "make install"
  end
  test do
    system "#{bin}/rustdoc", "-h"
    (testpath/"hello.rs").write <<-EOS.undent
    fn main() {
      println!("Hello World!");
    }
    EOS
    system "#{bin}/rustc", "hello.rs"
    assert_equal "Hello World!\n", `./hello`
  end
end
 |