depends: Configure librustzcash for cross-compiling
This commit is contained in:
@@ -8,18 +8,29 @@ $(package)_git_commit=f5d2afb4eabac29b1b1cc860d66e45a5b48b4f88
|
|||||||
$(package)_dependencies=rust $(rust_crates)
|
$(package)_dependencies=rust $(rust_crates)
|
||||||
$(package)_patches=cargo.config
|
$(package)_patches=cargo.config
|
||||||
|
|
||||||
|
ifeq ($(host_os),mingw32)
|
||||||
|
$(package)_library_file=target/x86_64-pc-windows-gnu/release/rustzcash.lib
|
||||||
|
else
|
||||||
|
$(package)_library_file=target/release/librustzcash.a
|
||||||
|
endif
|
||||||
|
|
||||||
|
define $(package)_set_vars
|
||||||
|
$(package)_build_opts=--frozen --release
|
||||||
|
$(package)_build_opts_mingw32=--target=x86_64-pc-windows-gnu
|
||||||
|
endef
|
||||||
|
|
||||||
define $(package)_preprocess_cmds
|
define $(package)_preprocess_cmds
|
||||||
mkdir .cargo && \
|
mkdir .cargo && \
|
||||||
cat $($(package)_patch_dir)/cargo.config | sed 's|CRATE_REGISTRY|$(host_prefix)/$(CRATE_REGISTRY)|' > .cargo/config
|
cat $($(package)_patch_dir)/cargo.config | sed 's|CRATE_REGISTRY|$(host_prefix)/$(CRATE_REGISTRY)|' > .cargo/config
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define $(package)_build_cmds
|
define $(package)_build_cmds
|
||||||
cargo build --frozen --release
|
cargo build $($(package)_build_opts)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define $(package)_stage_cmds
|
define $(package)_stage_cmds
|
||||||
mkdir $($(package)_staging_dir)$(host_prefix)/lib/ && \
|
mkdir $($(package)_staging_dir)$(host_prefix)/lib/ && \
|
||||||
mkdir $($(package)_staging_dir)$(host_prefix)/include/ && \
|
mkdir $($(package)_staging_dir)$(host_prefix)/include/ && \
|
||||||
cp target/release/librustzcash.a $($(package)_staging_dir)$(host_prefix)/lib/ && \
|
cp $($(package)_library_file) $($(package)_staging_dir)$(host_prefix)/lib/ && \
|
||||||
cp include/librustzcash.h $($(package)_staging_dir)$(host_prefix)/include/
|
cp include/librustzcash.h $($(package)_staging_dir)$(host_prefix)/include/
|
||||||
endef
|
endef
|
||||||
|
|||||||
@@ -13,3 +13,6 @@ replace-with = "vendored-sources"
|
|||||||
|
|
||||||
[source.vendored-sources]
|
[source.vendored-sources]
|
||||||
directory = "CRATE_REGISTRY"
|
directory = "CRATE_REGISTRY"
|
||||||
|
|
||||||
|
[target.x86_64-pc-windows-gnu]
|
||||||
|
linker = "x86_64-w64-mingw32-gcc"
|
||||||
|
|||||||
Reference in New Issue
Block a user