2018-02-04 19:07:41 +01:00
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# rust-bin
|
|
|
|
#
|
|
|
|
################################################################################
|
|
|
|
|
2022-01-29 21:34:38 +01:00
|
|
|
RUST_BIN_VERSION = 1.58.1
|
2018-02-04 19:07:41 +01:00
|
|
|
RUST_BIN_SITE = https://static.rust-lang.org/dist
|
|
|
|
RUST_BIN_LICENSE = Apache-2.0 or MIT
|
|
|
|
RUST_BIN_LICENSE_FILES = LICENSE-APACHE LICENSE-MIT
|
|
|
|
|
|
|
|
HOST_RUST_BIN_PROVIDES = host-rustc
|
|
|
|
|
2020-02-07 19:08:29 +01:00
|
|
|
HOST_RUST_BIN_SOURCE = rust-$(RUST_BIN_VERSION)-$(RUSTC_HOST_NAME).tar.xz
|
2018-08-23 00:33:50 +02:00
|
|
|
|
|
|
|
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
|
2018-02-04 19:07:41 +01:00
|
|
|
|
2020-02-07 19:08:29 +01:00
|
|
|
HOST_RUST_BIN_LIBSTD_HOST_PREFIX = rust-std-$(RUSTC_HOST_NAME)
|
2018-02-04 19:07:41 +01:00
|
|
|
|
|
|
|
define HOST_RUST_BIN_LIBSTD_EXTRACT
|
|
|
|
mkdir -p $(@D)/std
|
|
|
|
$(foreach f,$(HOST_RUST_BIN_EXTRA_DOWNLOADS), \
|
2018-04-02 20:36:24 +02:00
|
|
|
$(call suitable-extractor,$(f)) $(HOST_RUST_BIN_DL_DIR)/$(f) | \
|
2018-02-04 19:07:41 +01:00
|
|
|
$(TAR) -C $(@D)/std $(TAR_OPTIONS) -
|
2018-02-08 23:28:07 +01:00
|
|
|
)
|
2019-04-06 16:42:10 +02:00
|
|
|
mkdir -p $(@D)/rustc/lib/rustlib/$(RUSTC_HOST_NAME)/lib
|
|
|
|
cd $(@D)/rustc/lib/rustlib/$(RUSTC_HOST_NAME)/lib; \
|
2020-02-07 19:08:29 +01:00
|
|
|
ln -sf ../../../../../$(HOST_RUST_BIN_LIBSTD_HOST_PREFIX)/lib/rustlib/$(RUSTC_HOST_NAME)/lib/* .
|
2018-02-04 19:07:41 +01:00
|
|
|
endef
|
|
|
|
|
|
|
|
HOST_RUST_BIN_POST_EXTRACT_HOOKS += HOST_RUST_BIN_LIBSTD_EXTRACT
|
|
|
|
|
2020-02-07 19:08:29 +01:00
|
|
|
HOST_RUST_BIN_INSTALL_COMMON_OPTS = \
|
2018-02-04 19:07:41 +01:00
|
|
|
--prefix=$(HOST_DIR) \
|
|
|
|
--disable-ldconfig
|
|
|
|
|
2020-02-07 19:08:29 +01:00
|
|
|
HOST_RUST_BIN_INSTALL_OPTS = \
|
|
|
|
$(HOST_RUST_BIN_INSTALL_COMMON_OPTS) \
|
|
|
|
--components=rustc,cargo,rust-std-$(RUSTC_HOST_NAME)
|
|
|
|
|
2018-02-04 19:07:41 +01:00
|
|
|
define HOST_RUST_BIN_INSTALL_RUSTC
|
|
|
|
(cd $(@D); \
|
|
|
|
./install.sh $(HOST_RUST_BIN_INSTALL_OPTS))
|
|
|
|
endef
|
|
|
|
|
2018-08-23 00:33:50 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS),y)
|
2018-02-04 19:07:41 +01:00
|
|
|
define HOST_RUST_BIN_INSTALL_LIBSTD_TARGET
|
2018-02-13 08:21:27 +01:00
|
|
|
(cd $(@D)/std/rust-std-$(RUST_BIN_VERSION)-$(RUSTC_TARGET_NAME); \
|
2020-02-07 19:08:29 +01:00
|
|
|
./install.sh $(HOST_RUST_BIN_INSTALL_COMMON_OPTS))
|
2018-02-04 19:07:41 +01:00
|
|
|
endef
|
|
|
|
endif
|
|
|
|
|
|
|
|
define HOST_RUST_BIN_INSTALL_CMDS
|
|
|
|
$(HOST_RUST_BIN_INSTALL_RUSTC)
|
|
|
|
$(HOST_RUST_BIN_INSTALL_LIBSTD_TARGET)
|
|
|
|
endef
|
|
|
|
|
2020-02-07 19:08:29 +01:00
|
|
|
HOST_RUST_BIN_POST_INSTALL_HOOKS += HOST_RUST_INSTALL_CARGO_CONFIG
|
|
|
|
|
2018-02-04 19:07:41 +01:00
|
|
|
$(eval $(host-generic-package))
|