blob: 99b3cbf8a384bad485e93b991c9c531b276a64d0 (
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
  | 
require 'formula'
class Rust < Formula
  homepage 'http://www.rust-lang.org/'
  url 'https://static.rust-lang.org/dist/rustc-1.0.0-alpha.2-src.tar.gz'
  version "1.0.0-alpha.2"
  sha256 'a931b945e98f409df68fdff23e98b688024461c28901106896e73708381956c8'
  head 'https://github.com/rust-lang/rust.git'
  bottle do
    sha1 "c1a024f85c9af99d140762de3c87738b00ead44e" => :yosemite
    sha1 "325c8021a0c911e39eb536879698aa5e21e2ab05" => :mavericks
    sha1 "e0bbe731065a341f65722ed2e6f9e3861d8bb702" => :mountain_lion
  end
  def install
    args = ["--prefix=#{prefix}"]
    args << "--disable-rpath" if build.head?
    args << "--enable-clang" if ENV.compiler == :clang
    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
  |