package/cargo-bin: remove and use cargo-bin from rust-bin package
authorPatrick Havelange <patrick.havelange@essensium.com>
Fri, 7 Feb 2020 18:08:29 +0000 (19:08 +0100)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Mon, 27 Jul 2020 11:31:00 +0000 (13:31 +0200)
Rust upstream distributes tarballs with separate rust and cargo
binaries, but also tarballs with everything together. The latter
contains a bit more than what we need, so the download is slightly
larger than separate cargo-bin and rust-bin. But it simplifies our life
if we do the same in rust-bin as in rust (i.e. get both rust and cargo).

Signed-off-by: Patrick Havelange <patrick.havelange@essensium.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Tested-by: David Pierret <david.pierret@smile.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
DEVELOPERS
package/cargo-bin/cargo-bin.hash [deleted file]
package/cargo-bin/cargo-bin.mk [deleted file]
package/rust-bin/rust-bin.hash
package/rust-bin/rust-bin.mk
package/rust/rust.mk

index 03a132013e5606c618cb93e97216f7c6b466822c..ee840dbb8b681b1cd975cb84334a2adba510f419 100644 (file)
@@ -713,7 +713,6 @@ F:  package/gstreamer1/gst1-plugins-bayer2rgb-neon/
 N:     Eric Le Bihan <eric.le.bihan.dev@free.fr>
 F:     docs/manual/adding-packages-meson.txt
 F:     package/adwaita-icon-theme/
-F:     package/cargo-bin/
 F:     package/darkhttpd/
 F:     package/eudev/
 F:     package/execline/
