diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2023-03-09 08:49:57 +0100 |
---|---|---|
committer | Daniel Golle <daniel@makrotopia.org> | 2023-03-10 14:24:16 +0000 |
commit | 2d3e0da71198c4fa7ec981d3c607df84e13a9417 (patch) | |
tree | ddcca6a9759b73a3ca0fa62f2c1c4889bb0ac738 | |
parent | 44d1d22a16e25b1e06fae86e157718069b7069f6 (diff) |
rust-lang: Add an Host/Compile helper as well
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
-rw-r--r-- | lang/rust/maturin/Makefile | 9 | ||||
-rw-r--r-- | lang/rust/rust-package.mk | 11 |
2 files changed, 13 insertions, 7 deletions
diff --git a/lang/rust/maturin/Makefile b/lang/rust/maturin/Makefile index 0249bf9ad..c2ed4bcd1 100644 --- a/lang/rust/maturin/Makefile +++ b/lang/rust/maturin/Makefile @@ -36,12 +36,7 @@ define Package/maturin 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 @@ -51,7 +46,7 @@ endef 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)) diff --git a/lang/rust/rust-package.mk b/lang/rust/rust-package.mk index 472417a61..54c2aa89a 100644 --- a/lang/rust/rust-package.mk +++ b/lang/rust/rust-package.mk @@ -7,6 +7,17 @@ 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 ( \ cd $(PKG_BUILD_DIR) ; \ |