[vlc-devel] [PATCH 4/8] contrib: add rustup
Thomas Guillem
thomas at gllm.fr
Tue Aug 25 16:45:05 CEST 2020
From: Kartik Ohri <kartikohri13 at gmail.com>
This will install cargo and rustup into contrib/bin/.cargo
This installation will be used by default for all rust contrib builds.
The correct cargo target will be automatically installed when needed.
---
contrib/src/rustup/SHA512SUMS | 1 +
contrib/src/rustup/rules.mak | 29 +++++++++++++++++++++++++++++
2 files changed, 30 insertions(+)
create mode 100644 contrib/src/rustup/SHA512SUMS
create mode 100644 contrib/src/rustup/rules.mak
diff --git a/contrib/src/rustup/SHA512SUMS b/contrib/src/rustup/SHA512SUMS
new file mode 100644
index 00000000000..6101c68ba6c
--- /dev/null
+++ b/contrib/src/rustup/SHA512SUMS
@@ -0,0 +1 @@
+14a978a3cf699956722d8443070b9f8a043f1252cc1a7ed300b14637a0e6d654f34088d4403790c676500cbab327e30fdb7f81be0b9bde29e552143f26912ac7 rustup-1.22.1.tar.gz
diff --git a/contrib/src/rustup/rules.mak b/contrib/src/rustup/rules.mak
new file mode 100644
index 00000000000..05ae6c03092
--- /dev/null
+++ b/contrib/src/rustup/rules.mak
@@ -0,0 +1,29 @@
+# cargo/cargo-c installation via rustup
+
+RUSTUP_VERSION=1.22.1
+RUSTUP_URL=https://github.com/rust-lang/rustup/archive/$(RUSTUP_VERSION).tar.gz
+
+RUSTUP = RUSTUP_HOME=$(CARGO_HOME) $(CARGO_HOME)/bin/rustup
+
+$(TARBALLS)/rustup-$(RUSTUP_VERSION).tar.gz:
+ $(call download_pkg,$(RUSTUP_URL),rustup)
+
+.sum-rustup: rustup-$(RUSTUP_VERSION).tar.gz
+
+rustup: rustup-$(RUSTUP_VERSION).tar.gz .sum-rustup
+ $(UNPACK)
+ $(MOVE)
+
+$(CARGO_HOME)/bin/rustup: rustup
+ cd $< && RUSTUP_INIT_SKIP_PATH_CHECK=yes \
+ RUSTUP_HOME=$(CARGO_HOME) CARGO_HOME=$(CARGO_HOME) \
+ ./rustup-init.sh --no-modify-path -y
+
+.cargo: $(CARGO_HOME)/bin/rustup
+ $(RUSTUP) default stable
+ $(RUSTUP) target add $(RUST_TARGET)
+ touch $@
+
+.cargo-c: .cargo
+ $(CARGO) install cargo-c
+ touch $@
--
2.28.0
More information about the vlc-devel
mailing list