From patchwork Wed Jul 24 22:12:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Le Bihan X-Patchwork-Id: 1136571 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=free.fr Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45v8j66r03z9sMr for ; Thu, 25 Jul 2019 08:12:25 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 38A8C20114; Wed, 24 Jul 2019 22:12:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qEv5ESxxNwLM; Wed, 24 Jul 2019 22:12:20 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 3465A20523; Wed, 24 Jul 2019 22:12:20 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id C53D31BF5DC for ; Wed, 24 Jul 2019 22:12:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id C30AC8489F for ; Wed, 24 Jul 2019 22:12:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yqG0Ax8Rie6K for ; Wed, 24 Jul 2019 22:12:16 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from smtp6-g21.free.fr (smtp6-g21.free.fr [212.27.42.6]) by whitealder.osuosl.org (Postfix) with ESMTPS id 29F6981AE6 for ; Wed, 24 Jul 2019 22:12:16 +0000 (UTC) Received: from localhost.localdomain (unknown [IPv6:2a01:e0a:174:1c70:ae7b:a1ff:fec0:c2c7]) (Authenticated sender: eric.le.bihan.dev) by smtp6-g21.free.fr (Postfix) with ESMTPSA id 3AC9678034D for ; Wed, 24 Jul 2019 22:12:12 +0000 (UTC) From: Eric Le Bihan To: buildroot@buildroot.org Date: Thu, 25 Jul 2019 00:12:03 +0200 Message-Id: <20190724221207.9686-3-eric.le.bihan.dev@free.fr> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190724221207.9686-1-eric.le.bihan.dev@free.fr> References: <20190724221207.9686-1-eric.le.bihan.dev@free.fr> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 2/6] package/cargo-bin: declare as cargo provider X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" If cargo-bin is explicitly selected, then install binary in $(HOST_DIR) and declare package as cargo provider. Signed-off-by: Eric Le Bihan --- package/cargo-bin/cargo-bin.mk | 8 ++++++++ package/cargo/Config.in.host | 19 +++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/package/cargo-bin/cargo-bin.mk b/package/cargo-bin/cargo-bin.mk index 3614f7a53d..809bb64cae 100644 --- a/package/cargo-bin/cargo-bin.mk +++ b/package/cargo-bin/cargo-bin.mk @@ -9,5 +9,13 @@ CARGO_BIN_SITE = https://static.rust-lang.org/dist 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 +CARGO_BIN_PROVIDES = host-cargo + +ifeq ($(BR2_PACKAGE_HOST_CARGO_BIN),y) +define HOST_CARGO_BIN_INSTALL_CMDS + $(@D)/install.sh --prefix=$(HOST_DIR) --disable-ldconfig +endef +HOST_CARGO_BIN_POST_INSTALL_HOOKS += HOST_CARGO_INSTALL_CONFIG +endif $(eval $(host-generic-package)) diff --git a/package/cargo/Config.in.host b/package/cargo/Config.in.host index 82652fa980..bae30d2f57 100644 --- a/package/cargo/Config.in.host +++ b/package/cargo/Config.in.host @@ -7,10 +7,29 @@ config BR2_PACKAGE_HOST_CARGO https://crates.io/ +if BR2_PACKAGE_HOST_CARGO + +choice + prompt "Cargo provider" + help + Select a Cargo package manager provider + +config BR2_PACKAGE_HOST_CARGO_BIN + bool "host cargo (pre-built)" + depends on BR2_PACKAGE_HOST_RUST_BIN + select BR2_PACKAGE_HAS_HOST_CARGO + help + This package will install a pre-built version of Cargo. + +endchoice + +endif + config BR2_PACKAGE_HAS_HOST_CARGO bool config BR2_PACKAGE_PROVIDES_HOST_CARGO string depends on BR2_PACKAGE_HAS_HOST_CARGO + default "host-cargo-bin" if !BR2_PACKAGE_HOST_RUST depends on BR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS