How to specify environment variables for Cargo?

I need to override $PATH for a dependency’s build script, in order to make it call a local executable (instead of a system’s one). I tried outputting cargo:rustc-env=PATH=... on my own build script, but it did not work (I assumed this only changes environment for source under src dir, with env! macro). Is there a way of specifying environment variables in Cargo.toml os something similar?

Currently I am using a dummy shell script:

PS: I want something that can be built by crates.io, I don’t want to run PATH=... cargo run