[RFC,2/7] package/cargo-bin: install if rust-bin selected
diff mbox series

Message ID 20191105211259.27673-3-eric.le.bihan.dev@free.fr
State New
Headers show
Series
  • Rust: drop cargo package
Related show

Commit Message

Eric Le Bihan Nov. 5, 2019, 9:12 p.m. UTC
If host-rust-bin, the pre-built Rust compiler, is selected as a rustc
provider, then also install the pre-built cargo binary to be coherent.

Also install configuration file, reusing the one from rust package.

Signed-off-by: Eric Le Bihan <eric.le.bihan.dev@free.fr>
---
 package/cargo-bin/cargo-bin.mk | 7 +++++++
 1 file changed, 7 insertions(+)

Patch
diff mbox series

diff --git a/package/cargo-bin/cargo-bin.mk b/package/cargo-bin/cargo-bin.mk
index 3614f7a53d..4a3d52e43b 100644
--- a/package/cargo-bin/cargo-bin.mk
+++ b/package/cargo-bin/cargo-bin.mk
@@ -10,4 +10,11 @@  CARGO_BIN_SOURCE = cargo-$(CARGO_BIN_VERSION)-$(RUSTC_HOST_NAME).tar.xz
 CARGO_BIN_LICENSE = Apache-2.0 or MIT
 CARGO_BIN_LICENSE_FILES = LICENSE-APACHE LICENSE-MIT
 
+ifeq ($(BR2_PACKAGE_HOST_RUST_BIN),y)
+define HOST_CARGO_BIN_INSTALL_CMDS
+       $(@D)/install.sh --prefix=$(HOST_DIR) --disable-ldconfig
+endef
+HOST_CARGO_BIN_POST_INSTALL_HOOKS += HOST_RUST_INSTALL_CARGO_CONFIG
+endif
+
 $(eval $(host-generic-package))