Skip to content

Commit

Permalink
rust: Update binary archive handling logic
Browse files Browse the repository at this point in the history
Signed-off-by: Donald Hoskins <grommish@gmail.com>
  • Loading branch information
Grommish committed Dec 12, 2020
1 parent 3a50b84 commit f56c571
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions lang/rust/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ RUST_TMP_DIR:=$(TMP_DIR)/rust-install
RUST_INSTALL_FILE_NAME:=$(PKG_NAME)-$(PKG_VERSION)-$(RUSTC_HOST_ARCH)_$(RUSTC_TARGET_ARCH)-install.tar.xz
RUST_INSTALL_FILE_VERIFY:=$(call check_hash,$(RUST_INSTALL_FILE_NAME),$(RUST_INSTALL_FILE_HASH),RUST_INSTALL_FILE_HASH)
RUST_INSTALL_UNINSTALL:=$(CARGO_HOME)/lib/rustlib/uninstall.sh
RUST_INSTALL_BINARIES:=$(CURDIR)/install_binaries.sh $(RUST_TMP_DIR) $(RUST_INSTALL_FILE_NAME) $(CARGO_HOME)
RUST_INSTALL_FILE_HASH:=skip

RUST_BINARY=$(or $(and $(wildcard $(DL_DIR)/$(RUST_INSTALL_FILE_NAME)),true),false)
Expand All @@ -78,21 +79,22 @@ define Host/Configure
$(info In Configure)
# Required because OpenWrt Default CONFIGURE_ARGS contain extra
# args that cause errors
[ $(RUST_BINARY) = true ] && true || \
cd $(HOST_BUILD_DIR) && \
[ $(RUST_BINARY) = true ] && \
( true ) || \
( cd $(HOST_BUILD_DIR) && \
RUST_BACKTRACE=full \
./configure $(CONFIGURE_ARGS)
./configure $(CONFIGURE_ARGS) )
endef

define Host/Compile
$(info In Compile)
[ $(RUST_BINARY) = true ] && true || \
cd $(HOST_BUILD_DIR) && \
RUST_BACKTRACE=full \
[ $(RUST_BINARY) = true ] && ( true ) || \
( cd $(HOST_BUILD_DIR) && \
( RUST_BACKTRACE=full \
$(PYTHON) x.py --config ./config.toml dist cargo extended \
library/std llvm-tools miri rust-dev rustc-dev src \
src/librustc src/lldb_batchmode.py src/tools/build-manifest
$(call Host/CreateBinaries)
src/librustc src/lldb_batchmode.py src/tools/build-manifest ) && \
( $(RUST_INSTALL_BINARIES)))
endef

define Host/CreateBinaries
Expand Down Expand Up @@ -121,6 +123,9 @@ define Host/Prepare
[ -L $(BUILD_DIR_HOST)/rust ] || \
(cd $(BUILD_DIR_HOST); ln -s "$(PKG_NAME)-$(PKG_VERSION)" rust)

[ -d $(RUST_TMP_DIR) ] || \
mkdir -p $(RUST_TMP_DIR)

$(call Host/Prepare/Default)
endef

Expand Down

0 comments on commit f56c571

Please sign in to comment.