Browse Source
depends: Configure librustzcash for cross-compiling
pull/4/head
Jack Grigg
6 years ago
No known key found for this signature in database
GPG Key ID: 1B8D649257DB0829
2 changed files with
16 additions and
2 deletions
-
depends/packages/librustzcash.mk
-
depends/patches/librustzcash/cargo.config
|
|
@ -8,18 +8,29 @@ $(package)_git_commit=f5d2afb4eabac29b1b1cc860d66e45a5b48b4f88 |
|
|
|
$(package)_dependencies=rust $(rust_crates) |
|
|
|
$(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 |
|
|
|
mkdir .cargo && \
|
|
|
|
cat $($(package)_patch_dir)/cargo.config | sed 's|CRATE_REGISTRY|$(host_prefix)/$(CRATE_REGISTRY)|' > .cargo/config |
|
|
|
endef |
|
|
|
|
|
|
|
define $(package)_build_cmds |
|
|
|
cargo build --frozen --release |
|
|
|
cargo build $($(package)_build_opts) |
|
|
|
endef |
|
|
|
|
|
|
|
define $(package)_stage_cmds |
|
|
|
mkdir $($(package)_staging_dir)$(host_prefix)/lib/ && \
|
|
|
|
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/ |
|
|
|
endef |
|
|
|
|
|
@ -13,3 +13,6 @@ replace-with = "vendored-sources" |
|
|
|
|
|
|
|
[source.vendored-sources] |
|
|
|
directory = "CRATE_REGISTRY" |
|
|
|
|
|
|
|
[target.x86_64-pc-windows-gnu] |
|
|
|
linker = "x86_64-w64-mingw32-gcc" |
|
|
|