Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustup-init 1.3.0 (new formula) #14236

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Aliases/rustup
33 changes: 33 additions & 0 deletions Formula/rustup-init.rb
Original file line number Diff line number Diff line change
@@ -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