endef
define Host/Compile
- ( \
- cd $(HOST_BUILD_DIR) ; \
- export PATH="$(CARGO_HOME)/bin:$(PATH)" ; \
- CARGO_HOME=$(CARGO_HOME) \
- cargo install --path . --root $(HOST_BUILD_DIR) ; \
- )
+ $(call Host/Compile/Cargo)
endef
define Package/maturin/description
define Host/Install
$(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/bin
- $(INSTALL_BIN) $(HOST_BUILD_DIR)/bin/maturin $(STAGING_DIR_HOSTPKG)/bin/maturin
+ $(INSTALL_BIN) $(HOST_INSTALL_DIR)/bin/maturin $(STAGING_DIR_HOSTPKG)/bin/maturin
endef
$(eval $(call HostBuild))
rust_mk_path:=$(dir $(lastword $(MAKEFILE_LIST)))
include $(rust_mk_path)rust-host.mk
+# $(1) path to the package
+# $(2) additional arguments to cargo
+define Host/Compile/Cargo
+ ( \
+ cd $(HOST_BUILD_DIR) ; \
+ export PATH="$(CARGO_HOME)/bin:$(PATH)" ; \
+ CARGO_HOME=$(CARGO_HOME) CC=$(HOSTCC) \
+ cargo install -v --profile stripped --root $(HOST_INSTALL_DIR) --path "$(if $(strip $(1)),$(strip $(1)),.)" $(2) ; \
+ )
+endef
+
# $(1) path to the package
# $(2) additional arguments to cargo
define Build/Compile/Cargo