Hello, I try to use a rust library in zcash (1.0.13). Therefore I
- created a rust library mylib
- created an archive of mylib containing
- Cargo.toml
- include
- src
- .gitignore
so it contains everything needed.
- added RUST_LIBS=“-lrustzcash -lmylib -lutil -ldl -lrt -lpthread -lgcc_s -lc -lm -lrt -lpthread -lutil” to configure .ac
- added rust_packages := rust librustzcash mylib to packages.mk
- created a mylib .mk
package=mylib
(package)_version=0.1
(package)_download_path=path/(package)/downloads
(package)_file_name=(package)-((package)_version).tar.gz
(package)_sha256_hash=cf37f29ee729add6c10a1d2e140925c08295f8504d366df8eb29844eeb505871
$(package)_dependencies=rust
define $(package)_build_cmds
cargo build --release
endef
define (package)_stage_cmds
mkdir ((package)_staging_dir)(host_prefix)/lib/ &&
mkdir ((package)_staging_dir)(host_prefix)/include/ && \
cp target/release/mylib.a ((package)_staging_dir)(host_prefix)/lib/ &&
cp include/rmylib.h ((package)_staging_dir)$(host_prefix)/include/
endef
- run "./zcutil/build.sh -j(nproc)"
The archive is downloaded, but during build the error “could not find Cargo.toml” is shown. The downloaded archive contains the Cargo.toml. When I uncompress it and run cargo build everything works, but it isn’t in the build directory depends/work/build/x86_64-unknown-linux-gnu/mylib/0.1-f61d469ce6e`
I compared my .mk file to another rust library but didn’t find any difference.
Could please somebody help me to find out what I am missing. PS, I am a novice to Rust and Zcash.