diff --git a/package/cargo-bin/cargo-bin.hash b/package/cargo-bin/cargo-bin.hash
deleted file mode 100644 (file)
index 22cad3c..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-# From https://static.rust-lang.org/dist/cargo-0.41.0-i686-unknown-linux-gnu.tar.xz.sha256
-# Verified using https://static.rust-lang.org/dist/cargo-0.41.0-i686-unknown-linux-gnu.tar.xz.asc
-sha256 c48bc132f4025ff39b1b6dc52aef9d406c3f926ce05fe92d943ceab7a5fd6058  cargo-0.41.0-i686-unknown-linux-gnu.tar.xz
-# From https://static.rust-lang.org/dist/cargo-0.41.0-powerpc64le-unknown-linux-gnu.tar.xz.sha256
-# Verified using https://static.rust-lang.org/dist/cargo-0.41.0-powerpc64le-unknown-linux-gnu.tar.xz.asc
-sha256 7705f21d938a72ba6f01818661b2dea29183209940a335f18d1761e1e03d3710  cargo-0.41.0-powerpc64le-unknown-linux-gnu.tar.xz
-# From https://static.rust-lang.org/dist/cargo-0.41.0-x86_64-unknown-linux-gnu.tar.xz.sha256
-# Verified using https://static.rust-lang.org/dist/cargo-0.41.0-x86_64-unknown-linux-gnu.tar.xz.asc
-sha256 9b6ae643fa240c5ecbc1dc390f4020b6a683f25bac6f7437ebd4b9d32a8d0b6c  cargo-0.41.0-x86_64-unknown-linux-gnu.tar.xz
-# Locally generated
-sha256 8ada45cd9f843acf64e4722ae262c622a2b3b3007c7310ef36ac1061a30f6adb  LICENSE-APACHE
-sha256 23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3  LICENSE-MIT
-sha256 cbc759b1f17a2ac38fe3eb9e9563b1a08ba0f900611c49faaf68b46907b6d898  LICENSE-THIRD-PARTY
diff --git a/package/cargo-bin/cargo-bin.mk b/package/cargo-bin/cargo-bin.mk
deleted file mode 100644 (file)
index 246fdbf..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-################################################################################
-#
-# cargo-bin
-#
-################################################################################
-
-CARGO_BIN_VERSION = 0.41.0
-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
-
-ifeq ($(BR2_PACKAGE_HOST_RUST_BIN),y)
-define HOST_CARGO_BIN_INSTALL_CMDS
-       $(@D)/install.sh --prefix=$(HOST_DIR) --disable-ldconfig
-endef
-endif
-
-$(eval $(host-generic-package))
index 12195f29117b0bd78c0030879d8388e8e6475bce..5330b19d97a9af125ded4bb55517e9c495e23fd4 100644 (file)
@@ -1,9 +1,9 @@
-# From https://static.rust-lang.org/dist/rustc-1.40.0-i686-unknown-linux-gnu.tar.xz.sha256
-# Verified using https://static.rust-lang.org/dist/rustc-1.40.0-i686-unknown-linux-gnu.tar.xz.asc
-sha256 257e4789043098a5e3b4fa85ea988019f37d640a10f83d39ada00fb23e057b8a  rustc-1.40.0-i686-unknown-linux-gnu.tar.xz
-# From https://static.rust-lang.org/dist/rustc-1.40.0-x86_64-unknown-linux-gnu.tar.xz.sha256
-# Verified using https://static.rust-lang.org/dist/rustc-1.40.0-x86_64-unknown-linux-gnu.tar.xz.asc
-sha256 b1c00618b7a98156e88b14682508a503284f85748eab23de749a20dcc8847111  rustc-1.40.0-x86_64-unknown-linux-gnu.tar.xz
+# From https://static.rust-lang.org/dist/rust-1.40.0-i686-unknown-linux-gnu.tar.xz.sha256
+# Verified using https://static.rust-lang.org/dist/rust-1.40.0-i686-unknown-linux-gnu.tar.xz.asc
+sha256 82454e1b60b2bc24779d9c949cc0e1da43f3e423dbfc6b45b5afddf65829fc9d  rust-1.40.0-i686-unknown-linux-gnu.tar.xz
+# From https://static.rust-lang.org/dist/rust-1.40.0-x86_64-unknown-linux-gnu.tar.xz.sha256
+# Verified using https://static.rust-lang.org/dist/rust-1.40.0-x86_64-unknown-linux-gnu.tar.xz.asc
+sha256 37492d6467bcea611b2c7388aed50b655524f81410e255142ef6cfb6cef1ec53  rust-1.40.0-x86_64-unknown-linux-gnu.tar.xz
 # From https://static.rust-lang.org/dist/rust-std-1.40.0-aarch64-unknown-linux-gnu.tar.xz.sha256
 # Verified using https://static.rust-lang.org/dist/rust-std-1.40.0-aarch64-unknown-linux-gnu.tar.xz.asc
 sha256 1abd1865e8339c2cac6992a11f6f98b66fa2b97f67acaddcf1992e39a7001bfc  rust-std-1.40.0-aarch64-unknown-linux-gnu.tar.xz
index a5966768a45e0149f203448577f19511fc2a3855..52ca279c8dcdc7f70be708dd7fde412ae8095ff2 100644 (file)
@@ -10,18 +10,14 @@ RUST_BIN_LICENSE = Apache-2.0 or MIT
 RUST_BIN_LICENSE_FILES = LICENSE-APACHE LICENSE-MIT
 
 HOST_RUST_BIN_PROVIDES = host-rustc
-HOST_RUST_BIN_DEPENDENCIES = host-cargo-bin
 
-HOST_RUST_BIN_SOURCE = rustc-$(RUST_BIN_VERSION)-$(RUSTC_HOST_NAME).tar.xz
-
-HOST_RUST_BIN_EXTRA_DOWNLOADS = \
-       rust-std-$(RUST_BIN_VERSION)-$(RUSTC_HOST_NAME).tar.xz
+HOST_RUST_BIN_SOURCE = rust-$(RUST_BIN_VERSION)-$(RUSTC_HOST_NAME).tar.xz
 
 ifeq ($(BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS),y)
 HOST_RUST_BIN_EXTRA_DOWNLOADS += rust-std-$(RUST_BIN_VERSION)-$(RUSTC_TARGET_NAME).tar.xz
 endif
 
