rustup-init 1.3.0 (new formula)
Closes #14236. Signed-off-by: ilovezfs <ilovezfs@icloud.com>
This commit is contained in:
parent
62674e2cef
commit
3dc86be36a
2 changed files with 34 additions and 0 deletions
1
Aliases/rustup
Symbolic link
1
Aliases/rustup
Symbolic link
|
@ -0,0 +1 @@
|
|||
../Formula/rustup-init.rb
|
33
Formula/rustup-init.rb
Normal file
33
Formula/rustup-init.rb
Normal 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
|
Loading…
Reference in a new issue