rustup-init 1.3.0 (new formula)

Closes #14236.

Signed-off-by: ilovezfs <ilovezfs@icloud.com>
This commit is contained in:
Christopher MacGown 2017-06-04 10:12:24 -07:00 committed by ilovezfs
parent 62674e2cef
commit 3dc86be36a
2 changed files with 34 additions and 0 deletions

1
Aliases/rustup Symbolic link
View file

@ -0,0 +1 @@
../Formula/rustup-init.rb

33
Formula/rustup-init.rb Normal file
View file

@ -0,0 +1,33 @@
class RustupInit < Formula
desc "The Rust toolchain installer"
homepage "https://github.com/rust-lang-nursery/rustup.rs"
url "https://github.com/rust-lang-nursery/rustup.rs/archive/1.3.0.tar.gz"
sha256 "c0ca06b70104fed8f1de5a6f5ecfd8478e8bc03f15add8d7896b86b3b15e81e3"
depends_on "rust" => :build
def install
cargo_home = buildpath/"cargo_home"
cargo_home.mkpath
ENV["CARGO_HOME"] = cargo_home
system "cargo", "build", "--release", "--verbose"
bin.install buildpath/"target/release/rustup-init"
end
test do
ENV["CARGO_HOME"] = testpath/".cargo"
ENV["RUSTUP_HOME"] = testpath/".multirust"
system bin/"rustup-init", "-y"
(testpath/"hello.rs").write <<-EOS.undent
fn main() {
println!("Hello World!");
}
EOS
system testpath/".cargo/bin/rustc", "hello.rs"
assert_equal "Hello World!", shell_output("./hello").chomp
end
end