-HOST_RUST_BIN_LIBSTD_HOST_PREFIX = rust-std-$(RUST_BIN_VERSION)-$(RUSTC_HOST_NAME)/rust-std-$(RUSTC_HOST_NAME)
+HOST_RUST_BIN_LIBSTD_HOST_PREFIX = rust-std-$(RUSTC_HOST_NAME)
 
 define HOST_RUST_BIN_LIBSTD_EXTRACT
        mkdir -p $(@D)/std
@@ -31,36 +27,36 @@ define HOST_RUST_BIN_LIBSTD_EXTRACT
        )
        mkdir -p $(@D)/rustc/lib/rustlib/$(RUSTC_HOST_NAME)/lib
        cd $(@D)/rustc/lib/rustlib/$(RUSTC_HOST_NAME)/lib; \
-               ln -sf ../../../../../std/$(HOST_RUST_BIN_LIBSTD_HOST_PREFIX)/lib/rustlib/$(RUSTC_HOST_NAME)/lib/* .
+               ln -sf ../../../../../$(HOST_RUST_BIN_LIBSTD_HOST_PREFIX)/lib/rustlib/$(RUSTC_HOST_NAME)/lib/* .
 endef
 
 HOST_RUST_BIN_POST_EXTRACT_HOOKS += HOST_RUST_BIN_LIBSTD_EXTRACT
 
-HOST_RUST_BIN_INSTALL_OPTS = \
+HOST_RUST_BIN_INSTALL_COMMON_OPTS = \
        --prefix=$(HOST_DIR) \
        --disable-ldconfig
 
+HOST_RUST_BIN_INSTALL_OPTS = \
+       $(HOST_RUST_BIN_INSTALL_COMMON_OPTS) \
+       --components=rustc,cargo,rust-std-$(RUSTC_HOST_NAME)
+
 define HOST_RUST_BIN_INSTALL_RUSTC
        (cd $(@D); \
                ./install.sh $(HOST_RUST_BIN_INSTALL_OPTS))
 endef
 
-define HOST_RUST_BIN_INSTALL_LIBSTD_HOST
-       (cd $(@D)/std/rust-std-$(RUST_BIN_VERSION)-$(RUSTC_HOST_NAME); \
-               ./install.sh $(HOST_RUST_BIN_INSTALL_OPTS))
-endef
-
 ifeq ($(BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS),y)
 define HOST_RUST_BIN_INSTALL_LIBSTD_TARGET
        (cd $(@D)/std/rust-std-$(RUST_BIN_VERSION)-$(RUSTC_TARGET_NAME); \
-               ./install.sh $(HOST_RUST_BIN_INSTALL_OPTS))
+               ./install.sh $(HOST_RUST_BIN_INSTALL_COMMON_OPTS))
 endef
 endif
 
 define HOST_RUST_BIN_INSTALL_CMDS
        $(HOST_RUST_BIN_INSTALL_RUSTC)
-       $(HOST_RUST_BIN_INSTALL_LIBSTD_HOST)
        $(HOST_RUST_BIN_INSTALL_LIBSTD_TARGET)
 endef
 
+HOST_RUST_BIN_POST_INSTALL_HOOKS += HOST_RUST_INSTALL_CARGO_CONFIG
+
 $(eval $(host-generic-package))
index 2f6a212e590cdba072a96d479499f7e659a40009..31721f1dd673d4bec04e4c82ba9db306b8ec2bcc 100644 (file)
@@ -48,7 +48,7 @@ define HOST_RUST_CONFIGURE_CMDS
        ( \
                echo '[build]'; \
                echo 'target = ["$(RUSTC_TARGET_NAME)"]'; \
-               echo 'cargo = "$(HOST_CARGO_BIN_DIR)/cargo/bin/cargo"'; \
+               echo 'cargo = "$(HOST_RUST_BIN_DIR)/cargo/bin/cargo"'; \
                echo 'rustc = "$(HOST_RUST_BIN_DIR)/rustc/bin/rustc"'; \
                echo 'python = "$(HOST_DIR)/bin/python$(HOST_RUST_PYTHON_VERSION)"'; \
                echo 'submodules = false'; \