2018-02-04 19:07:41 +01:00
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# rust-bin
|
|
|
|
#
|
|
|
|
################################################################################
|
|
|
|
|
2018-05-02 11:53:30 +02:00
|
|
|
RUST_BIN_VERSION = 1.25.0
|
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
|
|
|
|
|
2018-02-13 08:21:27 +01:00
|
|
|
HOST_RUST_BIN_SOURCE = rustc-$(RUST_BIN_VERSION)-$(RUSTC_HOST_NAME).tar.xz
|
2018-02-04 19:07:41 +01:00
|
|
|
|
|
|
|
HOST_RUST_BIN_EXTRA_DOWNLOADS = \
|
2018-02-13 08:21:27 +01:00
|
|
|
rust-std-$(RUST_BIN_VERSION)-$(RUSTC_HOST_NAME).tar.xz \
|
|
|
|
rust-std-$(RUST_BIN_VERSION)-$(RUSTC_TARGET_NAME).tar.xz
|
2018-02-04 19:07:41 +01:00
|
|
|
|
2018-02-13 08:21:27 +01:00
|
|
|
HOST_RUST_BIN_LIBSTD_HOST_PREFIX = rust-std-$(RUST_BIN_VERSION)-$(RUSTC_HOST_NAME)/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
|
|
|
)
|
2018-05-02 11:53:30 +02:00
|
|
|
cd $(@D)/rustc/lib/rustlib/$(RUSTC_HOST_NAME); \
|
|
|
|
ln -sf ../../../../std/$(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
|
|
|
|
|
|
|
|
HOST_RUST_BIN_INSTALL_OPTS = \
|
|
|
|
--prefix=$(HOST_DIR) \
|
|
|
|
--disable-ldconfig
|
|
|
|
|
|
|
|
ifeq ($(BR2_PACKAGE_HOST_RUST_BIN),y)
|
|
|
|
define HOST_RUST_BIN_INSTALL_RUSTC
|
|
|
|
(cd $(@D); \
|
|
|
|
./install.sh $(HOST_RUST_BIN_INSTALL_OPTS))
|
|
|
|
endef
|
|
|
|
|
|
|
|
define HOST_RUST_BIN_INSTALL_LIBSTD_HOST
|
2018-02-13 08:21:27 +01:00
|
|
|
(cd $(@D)/std/rust-std-$(RUST_BIN_VERSION)-$(RUSTC_HOST_NAME); \
|
2018-02-04 19:07:41 +01:00
|
|
|
./install.sh $(HOST_RUST_BIN_INSTALL_OPTS))
|
|
|
|
endef
|
|
|
|
|
|
|
|
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); \
|
2018-02-04 19:07:41 +01:00
|
|
|
./install.sh $(HOST_RUST_BIN_INSTALL_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
|
|
|
|
|
|
|
|
$(eval $(host-generic-package))
|