Error when building rust dependency

Hello, I try to use a rust library in zcash (1.0.13). Therefore I

  1. created a rust library mylib
  2. created an archive of mylib containing
  • Cargo.toml
  • include
  • src
  • .gitignore
    so it contains everything needed.
  1. added RUST_LIBS="-lrustzcash -lmylib -lutil -ldl -lrt -lpthread -lgcc_s -lc -lm -lrt -lpthread -lutil" to configure .ac
  2. added rust_packages := rust librustzcash mylib to
  3. created a mylib .mk


define $(package)_build_cmds
cargo build --release

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/

  1. run $ “./zcutil/ -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.